Originally posted by pkghost
I have one script that performs a number of functions. It is a database management script that lets me monkey with tables without writing out the queries and php to do it every single time i want to change some data. My problem comes when I pass variables to the script using the www.mysite.com/script.php?var=val&var2=val2 (sidenote, is this method the GET method?).
Yes, more or less.
Technically, the GET method is a command the browser sends to the webserver, which includes the URI string containing those variable names, values, and assignment operators, etc. These variables are then used by PHP in the $_GET superglobal array.
After I pass those variables, I use them once and then want them OUT of the URL otherwise they throw the script off track. Is there any way to clear all of those vars off the url? I've tried $PHP_SELF and also just hardcoding a link to the script with no added variables, but they seem to stick around if the link is to the script itself. help?
Probably you need to figure out why they are "sticking" around, or exactly what it is that is futzing up your script.
Also, I'm not sure I understand what you mean by "use them once and then want them out of the URL". The script is compiled on the fly by PHP and served to the browser. Any subsequent request to the server is a new entity, and should only go to the same URL as the previous request if the link or form button or whatever is written that way.
Just out of curiousity, is the problem that your variable scope is out of whack? Are register_globals ON?
Are you using the same variable names for data sources that come from GET, POST, ENV, COOKIE, SESSION, etc., as well as localized (script only) variables?