Results 1 to 6 of 6

Thread: PHP Includes

  1. #1
    Banned
    Join Date
    May 2006
    Posts
    60

    Default PHP Includes

    I've tried it, but it never seems to work..

    I run XP, so could it be possible that PHP isn't running on my computer?

    Anyone know how to work out PHP includes, or perhaps a different way to add includes?
    I just don't want a website where I have to edit 500+ pages because I added 1 page..

  2. #2

    Default Re: PHP Includes

    PHP is server-side, so you don't need anything on your computer for it.
    Does your web host support PHP? If so, what does your code look like?

  3. #3
    Cloyster Moderator
    Moderator
    Jeff's Avatar
    Join Date
    Nov 2004
    Location
    Maryland, USA
    Posts
    4,453

    Default Re: PHP Includes

    If you're testing this locally then yeah, you're going to need some PHP software installed and running on your computer to make it work, if you're testing it server-side make sure the server supports PHP.
    Winner of the Unown Awards: 2008 "Hard Work", 2010 "Dedicated", 2012 "Journalist", 2012 "Unown", 2013 "Anchorman", 2014 "Unown", 2015 "Jeff Jeff Jeff Jeff!"



    Facebook - YouTube - Miiverse
    Diamond: 1418 3196 1413 - SoulSilver: 0217 4582 5426 - White: 1119 9535 7054 - White 2: 1421 4560 4887 - X: same as 3DS
    3DS: 3866 8018 5231 - AIM: IslanderJeff02
    Joined November 8, 2004 - Modded October 24, 2008

  4. #4
    Banned
    Join Date
    May 2006
    Posts
    60

    Default Re: PHP Includes

    Quote Originally Posted by youdontknowme
    PHP is server-side, so you don't need anything on your computer for it.
    Does your web host support PHP? If so, what does your code look like?
    I haven't uploaded it to any website as of yet..
    It's on my computer, and whenever I open it up in my browser it won't work..
    A blank page just comes up, or just the text I put in on the page I want it all displayed in..
    I use a program called Textpad to edit my website..

    Here's the code for the two Header pages..

    Quote Originally Posted by header1.html
    <html>
    <head>
    <title>Title of Page</title>
    <style type="text/css">
    body {
    background-color: #d8a50a;
    }

    td {

    color: 0099FF;
    font-family: verdana;
    font-size: 11px;
    border: 1px solid #000000;
    }
    a { text-decoration: none; }
    a:link, aisited, a:active { color: #8a9329; font-weight: bold; }
    a:hover { color: #d4e422; text-decoration: underline; }


    </style>
    </head>
    <body>

    <table bgcolor="ffc000" width="750px" align="center" cellspacing="0">
    <tr><td colspan="3" width="100%" valign="top"><center><img src="psunshinebanner.png"></center></td></tr>
    <tr><td width="15%" valign="top"><table bgcolor="999933" border="0px"><tr><td width="120"><font color="CCCC00" face="verdana"><b>Main</font></b></td></tr></table><br>
    <a href=""> Berrydex</a><br>
    <a href=""> Homepage</a><br >
    <a href=""> Forums</a><br>
    <a href=""> Fan Work</a><br>
    <a href=""> Pokedex</a><br>
    <a href=""> Berrydex</a><br><br>
    <table bgcolor="999933" border="0px"><tr><td width="120"><font color="CCCC00" face="verdana"><b>Anime</font></b></td></tr></table><br>
    <a href=""> Berrydex</a><br>
    <a href=""> Episode Guide</a><br>
    <a href=""> Movie Guide</a><br>
    <a href=""> Pikachu Shorts</a><br>
    <a href=""> Character Bios</a><br><br>
    <table bgcolor="999933" border="0px"><tr><td width="120"><font color="CCCC00" face="verdana"><b>Games</font></b></td></tr></table><br>
    <a href=""> Berrydex</a><br>
    <a href=""> Walkthroughs</a><br>
    <a href=""> Game Descriptions</a><br>
    <a href=""> Cheats/Hints</a><br><br>
    </td>
    <td width="70%" valign="top">
    and

    Quote Originally Posted by header2.html
    </td>
    <td width="15%" valign="top"><table bgcolor="999933" border="0px"><tr><td width="120"><font color="CCCC00" face="verdana"><b>Affiliates</font></b></td></tr></table><br><br>
    <br>
    <br>
    <table bgcolor="999933" border="0px"><tr><td width="120"><font color="CCCC00" face="verdana"><b>Pokemon Sunshine</font></b></td></tr></table><br>
    <a href="">About Us</a><br>
    <a href="">Link To Us</a><br>
    <a href="">Contact Us </a><br>
    </td>
    </tr>

    <tr><td colspan="3" width="100%" valign="top"><center>Pokemon (C) Nintendo, Game Freak. Pokemon Sunshine (C) <b>White Lightning</b></center></td></tr>
    </table>
    </body>
    </html>
    Here's the page I want it all displayed in.

    <html>

    <body>

    <?php require('./header1.html'); ?>



    <?php require('./header2.html'); ?>


    </body>

    </html>

  5. #5
    Administrator
    Administrator

    Join Date
    Apr 2001
    Posts
    19,363

    Default Re: PHP Includes

    Quote Originally Posted by D!
    I haven't uploaded it to any website as of yet..
    It's on my computer, and whenever I open it up in my browser it won't work..
    A blank page just comes up, or just the text I put in on the page I want it all displayed in..
    I use a program called Textpad to edit my website..

    Here's the code for the two Header pages..

    and

    Here's the page I want it all displayed in.
    See, there's the problem - PHP is a server-side language, and since your script isn't running on a web server with PHP installed, it's not going to do anything. You need to upload it to a web server that does support PHP in order for it to work.
    n/t

  6. #6
    Banned
    Join Date
    May 2006
    Posts
    60

    Default Re: PHP Includes

    Really?
    And then my site would work?
    Wow!
    Thanks dude!
    You don't know how much this helps me!

    To everyone who contributed to this thread:
    YOU ROCK!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •