Nick
October 28th, 2000, 00:21
I want to make my site with tutorials templated with php4. I want to have it setup to do http://me.com/tutorials/index.php?id=1 would include the tutorial from "files/1.inc", http://me.com/tutorials/index.php?id=dammit would open "files/dammit.inc", etc. Can this be done? How? What would the code be?
[Edited by Nick on 10-28-2000 at 02:46 PM]
Gonzo
October 29th, 2000, 12:06
Just contact me on ICQ and I can help you do it. 41967209
Tobias
October 29th, 2000, 17:45
it's pretty simple:
if ($id==1)
{
include "files/1.inc";
}
else if ($id=="dammit")
{
include "files/dammit.inc";
}
- Tobias
Gonzo
October 29th, 2000, 19:57
No that way is the hard way. just do this:
if (isset($id)) {
include "files/$id.inc";
break;
} else {
echo "error or the main page";
}
Originally posted by Tobias
it's pretty simple:
if ($id==1)
{
include "files/1.inc";
}
else if ($id=="dammit")
{
include "files/dammit.inc";
}
- Tobias
Nick
October 29th, 2000, 20:15
Thanks man.
Originally posted by Gonzo
No that way is the hard way. just do this:
if (isset($id)) {
include "files/$id.inc";
break;
} else {
echo "error or the main page";
}
Originally posted by Tobias
it's pretty simple:
if ($id==1)
{
include "files/1.inc";
}
else if ($id=="dammit")
{
include "files/dammit.inc";
}
- Tobias