Jump to content

control an application with session varibles???


Recommended Posts

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.