FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

PHP issue

 


Aelita
Geez for some reason I'mjust having retarded issue this month...

My php script for navigation is justnot working at all...

This is the script I do believe.. (I'm not looking at it currently, I'm writing from my head, but you should get the idea even if i write it wrong)

Code:
if file_exists($id.php)
{
    include ('$id.php');
}
elseif file_exists($id.html)
{
    include('$id.html');
}
else
{
    include ('main.php')
}



No matter what, the script is going stright to the else part of the statement... This script was not changed and it was working before. It just stopeed working at some point.... An ideas as to why..?

by the way it works with links like these:

Code:
<a href="$id=news">News</a>
mathiaus
Global vars was recently turned off I think. Make sure if is set by $id = $_GET['id']
Aelita
bastards.... HAHA that just might do it... Thanks a ton!!!!!!!! Why do they make things so har for a girl....
Bondings
Also, I'm not sure but I think php doesn't accept "elseif". At least I always use "else if". Wink
mathiaus
http://uk2.php.net/elseif
elseif is actually the proper 'official' way of doing it though both work just the same Smile
Aelita
Well i know it was working before, and it that change was made that would be the problem. I'm going to check on it now to see if it works...
Aelita
It's fin now close topic plaes thanks for the help.. I have a lot of editing to do to my site now because I've been lazy and not doing things the "proper way". Oh wellz shortcuts never last forever...
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

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