YoungNate_Black_coder Posted July 4, 2011 Share Posted July 4, 2011 okay, i am making a classifed ad site and im at my post an ad part of the site and what i wanna do is store the data selected into session varibles in the event they need to be called again and again they will be set this is where my problem is please help... <? session_start(); // when this gets rendered i dnt get redirected and those session varbles do not get set.... if(isset($_REQUEST['country'])&&($_REQUEST['state'])&&($_REQUEST['city'])&&($_REQUEST['cat'])){ $_SESSION['post_key'] = rand(100000,999999); $_SESSION['country'] = $_REQUEST['country']; $_SESSION['state'] = $_REQUEST['state']; $_SESSION['city'] = $_REQUEST['city']; $_SESSION['cat'] = $_REQUEST['cat']; header('location : compose.php?'.$_SESSION['post_key'].''); } ?> .... i have a html form below thats sending data in the get format but all the data is dynamic from a php script and ajax <form action="?" method="get"> <div id="panel1"> <h2>Location</h2> <fieldset> <table align="center"> <tr><td><label> Country</label></td> <td><select id="selection" name="country"> <option disabled>Select Country.....</option> <option value="1">USA</option> </select> </td></tr> <tr><td><label> State</label></td> <td><select id="state" name="state"> </select></td></tr> <tr><td> <label> City</label></td> <td><select id="city" name="city"> </select></td></tr> <tr><td> <label>Category</label></td> <td><select id="cat" name="cat"> </select></td><td></td></tr> </table> </fieldset> </div> <div id="compose"> <button type="submit" class="expand">Continue<img src="../images/arrow-down.gif"></button> </div> </form> Quote Link to comment https://forums.phpfreaks.com/topic/241056-control-an-application-with-session-varibles/ Share on other sites More sharing options...
trq Posted July 4, 2011 Share Posted July 4, 2011 So, what is the problem exactly? Quote Link to comment https://forums.phpfreaks.com/topic/241056-control-an-application-with-session-varibles/#findComment-1238193 Share on other sites More sharing options...
YoungNate_Black_coder Posted July 4, 2011 Author Share Posted July 4, 2011 the session varibles are noy being stored.... Quote Link to comment https://forums.phpfreaks.com/topic/241056-control-an-application-with-session-varibles/#findComment-1238194 Share on other sites More sharing options...
trq Posted July 4, 2011 Share Posted July 4, 2011 Can we see compose.php ? Quote Link to comment https://forums.phpfreaks.com/topic/241056-control-an-application-with-session-varibles/#findComment-1238196 Share on other sites More sharing options...
YoungNate_Black_coder Posted July 4, 2011 Author Share Posted July 4, 2011 i havent wrote it up yet its just an if statement as followed: if(!isset($_SESSION['country'])){ header('location :post.php?'); }else{ ........ Quote Link to comment https://forums.phpfreaks.com/topic/241056-control-an-application-with-session-varibles/#findComment-1238202 Share on other sites More sharing options...
trq Posted July 4, 2011 Share Posted July 4, 2011 Do you have a call to session_start() in compose.php? Quote Link to comment https://forums.phpfreaks.com/topic/241056-control-an-application-with-session-varibles/#findComment-1238355 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.