can't get rid of old variables...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jojo46
Forum Newbie
Posts: 7
Joined: Fri Feb 27, 2004 7:01 pm

can't get rid of old variables...

Post by jojo46 »

i'm sure this is a dumb question, but i can't seem to figure it out and up until now i've always had a workaround, but i really can't think of a good on this time. the gyst of what i need done is simply to input some info into a form i made. it goes through three stages, first it gets the filename, then the form variables (blank if no filename is entered, the values from the file otherwise), then processing. the problem i seem to be having is that it doesn't clear the variables for the form. when i hit submit and leave the filename text box clear, it still puts the values i inserted into the form from the last time i visited the page. i'm not sure if this is because it's retaining the filename parameter or because it is retaining all the form variables, but either way i need those variables cleared. all and all there are about 150 variables, so i'm hoping for a blanket clear solution or anything else. i would really really appreciate any suggestions around this or a solution to this problem.
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

try setting all the variables to "" at the start of the page...
$var = "";

But still i didn't think variables would keep their vaule after you close the page... wierd!!
User avatar
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

Post by redhair »

Maybe unset will help.
jojo46
Forum Newbie
Posts: 7
Joined: Fri Feb 27, 2004 7:01 pm

worked

Post by jojo46 »

unset worked, so yay, thanks a bunch, really appreciate it
Post Reply