how to use two buttons with php
Posted on
16th Feb 2014 07:03 pm by
admin
hi i have one form. there are three fields which are to be filled by the user. and then there are two buttons. ob clicking first button i want to save user's provided data to the database display the same page again. and on clicking second button the provided data will be saved and will be taken to next page.
my problem is with these buttons how can i set up these buttons to do the the action?
my code is here
Code: [Select]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body>
<form name="form1" method="post" action="">
<label>Degree Name:
<input type="text" name="textfield" id="textfield">
</label>
<p>
<label>CGPA:
<input type="text" name="textfield2" id="textfield2">
</label>
</p>
<p>
<label>Institute:
<input type="text" name="textfield3" id="textfield3">
</label>
</p>
<p>
<label>
<input type="submit" name="button" id="button" value="Save And Add Another">
</label>
</p>
<p>
<label>
<input type="submit" name="button2" id="button2" value="Save And Proceed to Next Step">
</label>
</p>
</form>
<?php
$db = mysql_connect("localhost");
mysql_select_db("job", $db);
$addcv = mysql_query("insert into cv
(
degree,
cgpa,
institute
)
values
(
'".$degree."',
'".$cgpa."',
'".$institute."',
)");
echo "Your data is added.";
?>
</body>
</html>
No comments posted yet
Your Answer:
Login to answer
144
24
Other forums
Setting a default timezone?
I have read about how to change the timezone in PHPMYADMIN, but it changes back, it doesn't STAY the
Applet JTextField Size Problem
Hello,
I recently started making an applet to calculate certain values for airplanes. However
List/Menu Box
On an edit page when you want something to select what a user has previously selected from the datab
Where is my php.ini???
Hi
First off - apologies - i'm not a coder so this may sound very amateur.
I'm having
Collecting AOL Search Terms
I am attempting to collect AOL search terms. I know the code is correct (it works for google, bing,
disabling a button server-side then re-enabling client-side breaks button postback
I have a tabbed container and a button (not in the container) on a page. If the first tab is selecte
pointer 102 question
I read a book
1
2
3
4
5
6
7
8
9
10
11
12
int main()
{
Date/Time and Checkbox
Hi Everyone,
I am trying to figure out how to insert the current date and tim
Local file browser with php
Halo..
So this is what i want to create. I have a folder that i share and it has many movies.
! = ''
In the following 'IF' statement if v_ompcat = PU for example then Oracle equates that 'IF' statement