Php include help

Status
Not open for further replies.

mark62

New Member
Messages
10
Reaction score
0
Points
0
I'm putting a walkthrough on my site so I'm making alot of files (not made yet) that means I need a new folder because my site isn't that big yet this is my first folder with files (other than my image folder) for my website I tried some includes and the one that uses a file in the same folder works but the ones that have files outside the folder don't work and I used my full domain http://www.pokebomb.co.cc/thefile.whatever below is the code
Code:
<html>
<head>
<title>Pokebomb</title>
<?php include('http://www.pokebomb.co.cc/top.html'); ?>
<h2> HG/SS Walkthrough</h2>
<?php include('contents.html'); ?>
<h2>A journey begins</h2>
<p>GIANT WALKTHROUGH PARAGRAPH</p> 
</td>
<?php include('http://www.pokebomb.co.cc/rightctp.html'); ?>
<?php include('http://www.pokebomb.co.cc/rightcbottom.html'); ?>
</td> 
</tr>
</table>
</body>
</html>
 

techairlines

x10 Flyer
Community Support
Messages
2,867
Reaction score
165
Points
63
I don't think its a good idea to use the full URL.

If your main PHP file is located in mydomain.com/phpfiles/index.php and you need to include a file at mydomain.com/myfile.php, use the following code:

Code:
<?php include('../myfile.php'); ?>

If the PHP file you include is located in mydomain.com/phpfiles/newfiles/myfile.php, use the following code:

Code:
<?php include('newfiles/myfile.php'); ?>

In addition, the files you use the include for should be PHP files as well.

Learn about PHP Server Side Includes: http://www.w3schools.com/PHP/php_includes.asp
 
Last edited:
Status
Not open for further replies.
Top