+ Reply to Thread
Results 1 to 8 of 8

Thread: Include PHP in HTML

  1. #1
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Include PHP in HTML

    How to do it? I tried to include this in my overall_header.html file but it didn't work:

    PHP Code:
    require('security/munin.php');
    munin('security/'); 
    It is to a script that works like a firewall on my site and stops hacking attempts.
    Last edited by galaxyAbstractor; 10-29-2007 at 02:01 PM.

  2. #2
    Thewinator is offline x10 Lieutenant Thewinator is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    [NL]
    Posts
    256

    Re: Include PHP in HTML

    overall_header.html is a template file.
    A template has to be loaded by a php file.
    Try to find that file and include the code there, becouse you cant put php code in a html file unless you told the php file that loads it to insert code there.



  3. #3
    mattura's Avatar
    mattura is offline x10 Elder mattura is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    563

    Re: Include PHP in HTML

    Also make sure you surround it with the tags:
    <?php
    /*code goes here*/
    ?>

    You could rename overall_header.html to overall_header.php, include the php as above, then paste any html after it

    Did you look in the script at all? Do you understand it?
    Did you download it from somewhere that claimed it would prevent hackers? If so, that is not the way forward. If you are worried about hackers, learn to understand your site and what happens within it (especially with regard to dynamic content, if any). Probably if you just have static pages (ie html), you won't get hacked unless you give somebody your password/ftp or someone sniffs when you use unencrypted ftp. With dynamic content, such as php, learn how you protect your form inputs, GET, POST etc by taking a good read at:
    http://docs.php.net/manual/en/security.php
    Only when you understand the threats (if any) can you prevent hackers.
    ----
    Life is a game. The conception is terrible but the graphics are amazing!
    matt.elementfx.com

  4. #4
    Slothie's Avatar
    Slothie is offline Lord Of The Keys Slothie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    1,432

    Re: Include PHP in HTML

    OR! you could put in it INDEX.PHP or w/e file that is always loaded

    Easiest 70 points you'll make on x10

    Feel free to add my reputation by clicking on the if you found my post helpful to you :P


    If I am not responding to your PMs, that means I am ignoring you. Take a hint.



    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


  5. #5
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: Include PHP in HTML

    I thought so too but if the bot/hacker is going to ex: viewtopic.php or memberlist.php that code will disappear and that will result in I need to insert that code in 200+ files of php. I know who did this script so I think it will work. Maybe not preventing all because that would be impossible but protecting somewhat.

    If I rename overall_header.html to overall_header.php then I am in the same situation to edit 200+ files to the chang, aren't I?

  6. #6
    conker87 is offline x10Hosting Member conker87 is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    UK
    Posts
    65

    Re: Include PHP in HTML

    Afraid so. You could just make it so the server parses the html files as php.

    Just add this into your .htaccess file:
    Code:
    AddType application/x-httpd-php .php .html

  7. #7
    naim4u's Avatar
    naim4u is offline x10Hosting Member naim4u is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    51

    Re: Include PHP in HTML

    hi,
    iam Naim.


    i wanna tell you one thing ... it is immpossible to inclue php in a html.
    you can put it in form of iframe as this:

    // <iframe width=780 height=814 src="http://www.naimonline.net.ms" scrolling="auto" frameborder="0"></iframe> //
    byeee

  8. #8
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: Include PHP in HTML

    but iframe is for showing things? Since it is a firewall to stop hackers I don't think I want to show it on my header...

+ Reply to Thread

Similar Threads

  1. Sigo con problemas con phpbb2
    By reciecho in forum Soporte
    Replies: 7
    Last Post: 10-20-2007, 06:28 PM
  2. "PHP Startup: Invalid Library" - Interesting error
    By javaguy78 in forum Free Hosting
    Replies: 5
    Last Post: 03-27-2007, 02:33 PM
  3. Include php into Html
    By Tyler in forum Scripts & 3rd Party Apps
    Replies: 11
    Last Post: 07-13-2005, 08:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers