Jump to content

[SOLVED] Preview button


samona

Recommended Posts

<?php
if (isset($_POST[preview]))    // if preview button is clicked will do this.
     { 
      echo "you entered : $_POST[username]  <br /> Are you sure ? ";

     echo "<form action="file_itself" action="post">
<input type="hidden" name="entered_username" value="$_POST[username]" />  // store the username value in a hidden input
     <input type="submit" name="submit" value="submit" /></form>";
    }

else if (isset($_POST[submit])) // if submit button , which is in the preview page is clicked will do this. 
   { 
      // record to the database
    } 

else    // if no button is clicked, so they need to see the main form
    { 
      echo '
      <form action="file_itself" method="post" >

      name :  <input type="text" name="username" />

     <input type="submit" name="preview" value="preview" />


      </form>';
}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.