NYCPHP Meetup

NYPHP.org

[nycphp-talk] HTML form preview then INSERT using PHP & MySQL

Anirudhsinh Zala zala007 at hotmail.com
Sun Jul 7 02:28:05 EDT 2002


Hi steve..

Just found your problem..

let's just quickely sort out solution..u have 3 options..

1=> you can use hidden vars which will contain..those form field data which 
user fills in ..and action of your form would be that preview page..so that 
u can get..all those vars in preview form..

u can print those vars in text forms in preview page..and again..if user 
wants to edit those data then action of that preview page could be that 
filling in form so again u will pass those hidden data in editing mode...

Now if in preview form user wants to submit..form then u can chnage action 
of from by javascipt...when user clicks submit button...i.e. that page which 
will insert data into tables..

This is hiden var method..but not useful when there r lots of field..

2=>
Instead..u can use..temporarly table in mysql which can hold those 
data...and when final submission is made by user then it will be deleted 
from database..

3=>
also u can create a temp file..which can store all form filed vars in in 
text fromat .and can be used..to add edit data..

and when final submission is made then that temp file can be deleted 
safely..

hope this can help you

Thanks
Anirudh... Z.


>From: SolTek <soltek at mac.com>
>Reply-To: talk at nyphp.org
>To: NYPHP Talk <talk at nyphp.org>
>Subject: [nycphp-talk] HTML form preview then INSERT using PHP & MySQL
>Date: Sat,  6 Jul 2002 22:34:14 -0400
>Received: from mc2-f41.law16.hotmail.com ([65.54.237.48]) by 
>mc2-s2.law16.hotmail.com with Microsoft SMTPSVC(5.0.2195.4905); Sat, 6 Jul 
>2002 19:37:07 -0700
>Received: from slipdisc.virul.net ([66.114.66.188]) by 
>mc2-f41.law16.hotmail.com with Microsoft SMTPSVC(5.0.2195.4905); Sat, 6 Jul 
>2002 19:36:57 -0700
>Received: from nyphp.org (slipdisc.virul.net [66.114.66.188])by 
>slipdisc.virul.net (8.11.6/8.11.6) with ESMTP id g672YEP07361;Sat, 6 Jul 
>2002 22:34:14 -0400 (EDT)(envelope-from listmaster at nyphp.org)
>Message-Id: <200207070234.g672YEP07361 at slipdisc.virul.net>
>X-Paralist-Archived: 
><http://nyphp.org/list/paralist_archive.html?L_mid=581>
>X-List-Software: Paralist 0.6
>List-ID: <nyphptalk.nyphp.org>
>List-Owner: <mailto:listmaster at nyphp.org>
>List-Archive: <http://nyphp.org/list/paralist_archive.html?L_lid=1>
>List-Subscribe: <http://nyphp.org/list/>
>List-Unsubscribe: <http://nyphp.org/list/>
>Organization: New York PHP
>X-Mailer: Paramail 0.5
>Return-Path: listmaster at nyphp.org
>X-OriginalArrivalTime: 07 Jul 2002 02:36:57.0306 (UTC) 
>FILETIME=[29CA9BA0:01C2255F]
>
>Hello everyone!  This is regarding HTML forms, PHP & MySQL.
>
>I'm just learning PHP & MySQL.  I do know HTML though (big deal lol).
>
>My Question:
>
>How do you create an html form that goes to a preview screen and then
>allows the user to move back to the form if they made any errors and
>corrections are needed or click the send button to submit the form?  The
>form's contents are then inserted into a database table.
>
>The actions I want the user to take are as follows:
>1) Fill out form.
>2) Press Preview Button (the only button on that page).
>3) Look over preview of text entered. (this should be on a new page and
>appear as text, not text in form fields.)
>4a) If user finds mistake in text of Preview, click Edit button (or link
>or Browser back button) to go back to form and make changes. Then user
>repeats steps 1 (editing not re-entering data) through 4.
>4b) If user does not find mistakes in text of Preview, clicks submit
>button that INSERTS form data into MySQL table.
>5) User gets a new page thats says "thank you. form submitted."
>
>I already know how to INSERT form data into a table and ECHO the data
>onto a page after the data was inserted, but I can't figure out how to
>add the Preview in the middle before inserting the data.
>
>
>Many thanks to anyone who can help me with this!
>- Steve
>
>Just incase you need to know.. my current setup is:
>Solaris 2.7
>Apache 1.3.3
>MySQL Version 3.23.43
>PHP 4.1.0 Apache Module




_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com




More information about the talk mailing list