[PHP] Re: $HTTP_SESSION_VARS still holds original values even after unset?
Umm.. Use $_SESSION for that, and session_unregister() for the unsetting with the old style code.. -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com Andy B [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] how would you empty all the contents of $HTTP_SESSION_VARS when you dont need them anymore but still keep the current session running? the problem seems to be that when i try to fill them with something else (dont need the original values anymore) but need new ones without destroying the session itself they wont fill with new things. unset($HTTP_SESSION_VARS); does nothing to help at all because they still have the same values that they were originally filled with (and not to mention they are still in the session)... anybody have any ideas how to delete or empty out the array but keep the session active ?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: $HTTP_SESSION_VARS still holds original values even after unset?
Umm.. Use $_SESSION for that.. wish i could but it wont work for the server that its going to run onthey still use php4.0.4pl1 believe it or not -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: $HTTP_SESSION_VARS still holds original values even after unset?
Use the session_* functions then.. -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com Andy B [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Umm.. Use $_SESSION for that.. wish i could but it wont work for the server that its going to run onthey still use php4.0.4pl1 believe it or not -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: $HTTP_SESSION_VARS still holds original values even after unset?
Use the session_* functions then.. still does nothing at all or it does the same as session_destroy. and that forces a user back to the login screen right in the middle of an sql insert/update -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: $HTTP_SESSION_VARS still holds original values even after unset?
Andy B wrote: Use the session_* functions then.. still does nothing at all or it does the same as session_destroy. and that forces a user back to the login screen right in the middle of an sql insert/update Okay, start showing some code so we can see wtf is going on. Constantly posting back nope, doesn't work is just going to have us grasping at straws again and again. Is register globals on or off? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: $HTTP_SESSION_VARS still holds original values even after unset?
Okay, start showing some code so we can see wtf is going on. Constantly posting back nope, doesn't work is just going to have us grasping at straws again and again. Is register globals on or off? register_globals=off here is the code that gives me problems: files are attached (if allowed) let me know if the attached files didnt make it through and i will post it in the body of the message...the code is quite huge chunck of stuff... file guestbook_add.php: is a form used for admins to insert a guestbook entry. it is linked from a admin page using session_start(); at the top of the admin main page. the button that links to this page code is: input class=button type=button value=add guestbook listing accesskey=3 onclick=window.location='guestbook_add.php'; onkeypress=window.location='guestbook_add.php'; after filling out the form and submitting it to the file called guestbook_review2.php it sets all of the $HTTP_SESSION_VARS[] vars to the inital form submitted values and shows them on the page. after they hit the continue button it checks for default/required vars and then inserts to the db in the file called guestbook_save.php.. after a successful insert it takes them back to the main admin page. the next time i hit the add guestbook listing from the main screen, fill out the form with different values and submit it all the $HTTP_SESSION_VARS have the same values as the last add sequence... its interesting...(i know the code may be sloppy but...im starting out with complex stuff and was forced on a super fast turn around on it)... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: $HTTP_SESSION_VARS still holds original values even after unset?
On 4 Apr 2004 Andy B wrote: the next time i hit the add guestbook listing from the main screen, fill out the form with different values and submit it all the $HTTP_SESSION_VARS have the same values as the last add sequence... There are two problems there. First, your session data is not getting cleared. Second, it is not getting reset with the new values. For the former, in guestbook_save.php you can simply do a session_unset (if you really want to clear all of them). However this does not handle an abnormals equence -- for example someone hits Back in the middle of the process. I don't understand why they are not getting set properly the second time around. It could be a condition in your code. I'd have to see the code to have an idea. Try stripping the code WAY down so you have a test_add.php with a 1- field form, and a test_review.php that displays that data and saves it in a session variable, and test_save.php that just displays what it receives in the session variables. If that still fails, post the code. If not, your problem lies in the difference between that and the original code. -- Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: $HTTP_SESSION_VARS still holds original values even after unset?
There are two problems there. First, your session data is not getting cleared. Second, it is not getting reset with the new values. For the former, in guestbook_save.php you can simply do a session_unset (if you really want to clear all of them). However this does not handle an abnormals equence -- for example someone hits Back in the middle of the process. I don't understand why they are not getting set properly the second time around. It could be a condition in your code. I'd have to see the code to have an idea. Try stripping the code WAY down so you have a test_add.php with a 1- field form, and a test_review.php that displays that data and saves it in a session variable, and test_save.php that just displays what it receives in the session variables. If that still fails, post the code. If not, your problem lies in the difference between that and the original code. ok heres the code in the message body: hope it fits note: im in the middle of porting it from new code to old code so some $_SESSION vars might show themselves time to time... [guestbook_add.php: form to fill out:linked from admin.php(not shown)] ? session_start(); if(!empty($_SESSION['username'])){ ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/transitional.dtd; html head titleAdd GuestBook Entry/title LINK rel=stylesheet href=style/rnjresort.php type=text/css /head body h1Add guestbook entry/h1 div table tr td NOTE: when filling out this form, make sure you fill the date out in the format mmddhhmmss. example: 2004040100 would be april 1 2004 12 midnight. To insert the current date leave the date blank. /td /tr /table /div div form method=post action=guestbook_review2.php table summary=Below is the entire form for adding your entry to the guestbook tr td label for=id-dateDate: /labelinput type=text name=date accesskey=a label for=id-nameName:/label input type=text name=name accesskey=n id=id-name /td td label for=id-emailYour Email address:/label input type=text name=email accesskey=e id=id-email /td /tr tr td label for=id-website Your URL:/label input type=text name=website accesskey=w id=id-website /td td label for=id-referred How did you hear about us?/label input type=text name=referred accesskey=d id=id-referred /td /tr tr td label for=id-comments Comments:/label textarea name=comments rows=5 cols=40 accesskey=c id=id-comments/textarea center input class=button type=submit value=submit accesskey=s input class=button type=reset value=start over accesskey=o /center /td /tr /table /form /div img src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01! height=31 width=88 /body /html ?} else { header(location: login.html);}? [end of guestbook_add.php] then the form gets submitted to the next one: [guestbook_review2: give users the choice to back out before its too late and type in again] ?php session_start(); $_SESSION['date']=$date; $HTTP_SESSION_VARS['name']=$name; $HTTP_SESSION_VARS['email']=$email; $HTTP_SESSION_VARS['website']=$website; $HTTP_SESSION_VARS['referred']=$referred; $HTTP_SESSION_VARS['comments']=$comments; if(!empty($_SESSION['username'])){ ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/transitional.dtd; html head titleConfirm your post/title LINK rel=stylesheet href=style/rnjresort.php type=text/css /head body h1Confirm your post/h1 div table summary=Instructions for Confirming your post tr td pReview your information below. If you need to return to the form to change anything just click the start over button. If you are satisfied with your listing click the continue button./p /td /tr /table /div div table summary=Your posting information is below tr td Name: ?php echo $HTTP_SESSION_VARS[name];? /td /tr ?php if(!empty($HTTP_SESSION_VARS['email'])){? tr td ?php echo a href=\mailto:$HTTP_SESSION_VARS[email]\;My Email address/a ($HTTP_SESSION_VARS[email]);? /td /tr ?php }else{echo ;} if(!empty($HTTP_SESSION_VARS['website'])) {? tr td ?php echo a href=\http://$HTTP_SESSION_VARS[website]\;My web site/a ($HTTP_SESSION_VARS[website]);? /td /tr ?php } else {echo ;} if(!empty($HTTP_SESSION_VARS['referred'])){? tr td Where did you hear about us?br ?php echo $HTTP_SESSION_VARS[referred];? /td /tr ?php } else { echo ;}? tr td Comments:br ?php echo $HTTP_SESSION_VARS[comments];? /td /tr /table /div div table tr td input class=button type=button value=continue accesskey=c onclick=window.location='guestbook_save.php'; onkeypress=window.location='guestbook_save.php'; /td td input class=button type=button value=start over accesskey=s onclick=window.location='admin.php'; onkeypress=window.location='admin.php'; /td /tr /table /div img src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01! height=31 width=88 /body /html ?}else{ header(location: login.html);}? [end of guestbook_review2.php] if they hit the continue button it takes them to guestbook_save.php, saves to db and returns to admin.php... [guestbook_save.php: saves and returns
Re: [PHP] Re: $HTTP_SESSION_VARS still holds original values even after unset?
* Thus wrote Andy B ([EMAIL PROTECTED]): ?php session_start(); $_SESSION['date']=$date; $HTTP_SESSION_VARS['name']=$name; $HTTP_SESSION_VARS['email']=$email; $HTTP_SESSION_VARS['website']=$website; $HTTP_SESSION_VARS['referred']=$referred; $HTTP_SESSION_VARS['comments']=$comments; You should probably read http:/php.net/session more carefully. snip oodles of unread code Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php