473,231 Members | 1,715 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,231 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 1445
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: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

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.