Share on Google+Share on Google+

PHP HTML forms and Post Method Code

Advertisement
PHP HTML forms and Post Method Code: retrieve the form data and display the input on same page.

PHP HTML forms and Post Method Code

PHP html function

With the given PHP HTML Code one can retrieve the form data and display the input on same page.

PHP HTML Code

<HTML><BODY>
<FORM METHOD=?POST? ACTION=?index.php?>
<H2>Please Enter your Details?</H2>
<BR>Name:
<BR><INPUT TYPE=?TEXT? NAME=?Nickname?><BR>
<BR>Age:
<BR><INPUT TYPE=?TEXT? NAME=?age?><BR>
<BR>Contact Number:
<BR><INPUT TYPE=?TEXT? NAME=?number?><BR>
<BR>Email Address:
<BR><INPUT TYPE=?TEXT? NAME=?emailid?><BR>
<BR>
<INPUT TYPE=?SUBMIT? name=?Go?>
</FORM>

<?php

$Nickname = $_POST[?Nickname?];
$Age = $_POST[?age?];
$Number = $_POST[?number?];
$Email = $_POST[?emailid?];

echo ?<BR>Nickname: $Nickname?;
echo ?<BR>Age: $Age?;
echo ?<BR>Contact Number: $Number?;
echo ?<BR>Email Address: $Email?;

?>
</BODY>
</HTML>

This small PHP HTML Code tells you, how to create html forms and display data using PHP Post Method in PHP.

Advertisements

Advertisement

Posted on: April 3, 2006 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.