By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,825 Members | 1,449 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,825 IT Pros & Developers. It's quick & easy.

How to link php forms

P: 7
Im running Apache(1.3.23), MySQL(3.23.48) and PHP(4.1.1) locally on my PC to create a form. This form will consist of 2 pages where the first one is user detail and second is company detail.

My question is, how do I link these 2 pages together?

Page 1 is as below. My process.php is where I collect the data and submit it to mysql.
<form action="process.php" method="post">
<pre><center><img src="pemudawilayah.GIF" width="115" height="102" align="right" /></center></pre>
<p><b>PROGRAM KEBAJIKAN </b></p>
<pre><center><p>&nbsp;</p><p><strong>Maklumat Peserta</strong></p></center> </pre>
<p><br />
<input type="text" name="nama">
Process.php is as below:
$con = mysql_connect("localhost","fitri","password");
if (!$con)
die('Could not connect: ' . mysql_error());
mysql_select_db("umnodb", $con);

$sql="INSERT INTO maklumatpeserta (Nama, TarikhLahir, NoKeahlian, Phone, AlamatTerkini, Cawangan, Bahagian, Jawatan)
if (!mysql_query($sql,$con))
die('Error: ' . mysql_error());
echo "1 record succefully added";
Page 2 is as below:
[php]<form action="process2.php" method="post">
<pre><center><img src="pemudawilayah.GIF" width="115" height="102" align="right" /></center></pre>
<p><b>PROGRAM KEBAJIKAN </b></p>

<pre><center><p>&nbsp;</p><p><strong>Maklumat Pekerjaan</strong></p></center> </pre>
<p><br />
Majikan Terkini:
<input type="text" name="majikanterkini">
Alamat Majikan:
<input type="text" name = "alamatmajikan">
<input type="text" name="tempoh" >
<br />
Telefon Majikan:
<input type="text" name="telefonmajikan">
Alamat Terkini:
<input type="text" name = "alamat">
<input type="text" name="email">
etc[/php]Im very new to this programming stuff. Can someone pls help me?


Read the Posting Guidelines before you post in this forum!. Especially the part about enclosing code within php or code tags!

Feb 6 '07 #1
Share this Question
Share on Google+
1 Reply

P: 99
instead of outputting in process.php redirect the page
Feb 10 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.