Page 1 of 1

submit Button coding

Posted: Wed Sep 26, 2012 3:44 am
by parul853
Hi all,
Can anyone tell me the coding of the submit button submitting the two field name and phone no.

Re: submit Button coding

Posted: Thu Sep 27, 2012 1:17 pm
by pHp_n0ob
What you want, say clearly...according to your question,i think

Code: Select all

<form method="post" name="data" action="target.php"><input type="text" name="name" value="Name"/><input type="number" name="phone" value="Phone Number"/><input type="submit" value="Submit"/></form>
On the page target.php

Code: Select all

<?php if(isset($_POST['name']))
$name=$_POST['name'];
if(isset($_POST['phone']))
$number=$_POST['phone'];
echo $name.' '.$number;?>

Re: submit Button coding

Posted: Thu May 16, 2013 7:21 am
by johngill2810
Hello,
Your code is here
<form method="post" name="form" action="#.php">
Name:<input type="text" name="nm" value="nm"/>
Phone No:<input type="text" name="pn" value="pn"/>
<input type="submit" value="SUBMIT"/>
</form>

Re: submit Button coding

Posted: Fri Aug 23, 2013 2:28 am
by akhilesh1010
pHp_n0ob wrote:What you want, say clearly...according to your question,i think

Code: Select all

<form method="post" name="data" action="target.php"><input type="text" name="name" value="Name"/><input type="number" name="phone" value="Phone Number"/><input type="submit" value="Submit"/></form>
On the page target.php

Code: Select all

<?php if(isset($_POST['name']))
$name=$_POST['name'];
if(isset($_POST['phone']))
$number=$_POST['phone'];
echo $name.' '.$number;?>
Nice example works fine if i want to store this information in database which is the best mysql or mysqli?

Re: submit Button coding

Posted: Fri Aug 23, 2013 3:16 am
by requinix
akhilesh1010 wrote:Nice example works fine if i want to store this information in database which is the best mysql or mysqli?
The mysql extension is dead. Use mysqli (or PDO).