At 2003-06-16 23:39 -0400, Logan McKinley wrote: >I am new to PHP but have been using ASP for years. What i am trying to do >is: >1) take a querystring variable >2) set it as a session variable >3) redirect the page back on itself > all of this is done so the user never sees the querystring var so it >must change it address bar >4) access the session variable as a hidden form element > >The code that follows is code i tried to write but it doesn't seem to work ><-----------------------> ><? >$qs = ""; >session_start(); >if($_SERVER['QUERY_STRING']!="" && $_Session("qs") != "")
Shouldn't '$_Session()' be '$_SESSION[]'? By the way, I think it's better to surround strings that don't have to be expanded with '' instead of "". Comparing for inequality with an empty string may also be superfluous. Greetings, Jaap >{ >$_SESSION["qs"] = $_SERVER['QUERY_STRING']; >session_register("qs"); >header("Location: http://localhost/PHP/registration_form.php"); >} >?> ><? echo $_SESSION["qs"]; ?> ><------------------------------> > >among other problems if there is no querystring value at all it gives me an >error in the if statement > >Any help would be appriciated >Thanks in advance >~Logan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php