USERNAME:
PASSWORD:
Save Info!
Logging in…
This topic is 1 page long.
[ Profile | Posts | Contact ]
Posted at: 6/10/09 02:44 PM
Sign-Up: 06/30/08
Posts: 2,167
Link
I tried to use PHP (PHP 4) includes on my website to make things easier- but when I went to test it the page it was covered in errors.
I'm using this code:
<?php include("url"); ?>
What did I do wrong?
The following sentence is true. The previous sentence is false. O_o PARADOX! Linux Users Club | Linketylinklinklinklink...
Posted at: 6/10/09 03:00 PM
Sign-Up: 06/25/05
Posts: 16,128
you can only include from the same server and in the same web root, so
<?php include ("folder/file.php"); ?>
will work, if you want to include external files you use file_get_contents.
I make websites. Find all threads by a user, Top Newgrounds BBS posters, Newgrounds account ID, Link to specific posts and whatever else I have listed at m00d.net
Posted at: 6/10/09 03:27 PM
At 6/10/09 03:00 PM, citricsquid wrote: you can only include from the same server and in the same web root, so <?php include ("folder/file.php"); ?> will work, if you want to include external files you use file_get_contents.
I put all of the includes in a different directory but its in the same server/web root. Ex. <?php include("http://www.randomns013.com/incl udes/navigation.php"); ?>
Posted at: 6/10/09 03:30 PM
Sign-Up: 07/27/08
Posts: 854
The include parameter has to be relative, i.e. you can't use full URL's like that.
Posted from Linux. Distro may vary.
Posted at: 6/10/09 03:32 PM
At 6/10/09 03:27 PM, bgraybr wrote: <?php include("http://www.randomns013.com/incl udes/navigation.php"); ?>
<?php include("includes/navigation.php"); ?>
You can't use full URLs...
Posted at: 6/10/09 03:33 PM
Sign-Up: 02/13/03
Posts: 1,686
You use the path on the file system to include the file, not the url.
Posted at: 6/10/09 08:59 PM
Sign-Up: 06/10/07
Posts: 2,302
I'll say it as well...
You can't use full URL's!
Posted at: 6/11/09 09:03 AM
Sign-Up: 12/16/99
Posts: 8,913
You can use full URLs (in 4.3.0 +) if allow_url_fopen is enabled, though of course, the information in the page is already parsed at that point.
Posted at: 6/11/09 11:41 AM
At 6/11/09 09:03 AM, liljim wrote: You can use full URLs (in 4.3.0 +) if allow_url_fopen is enabled, though of course, the information in the page is already parsed at that point.
While this is an perfectly valid point, I would suggest for someone who can't work out includes to just have the sweeping statement mentioned above ;)
Posted at: 6/11/09 12:21 PM
Sign-Up: 09/10/04
Posts: 3,671
It's inefficient, will do the parsing twice, and is often disabled due to most of the time, it's only used to exploit other people.
Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.
Posted at: 6/11/09 12:42 PM
At 6/11/09 12:21 PM, henke37 wrote: It's inefficient, will do the parsing twice, and is often disabled due to most of the time, it's only used to exploit other people.
I didn't say it was a practical thing to do, I was just disputing those who said you can't do it.
All times are Eastern Standard Time (GMT -5) | Current Time: 02:38 AM
<< Back