How would i make PHP use something like file.php?variable to goto different spots in my script?..IE, i have an administration script im working on, and i want addusers, delete users, and a few other functions all in the same script so that i dont need 15 different script files, how would i do that?
You can do it several ways. One way is to use an action variable and switch/case construct.
where the argument (in this case "do_this") would tell the script what to do.
print "Hey, you didn't pass a valid argument!";
kewl kewl, thanks alot, but umm, i know in perl there's like, querystrings, now..i know PHP has these, but i have yet to see anything dealing with them, is this more effeciant say for slow typers(coders) than the querystrings?..
im new, and like what PHP has to offer, so dont mame me too bad please
//do some code
//do some other code
Thus the script will only run code for the variable that is set. Remember that the braces can encompass whatever you want to do, even if you escape out to html and then back into <?php script. The exit; statement prevents PHP from doing more than one code block at a time, but is not necessary, especially if you want to set two variables to run two code blocks.
[This message has been edited by rycamor (edited May 16, 2000).]