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?

Did you know?Explore Trending and Topic pages for more stories like this.
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 Like 24 Dislike
Previous forums Next forums
Other forums

Problem with coding MySQL query
I'm having heaps of trouble getting one of my PHP/MySQL queries to work for some reason (and the fun

LSB (PHP 5.3) problem with static value!
hello,

i'm having a problem. static::$text variable gets lost at some point. can someone plea

Best way to cross matching large datasets
Hi,

Im running a script where am I cross matching about 200 000 data sets with each other. Ea

ImageCreate()
When I create an image and add text to it I want my text to be replaced with a PNG image, because th

Paypal
Hi all,

I have an advanced basic knowledge of php

I want to try something new for a s

Any Good MMORPGs you've played?
I'm about to have ALOT of free time on my hands (finished highschool) and I need something to fill t

PHP, Arrays & A Lot Of Confusion
I've been doing basic PHP work on sites for a few years now, but I've never been tempted to learn ho

I apologise! It's a newbie to PHP feedback form problem!
Hi,

I am a total newbie to PHP. I am also a unemployed and need to get a job. So after 100% r

JSON SORT WITH PHP
I have two products that I want to sort by say "Id:17, value: xxx" using php
The page w

a dificult string search
Hi I don't know a way around this. I want the user to input a password, but to make it a bit complca

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash