systech44 Posted September 8, 2006 Share Posted September 8, 2006 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.[code=php:0]<?php// Session1.phpif(isset($_POST["spreads"], $_POST["major"], $_POST["minor"])){ session_start(); $_SESSION["spreads"]=$_POST["spreads"]; $_SESSION["major"]=$_POST["major"]; $_SESSION["minor"]=$_POST["minor"];}?>[/code][code=php:0]<?php// Session2.phpsession_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();?>[/code] Quote Link to comment Share on other sites More sharing options...
redarrow Posted September 8, 2006 Share Posted September 8, 2006 [code]<?php session_start();// Session1.phpif( isset($_POST["spreads"])&& ($_POST["major"])&& ($_POST["minor"]) ) { $_SESSION["spreads"]=$_POST["spreads"]; $_SESSION["major"]=$_POST["major"]; $_SESSION["minor"]=$_POST["minor"];}?>[/code] Quote Link to comment Share on other sites More sharing options...
systech44 Posted September 8, 2006 Author Share Posted September 8, 2006 Sorry sir this code unable to store the values in Session variables. Is there anything better.Thank you in advance. Quote Link to comment 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.