Jump to content


Photo

passing value with session


  • Please log in to reply
1 reply to this topic

#1 luvburn

luvburn
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 20 September 2006 - 03:25 PM

I got this page simptom.php that when i click the submit button the page diagnos.php will appear. But i want the values from simptom.php can be viewed in another page called list.php. How do i do that by using session?

Here is the code for simptom.php and i created a session for this page.
<?php session_name ('diagnos');
          session_start();
?>

            <form name="form1" method="get" action="diagnos.php" >
             <table><tr>
	<td width="89" align="right" class="tbody2">Umur :</td>
	<td width="107" class="tbody"><input type="radio" name="age" value="1"> < 1 tahun</td>
	<td width="124" class="tbody"><input type="radio" name="age" value="2"> 	1 - 10 tahun</td>
	<td width="131" class="tbody"><input type="radio" name="age" value="3"> 11 - 19 tahun</td>
	<td width="110" class="tbody"><input type="radio" name="age" value="4"> > 19 tahun</td>
	</tr>
             <tr>
              <td class="tbody"><input type="radio" name="jantina" value="m"> Male</td>
	<td class="tbody"><input type="radio" name="jantina" value="f"> Female</td>		
             </tr>
             </table>
          
             <input type="submit" name="submit" value="Next">
</form>



#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 20 September 2006 - 03:26 PM

You need to run session_start() first, then just set the variables like: $_SESSION['key'] = "value";




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users