NYCPHP Meetup

NYPHP.org

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

Anirudhsinh Zala zala007 at hotmail.com
Sun Jul 7 03:28:41 EDT 2002


Well steve

I suggest that u don't use..embedded HTML-pHp file system..
it will cause lot of problem..

insetad u use classes..download "rFastemplate.php" from php.net..and use 
seperate html and php files...so that u will not get this kind of parse 
errors..

in your file..it doesn't seem that you have error in codes..but check 
whether is there any invisible charcters or not..which u may not be able to 
see but..may cause error..

Also check first line...<form method="POST" action="submit.php"" 
enctype="multipart/form-data"> where u placed 2 "" after word submit.php 
which is also wrong remove extra one.

Thanks

Airudh Zala







>From: SolTek <soltek at mac.com>
>Reply-To: talk at nyphp.org
>To: NYPHP Talk <talk at nyphp.org>
>Subject: Re: [nycphp-talk] HTML form preview then INSERT using PHP & MySQL
>Date: Sun,  7 Jul 2002 02:44:16 -0400
>Received: from mc1-f10.law16.hotmail.com ([65.54.236.17]) by 
>mc1-s15.law16.hotmail.com with Microsoft SMTPSVC(5.0.2195.4905); Sat, 6 Jul 
>2002 23:47:43 -0700
>Received: from slipdisc.virul.net ([66.114.66.188]) by 
>mc1-f10.law16.hotmail.com with Microsoft SMTPSVC(5.0.2195.4905); Sat, 6 Jul 
>2002 23:47:30 -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 g676iGP07691;Sun, 7 Jul 
>2002 02:44:16 -0400 (EDT)(envelope-from listmaster at nyphp.org)
>Message-Id: <200207070644.g676iGP07691 at slipdisc.virul.net>
>X-Paralist-Archived: 
><http://nyphp.org/list/paralist_archive.html?L_mid=583>
>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 06:47:31.0128 (UTC) 
>FILETIME=[2AA5CB80:01C22582]
>
>Hello,
>
>I would really like to go with option 1 that Anirudhsinh suggested.
>I tried using hidded fields to a preview.php page but I get a Parse
>error on line 30.
>Here are lines 28 through 33:
>
><form method="POST" action="submit.php"" enctype="multipart/form-data">
><?php
>echo "<input type=hidden name=\\"Full_Name\\" value=\\"$Full_Name\\">";
>echo "<input type=hidden name=\\"Email\\" value=\\"$Email\\">";
>echo "<input type=hidden name=\\"Message\\" value=\\"$Message\\">";
>?>
>
>Does anyone have any idea what could be causing the error?
>
>On Sunday, July 7, 2002, at 02:28 AM, Anirudhsinh Zala wrote:
>
> > 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
> >
> >




_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx




More information about the talk mailing list