Crypt Posted March 26, 2006 Share Posted March 26, 2006 I am trying to set up this MySpace Train Script but i get this error:[code]Warning: main(pages/.php): failed to open stream: No such file or directory in /home/content/j/o/i/joinmy/html/pages.php on line 11Warning: main(): Failed opening 'pages/.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/j/o/i/joinmy/html/pages.php on line 11[/code]Here is pages.php:[code]<?phpInclude "config.php";mysql_connect ($strDBServer, $strDBUser, $strDBPass) or die ('Unable to connect to MySQL: ' . mysql_error());mysql_select_db ($strDBName) or die ('Unable to select database: ' . mysql_error());include "includes/precalls.php";include "theme/header.php";include "pages/" . $page . ".php";include "theme/footer.php";?>[/code] Link to comment https://forums.phpfreaks.com/topic/5818-help-needed/ Share on other sites More sharing options...
azuka Posted March 26, 2006 Share Posted March 26, 2006 It's simple - for some reason $page was not set. Did you mean page.php? Because $page is empty it tries to include a file called ".php" which it can't find. Link to comment https://forums.phpfreaks.com/topic/5818-help-needed/#findComment-20748 Share on other sites More sharing options...
Crypt Posted March 26, 2006 Author Share Posted March 26, 2006 Ok well you can view the script here: [code]http://joinmytrain.com/pages.php?=home[/code]There are also several other pages in /pages/ folder on my FTP Link to comment https://forums.phpfreaks.com/topic/5818-help-needed/#findComment-20752 Share on other sites More sharing options...
azuka Posted March 26, 2006 Share Posted March 26, 2006 I think what you wanted to do is pages.php?page=home. Beware of REGISTER_GLOBALS - better call $_REQUEST['page']; Link to comment https://forums.phpfreaks.com/topic/5818-help-needed/#findComment-20756 Share on other sites More sharing options...
Crypt Posted March 26, 2006 Author Share Posted March 26, 2006 I tried $page = $_REQUEST['page']; and I think that did the trick. THANK YOU SO MUCH! [img src=\"http://www.phpfreaks.com/forums/style_images/1/folder_post_icons/icon4.gif\" border=\"0\" alt=\"IPB Image\" /] Link to comment https://forums.phpfreaks.com/topic/5818-help-needed/#findComment-20759 Share on other sites More sharing options...
azuka Posted March 26, 2006 Share Posted March 26, 2006 [!--quoteo(post=358437:date=Mar 25 2006, 08:54 PM:name=Krypt)--][div class=\'quotetop\']QUOTE(Krypt @ Mar 25 2006, 08:54 PM) [snapback]358437[/snapback][/div][div class=\'quotemain\'][!--quotec--] I tried $page = $_REQUEST['page']; and I think that did the trick. THANK YOU SO MUCH! [img src=\"http://www.phpfreaks.com/forums/style_images/1/folder_post_icons/icon4.gif\" border=\"0\" alt=\"IPB Image\" /] [/quote]I checked your site. Glad it's working! Link to comment https://forums.phpfreaks.com/topic/5818-help-needed/#findComment-20765 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.