开发者

PHP & MySQL preview button question

How would you go about cre开发者_高级运维ating a preview button for a form using PHP & MySQL.


<script language="JavaScript">
<!--
function formpreview(form) {
form.target='_blank';
form.action='preview.php';
form.submit();
}
//-->
</script> 
<input type="button" value="preview" onclick='formpreview(this.form)'>

then use $_POST array values in the preview.php to populate the template


When a form is submitted to a PHP script, the information from that form is automatically made available to the script. There are many ways to access this information. The norm is to insert it directly into a database.

If I am understanding you correctly, then you should be able to get user input data directly via a GET or POST method.

Have a read through the PHP Documentation for Variables from External Sources


get user input data directly via a GET or POST method.

and then create 2 "if" loop like wise

if($_POST['preview'])// after completing the fields preview is clicked. 
{
//display the preview.... and provide a submit button in this preview

}

NOTE: the submit should also b available in form where INPUT is given , i.e , there should be three buttons, Submit, Preview and Reset..

 if($_POST['submit'])
{
//Finally,submit the values into the database..
//if needed redirect to the page of final display of form values...
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜