![]() |
releasing a veriable?
hey guys i am playing around with php trying to get a head start as i will be having a class on it in three weeks and i was wondering how to release a veriable? meaning i have a form you input what will eventuly become a pass word right now it is dog, and when you input dog, for the time beeing it says thank you for loging in, any other time it says sorry your not in the database, the problem i am having is once you hit submit and dog is the veriable $pass it will continue to stay as $pass when you refresh it. wich is a good thing in the long run, but i need to be able to release the veriable, or log out if you will.
heres my code: :
<font class="phpexample">thanks in advanced |
You would normally want to have the login form submit to a new page. You don't really need to release anything, just set a session variable that the user is logged in and send them to whatever page necessary.
|
okay. thanks
|
To answer your question, you can use the unset function. Whether the data will be automatically resubmitted when the page is refreshed is browser-depended; in my browser (Safari on Mac OS X) it is not.
Your form should have an action attribute; you can set it to the name of the current page to replicate the current behavior: :
<form method="post" action="filename.php" name="nameform">Also note that the <font> tag is deprecated (use <div> or <span> instead). Additionally, you should close all tags, even those that do not require separate closing tags; for example: :
<input type="submit" value="submit" /> |
| All times are GMT -5. The time now is 12:45 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC