Jump to content


Photo

Session with Select & Check Option


  • Please log in to reply
2 replies to this topic

#1 systech44

systech44
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 08 September 2006 - 10:03 AM

I want to know how to retrieve values from Se;ect option and Check Box option and stored them in Session variables. I am trying with the folllowing snippet of code. But this is not working. please help.

Thank you in advance.


<?php

// Session1.php

if(isset($_POST["spreads"], $_POST["major"], $_POST["minor"]))
{
      session_start();
      $_SESSION["spreads"]=$_POST["spreads"];
      $_SESSION["major"]=$_POST["major"];
      $_SESSION["minor"]=$_POST["minor"];
}

?>



<?php

// Session2.php

session_start();
$spreads="";
$major="";
$minor="";

if(!empty($_SESSION["spreads"]))
{
      $spreads=$_SESSION["spreads"];
      $major=$_SESSION["major"];
      $minor=$_SESSION["minor"];
}

echo "Spreads: ".$spreads."<br>";
echo "Major: ".$major."<br>";
echo "Minor: ".$minor."<br>";

session_destroy();

?>


#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 08 September 2006 - 10:07 AM

<?php session_start();

// Session1.php

if( isset($_POST["spreads"])&& ($_POST["major"])&& ($_POST["minor"]) ) 
{
      $_SESSION["spreads"]=$_POST["spreads"];
      $_SESSION["major"]=$_POST["major"];
      $_SESSION["minor"]=$_POST["minor"];
}

?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 systech44

systech44
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 08 September 2006 - 11:19 AM

Sorry sir this code unable to store the values in Session variables. Is there anything better.

Thank you in advance.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users