3s2ng Posted November 26, 2006 Share Posted November 26, 2006 Hello Freaks,My script works before but now its not working. I suspected that the problem was on the includes. I think the includes were not being executed. I can say that the problem was on the includes because currently the includes look like thisinclude $siteurl."/test.php";But if i change that include to include ("../test.php");it works.What is wrong with my original include? Can you tell me whats wrong?the value of $siteurl = "http://www.mydomain.com";Added info.register_globals is set to OFF and allow_url_fopen is set to ON. I hope you can help me. I dont want to change all the includes to this format: include ("../test.php"); Because I also got a script that access a URL. ex. include "http://www.otherdomain.com/news.php?tech=php&id=2765";Thanks,MARK Link to comment https://forums.phpfreaks.com/topic/28493-include-problem/ Share on other sites More sharing options...
Philip Posted November 26, 2006 Share Posted November 26, 2006 Try:[code]<?php$path = "http://www.mydomain.com/";include($path.'test.php');?>[/code] Link to comment https://forums.phpfreaks.com/topic/28493-include-problem/#findComment-130384 Share on other sites More sharing options...
3s2ng Posted November 26, 2006 Author Share Posted November 26, 2006 Still not working. Its the same as my old includes. Link to comment https://forums.phpfreaks.com/topic/28493-include-problem/#findComment-130410 Share on other sites More sharing options...
3s2ng Posted November 26, 2006 Author Share Posted November 26, 2006 up Link to comment https://forums.phpfreaks.com/topic/28493-include-problem/#findComment-130559 Share on other sites More sharing options...
kenrbnsn Posted November 26, 2006 Share Posted November 26, 2006 You really don't want to use a full URL with the include statement. Doing this causes the include file to be processed by another invocation of the webserver and whatever is defined in said include file gets defined in that context, not your script's context. Use standard filesystem paths with your icludes for local files.Ken Link to comment https://forums.phpfreaks.com/topic/28493-include-problem/#findComment-130584 Share on other sites More sharing options...
3s2ng Posted November 26, 2006 Author Share Posted November 26, 2006 Hi Ken,Thanks for your reply. But how about if I want to include a file which is on the other domain or server? I'm using this service [url=http://www.news4sites.com/service/newsfeed.php?tech=php&id=13]http://www.news4sites.com/service/newsfeed.php?tech=php&id=13[/url]. this was working before. It maybe a misconfiguration on the php.ini and I need to findout what should be the correct config.I hope you can help me. Link to comment https://forums.phpfreaks.com/topic/28493-include-problem/#findComment-130604 Share on other sites More sharing options...
3s2ng Posted November 26, 2006 Author Share Posted November 26, 2006 up Link to comment https://forums.phpfreaks.com/topic/28493-include-problem/#findComment-130672 Share on other sites More sharing options...
genericnumber1 Posted November 26, 2006 Share Posted November 26, 2006 There is a php.ini setting called "safe mode" that keeps you from including remote files into your scripts...it's a security vulnerability to disable it, but it's not really hard to avoid unless you play it dumb.Try seeing if safe mode is enabled, and if it is, disable it... I'd be nervous about including a remote file, but that's just mehttp://www.corephp.co.uk/archives/19-Prepare-for-PHP-6.htmlsafe mode (along with many other things like magic quotes) will be gone in php6Good luck! Link to comment https://forums.phpfreaks.com/topic/28493-include-problem/#findComment-130678 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.