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] Link to comment https://forums.phpfreaks.com/topic/20103-session-with-select-check-option/ 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] Link to comment https://forums.phpfreaks.com/topic/20103-session-with-select-check-option/#findComment-88273 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. Link to comment https://forums.phpfreaks.com/topic/20103-session-with-select-check-option/#findComment-88298 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.