PHP Form
Free PHP forms, scripts, resources and tutorials.

Action Self Submit

Published: 12/12/10

Example Code

- Requirement(s): PHP Server

Code index.php
<?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                2013-06-27 04:16:05
   
    replace:

    $filed1 = $_POST['field1'];

    with:

    $filed1 = $_POST['field1'];
    $filed2 = $_POST['field2'];
         dani                2013-05-16 14:24:48
   
    hi when i run this code an error showing :No input file specified.  
    how can i solve this


    www.letsdl.com

Add a Comment

Name:


Comment:




Sitemap