Jump to content

How to put 2 links in submit button


luvburn

Recommended Posts

Hi...i have this problem of linking 2 pages from one button. Let say i have 3 pages. I want to send the values from page 1 to page 2 and 3.

This the code for page 1 which i set the action to go to page2
[code]
<?php
<form name="form1" method="get" action="page2.php">
<table width="585" align="center">
<tr>
<td>Umur :</td>
<td ><input type="radio" name="umur" value="1"> < 1 tahun</td>
<td ><input type="radio" name="umur" value="2" >1 - 10 tahun</td>
<td><input type="radio" name="umur" value="3" > 11 - 19 tahun</td>
<td ><input type="radio" name="umur" value="4" >  19 tahun</td>
</tr>
</table>
<input type="submit" name="submit" value="Teruskan" >

</form>

?>
[/code]

I can simply get the values at page2 by using $_GET. How do i do the same action to page 3 by clicking the submit button and retrieving the same values so that whenever i go to page3 the values from page1 is already there.
Where should i put the link?

Link to comment
Share on other sites

The session is not working. Somehow i want to use the values in page2. So i use $_GET to get the values from page 1 using the URL links. After that i want to send the values to page3.
Page 2 has a lot of server side functions. The values only appear for the first time we view the page but
lost each time some of those functions operated. So how do i hold the values from page1 no matter functions operated in page2.

this the code in page 2

[code]
<?php

include ('mysql_connect.php');
include ('papar_fungsi.php');

session_start();
session_name ('diagnos');


  $_SESSION['age'] =  $_GET["umur"];
  $_SESSION['sex'] = $_GET["jantina"];
  $_SESSION['race'] = $_GET["kaum"];
?>
<form name="form1" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<?php
:
  $_SESSION['age'] ....
(a lot of php function here)
?>
</form>

<?php  
echo "<a href=\"senarai_simptom.php?a=$age\">Simptom</a> " ;
?>
[/code]


I want the values to be send after clicking the 'Simptom' link but as i said before, the values lost before i can send to page3.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.