KapTinKiRk
New Member
I'm trying to edit a script so that I can use the query string to decide which directory the script will read. But the thing is I want to do it with numbers.
script.cgi?sectionID=2&id=pagename
So then '2' will equal to a path name...
/path/to/whatever/
and the id query is the name of the file. I've gotten it to work when I only use the id string, which is pretty simple. But my big problem is, how do I go about telling the script where to go for each number?
1 = "/path/to/whatever"
2 = "/path/to/somewhere"
I did the following...
and it works, but when I need to add the ones for 2, 3, 4 etc. etc.
..it gives errors, anyone know how to do this properly? Any help is appreciated. If I didn't explain it enough, then tell me
script.cgi?sectionID=2&id=pagename
So then '2' will equal to a path name...
/path/to/whatever/
and the id query is the name of the file. I've gotten it to work when I only use the id string, which is pretty simple. But my big problem is, how do I go about telling the script where to go for each number?
1 = "/path/to/whatever"
2 = "/path/to/somewhere"
I did the following...
Code:
$sectionID = "$INPUT{'sectionID'}";
$section = "home/" if ($sectionID eq '1');
and it works, but when I need to add the ones for 2, 3, 4 etc. etc.
Code:
$sectionID = "$INPUT{'sectionID'}";
$section = "home/" if ($sectionID eq '1');
$section = "movies/" if ($sectionID eq '2');
$section = "movies/previews/" if ($sectionID eq '3');
..it gives errors, anyone know how to do this properly? Any help is appreciated. If I didn't explain it enough, then tell me