Jump to content

Archived

This topic is now archived and is closed to further replies.

Crypt

Help Needed!

Recommended Posts

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 11

Warning: 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]
<?php
Include "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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
I think what you wanted to do is pages.php?page=home. Beware of REGISTER_GLOBALS - better call $_REQUEST['page'];

Share this post


Link to post
Share on other sites
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\" /]

Share this post


Link to post
Share on other sites
[!--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!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.