PDA

View Full Version : PHP Includes



D!
20th May 2006, 06:39 AM
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..

youdontknowme
23rd May 2006, 10:51 PM
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?

Jeff
24th May 2006, 01:43 PM
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.

D!
2nd June 2006, 01:28 AM
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..



<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, a:visited, 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



</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>

Chris
2nd June 2006, 04:56 AM
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.

D!
2nd June 2006, 08:27 PM
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!