why not Posted July 23, 2008 Share Posted July 23, 2008 i have two problem with url in my code . Example : Code: <?PHP if (empty($_GET )) $_GET = home; include "$svr_rootself/$_GET .php"; ?> with this method my url is www.example.com/?page=example&ex=2&exe=3 . ( example=example.php in server root and worked 100% ) now when change manually url to ?page=example.php i have two error . Warning: include(htdocs/site/example.php.php) [function.include]: failed to open stream: No such file or directory in htdocs\site\index.php on line 49 Warning: include() [function.include]: Failed opening 'htdocs/site/detail.php.php' for inclusion (include_path='.;\php\pear\') in site\index.php on line 49 how to fix this error ? regards Link to comment https://forums.phpfreaks.com/topic/116167-include-url-problem-help/ Share on other sites More sharing options...
unkwntech Posted July 23, 2008 Share Posted July 23, 2008 'htdocs/site/detail.php.php' <-- there are 2 .php if your going to include the .php here ?page=example.php then change include "$svr_rootself/$_GET .php"; to include "$svr_rootself/$_GET "; Link to comment https://forums.phpfreaks.com/topic/116167-include-url-problem-help/#findComment-597425 Share on other sites More sharing options...
JasonLewis Posted July 23, 2008 Share Posted July 23, 2008 Never do this: $_GET It could get messy. Instead, wrap the page in quotes. $_GET['page'] Link to comment https://forums.phpfreaks.com/topic/116167-include-url-problem-help/#findComment-597456 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.