473,406 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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.
[php]
<body>
<form action="process.php" method="post">
<p>&nbsp;</p>
<h1>
<pre><center><img src="pemudawilayah.GIF" width="115" height="102" align="right" /></center></pre>
<center>
<p>&nbsp;</p>
<p><b>PROGRAM KEBAJIKAN </b></p>
</center></h1>
<pre><center><p>&nbsp;</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>&nbsp;</p>
<h1>
<pre><center><img src="pemudawilayah.GIF" width="115" height="102" align="right" /></center></pre>
<center>
<p>&nbsp;</p>
<p><b>PROGRAM KEBAJIKAN </b></p>
</center></h1>

<pre><center><p>&nbsp;</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
Feb 6 '07 #1
1 1449
xwero
99
instead of outputting in process.php redirect the page
Feb 10 '07 #2

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

Similar topics

2
by: Matt | last post by:
Can we click a link and it will submit the form to the other page? Usually we will submit the form to other page by clicking a submit button. Now I need to do the following, but what if I have...
2
by: Deborah V. Gardner | last post by:
I am using Access 97 and have had a problem joining a main form and a subform. I have a main form and a subform. The data source on the main form is a SELECT statement referring to three tables....
2
by: James Robinson | last post by:
We have multiple databases created with forms in them. I want to create a master form that can link to any of the other database forms. If you have all of the tables and forms, ect., in one...
3
by: Mark C | last post by:
I have a unbound form with a tab control with four tabs in an Access 97 database. On each tab I have a sub form each form on the sub forms is bound to its own table. Each table has a field that can...
4
by: Mike Woinoski | last post by:
(I'm new to VS, so please forgive me if this is a faq.) I'm writing some Java web services and need to test them with C++ clients. I can use either a Windows Form application or an MFC application....
2
by: Nick Douglas | last post by:
We want our company logo to appear on the forms in our database. The logo is on our homepage. Is there a way to link it? (rather than embed it).
7
by: Lisa | last post by:
I have an Access 2000 application that uses the following function to re-link my tables when I switch from my Current back end to a Dummy back end. I also use it to refresh my links. Function...
2
by: mcraven.2 | last post by:
How do you send a browser to a link when a command is given? I've tried using Java Server Pages <jsp:forward /command but that doesn't change the link in the address bar and some other problems...
1
by: VanZandt | last post by:
I have a class(dll) that extends winform datagrid to provide link column in vb.net. I have managed to create a datagrid in c# winforms that shows link in one of the column but when I try to create a...
1
by: royal084 | last post by:
i need to make 4 different forms in 1 project in borland C++ Builder.forms r different but there is some similar tasks of them.so i made a common base form with similar tasks and all codes of similar...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.