PHP HTML forms and Post Method Code


 

PHP HTML forms and Post Method Code

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: 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.

Ads