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.
[php]
<body>
<form action="process.php" method="post">
<p> </p>
<h1>
<pre><center><img src="pemudawilayah.GIF" width="115" height="102" align="right" /></center></pre>
<center>
<p> </p>
<p><b>PROGRAM KEBAJIKAN </b></p>
</center></h1>
<pre><center><p> </p><p><strong>Maklumat Peserta</strong></p></center> </pre>
<p><br />
Nama:
<input type="text" name="nama">
<br>
etc[/php]
Process.php is as below:
[php]<body>
<?php
$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)
VALUES
('$_POST[nama]','$_POST[tarikhlahir]','$_POST[nokeahlian]','$_POST[phone]','$_POST[alamatterkini]','$_POST[cawangan]','$_POST[bahagian]','$_POST[jawatan]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record succefully added";
mysql_close($con)
?>
</body>[/php]
Page 2 is as below:
[php]<form action="process2.php" method="post">
<p> </p>
<h1>
<pre><center><img src="pemudawilayah.GIF" width="115" height="102" align="right" /></center></pre>
<center>
<p> </p>
<p><b>PROGRAM KEBAJIKAN </b></p>
</center></h1>
<pre><center><p> </p><p><strong>Maklumat Pekerjaan</strong></p></center> </pre>
<p><br />
Majikan Terkini:
<input type="text" name="majikanterkini">
<br>
Alamat Majikan:
<input type="text" name = "alamatmajikan">
Tempoh:
<input type="text" name="tempoh" >
<br />
Telefon Majikan:
<input type="text" name="telefonmajikan">
<br>
Alamat Terkini:
<input type="text" name = "alamat">
<br>
Email:
<input type="text" name="email">
etc[/php]Im very new to this programming stuff. Can someone pls help me?
Thx.
Read the Posting Guidelines before you post in this forum!. Especially the part about enclosing code within php or code tags!
moderator