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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.