Home Blog 2008 01 31 Php-html-forms-and-post-method-code PHP HTML forms and Post Method Code

 
 

PHP HTML forms and Post Method Code
Posted on: April 3, 2006 at 12:00 AM
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.

Related Tags for PHP HTML forms and Post Method Code:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.