471,059 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,059 software developers and data experts.

How to link php forms

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
1 1379
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.

Similar topics

2 posts views Thread by Deborah V. Gardner | last post: by
4 posts views Thread by Mike Woinoski | last post: by
2 posts views Thread by mcraven.2 | last post: by
1 post views Thread by royal084 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.