The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
Here's the coding I've been trying to get to work:
if (file_exists("$type" + "$id" + "$format"))
{ include("$type" + "$id" + "$format"); $id++; }
else
{ include("nolink.html"); }
?>
the "nolink.html" bit works, which means that it hasn't assorted the URL how I want it. It should display a document as such:
news0001.html
You see "news" is the "type", "0001" is the "id" and ".html" is the "format". Clever, no! Except it doesn't work!
Also, I'm trying to increment the variable "$id", so that I can have other files below it. At the moment I'm using JavaScript style methods, which have worked for other tings, but not this. I'm also guessing that because the "$id" is an integer, that "%id" will have to be used, but I'll leave it up to you lot to tell me that.
Cheers!
Oh..
"foo" + "bar" will choke really horribly. "." to concatenate strings, "+" to concatenate floats (IE. to add up numbers). PHP is clever in spotting poeple's mistakes and correcting them, but I don't think it swaps +'s and .'s.
Cheers for your help!
> Probably completly wrong as well :o)
No you're wrong - it works! Cheers CJH, that worked a treat!
One more problem though - how do I increment the variable? My "$id++" methoddoesn't seem to be working. Any ideas?
if (file_exists("$type$id$format")) {
include("$type$id$format");
$id++;
} else {
include("nolink.html");
}
?>
if (file_exists("$type", "$id", "$format")) {
include("$type$id$format");
$id++;
} else {
include("nolink.html");
}
?>