jaiffed Posted February 12, 2010 Share Posted February 12, 2010 hello: I am newbie in PHP and currently i am working on a project, and i haven't know anything about how to print and preview of form... plz help me send me some script which is preview and then print the form in php.... I want that when user submit the form then the preview page open with print button and .... after that user click on print button then form print through the printer... Link to comment https://forums.phpfreaks.com/topic/191878-printing-and-preview-of-form/ Share on other sites More sharing options...
sader Posted February 12, 2010 Share Posted February 12, 2010 One way U can achive it is by creating form with two submit buttons and then look which submit button was clciked index.php <form method='post' action='submit.php'> //some field here <input type='submit' name='submit' value='preview'> <input type='submit' name='submit' value='post'> </form> submit.php <?php if($_POST['submit'] == "preview") { //echo everything as it will look in pages } else if($_POST['submit'] == "post") { //save data to database } ?> Link to comment https://forums.phpfreaks.com/topic/191878-printing-and-preview-of-form/#findComment-1011409 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.