HomeFriday, May 6, 2016, 16:46:28
1

PHP Form Action Self Submit

Tuesday, February 10, 15, 14:10:17, 1 Year Ago Via wain, Hits: 1392
PHP form action self submit tutorial, requirement(s): PHP server
index.php
Code:
<?php
if(isset($_POST['submit']))
{
$filed1 = $_POST['field1'];
echo $filed1 . " ";
echo $filed2;
}else{
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="text" name="field1">
<input type="hidden" name="filed2" value="hidden value">
<input type="submit" name="submit" value="Submit Form">
</form>
<?php } ?>

jonix Thursday, June 27, 2013, 08:16:05

replace:

$filed1 = $_POST[\'field1\'];

with:

$filed1 = $_POST[\'field1\'];
$filed2 = $_POST[\'field2\'];

Sign In

Web Hosting
First Month Free with Coupon Code phpmonth
Unlimited Domains - Unlimited Storage
Unlimited Transfer - Unlimited Email
About Author

wain

Date Registered: Sun, Feb 8, 15
Last Time Online: Wed, Mar 30, 16
So far has created 115 entries.
wain
This author has not yet filled in any details.