Jump to content

Archived

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

luvburn

passing value with session

Recommended Posts

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.
[code]
<?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>
[/code]

Share this post


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

Share this post


Link to post
Share on other sites

×

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.