HomeThursday, March 26, 2015, 20:52:51
1

PHP Form Action Self Submit

Tuesday, February 10, 15, 13:10:17, 2 Months Ago Via wain, Hits: 1
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 } ?>

Comments

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

replace:

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

with:

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

Sign In

Sponsor
About Author

wain

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