FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


[PHP] Weird Errors and lost files.





PatTheGreat42
Recently, I decided to redo my site. As part of the new site, visitors will be able to pick a skin, which would be stored in a cookie for a year. Instead of setting a default, however, I thought it would be simpler if I checked right off the bat if they has already had the cookie, and if not, send them to the "choose a skin" page. To do this, I used the following, code for the index.php page:

Code:

<?php
if(isset($_COOKIE['skin']))
{include("index.inc");}
else
{include("skins.php");}
?>


So what it should do is check for the cookie, and if it's there, show the visitor the index page. If it's not there, it should show the visitor the page where one can choose their cookie. However, when I load up index.php (http://www.patthegreat.com/index.php, if you're interested), I get the following error:

Quote:

Warning: main(indexphp): failed to open stream: No such file or directory in /home/patthegr/public_html/skins.php on line 5

Warning: main(): Failed opening 'indexphp' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/patthegr/public_html/skins.php on line 5


Now I'm stumped. I've checked, and the file skins.php very cleary exists. I have no idea why it thinks it wouldn't. So the question is: what am I doing wrong here?
sonam
What function main(): exactly doing? Maybe your include path is not good seted!

Sonam
BlackSkad
Skins.php searches for a file called indexphp to include it (appearantly on line 5).
If it is meant to include index.php, you missed a point.
If not, you have a wrong include-statement in your code.

If it is still not clear to you, you might post you skins.php-code here. Would be more usefull to help then just an error...

BlackSkad
Stubru Freak
The error is in skins.php so you should post the code if you can't find it yourself.
Related topics
Build an online dictionary by PHP/MySQL
PHP without mySQL
Latest PHP install may cause phpBB to return errors...
[PHP doubt]Knowing the directory location of PHP file
Php Syntax Errors, Need Help
php and am lost...
PHPNuke installation problem
Freeway Express/Pro Lost Files
Displaying Files...
recover lost files.
Phpbb mod fix. Pays high!
Creating files not locally?
PHP creating scheduled tasks?
Btrfs File System
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.