473,910 Members | 4,512 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to link php forms

7 New Member
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><i mg src="pemudawila yah.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>Ma klumat 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","fit ri","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($co n)
?>
</body>[/php]
Page 2 is as below:
[php]<form action="process 2.php" method="post">
<p>&nbsp;</p>
<h1>
<pre><center><i mg src="pemudawila yah.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>Ma klumat Pekerjaan</strong></p></center> </pre>
<p><br />
Majikan Terkini:
<input type="text" name="majikante rkini">
<br>
Alamat Majikan:
<input type="text" name = "alamatmajikan" >
Tempoh:
<input type="text" name="tempoh" >
<br />
Telefon Majikan:
<input type="text" name="telefonma jikan">
<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 1467
xwero
99 New Member
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
2093
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 many data in the form? Any workarounds? <a href="http://myserver/index.jsp?name=test&actionType=test" target="_blank">Add New Document</a> Please advise. thanks!!
2
21063
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. The subform's data source is a table. When I try to link the Child and Master fields, I get the message "Can't build a link between unbound forms." I have tried typing in the common fields and it still does not work.
2
3406
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 database, you can macro or wizard to them. How can I put a command button in for each form, with the master form linking to other databases forms?
3
8489
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 link them all together. I have put an invisible unbound control on the master form that gets populated on open. I set the link child and link master of each sub form to the unbound control on the master form. When the form opens all the subforms...
4
3923
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. I used VS.NET 2003 to create a C# client that successfully processes SOAP messages to and from the Java service. However, I'm having problems with the C++ client. I created a new solution and a new project with File > New > Visual C++ Projects...
2
1553
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
4101
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 CreateODBCLinkedTables() As Boolean On Error GoTo CreateODBCLinkedTables_Err Dim strTblName As String, strConn As String Dim db As DataBase, rs As Recordset, tbl As TableDef Dim DatabaseName As String Dim ServerName As String
2
1977
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 arise with it. A javascript method would work in what I'm doing but I don't know what that command would be. Basically, when a button is pressed I want some session data to be set and for a link to be followed. Any ideas?
1
1531
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 EventHandler I get a compilation error: "Method 'DataGridLink.Form1.cs_LinkClicked does not match delegate" can anyone please help? Thanks for all the help. here is my code: using System; using System.Drawing; using System.Collections;
1
3456
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 tasks r same.now from the base form develop 4 other form. example: suppose one base form "Base"->with 3 common button save new Close. now need to make another 4 forms including these 3 task.so save this "BASE" form in four Different names and...
0
10037
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9879
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11349
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10921
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11055
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
8099
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7250
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6142
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.