473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

retaining form values

hello

How to retain the values in form tag ,in case user enter wrong
information.

Mar 13 '06 #1
3 2301

desh wrote:
hello

How to retain the values in form tag ,in case user enter wrong
information.


Not sure if this is what you mean but:

<form action="processpage.php" method="post" name="form" target="_top"
id="form">
<input name="email" type="text" id="email" maxlength="80"<?php echo(
isset( $_POST['email'] ) ) ? ' value="'.$_POST['email'].'"' : ''; ?>>
</form>

(3 lines actually, but google breaks 'em up ...)

Frizzle.

Mar 13 '06 #2
desh wrote:
hello

How to retain the values in form tag ,in case user enter wrong
information.


One way is to do something like this:

form1.php displays the form and has <input> fields in it. The form has
an action - say form1.ctrl.php and will use the POST method.

form1.ctrl.php processes the $_POST array and saves the values into a
$_SESSION when an error occurs (along with an error message). It then
redirects to form1.php.

form1.php sees the values in the $_SESSION and puts them back into the
form <input> using the value="" argument.

You can use GET instead of PUT.
You can use GET instead of SESSION.

It really depends on what you need.

-david-

Mar 13 '06 #3
thanks for you reply

Mar 13 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Suresh Kumaran | last post by:
How do you retain the last value the user keyed in a text box? I should be able to show the values when the user runs the executable for the second time. Appreciate help. Suresh
1
by: cgplays.com | last post by:
I have a select-pulldown at http://computergroupplays.com/fb-pres2.asp that changes the 3rd pulldown (Dbase) depending on what the user enters in the 2nd (Wk). My associate wants the values inside...
19
by: jeff | last post by:
how do you convert form byte to Int32 while retaining the binary value of the byte array
0
by: Earl Teigrob | last post by:
I have a page that reads values from an XML file to display to the user. The page also has a control panel that allows administrators to update the XML file with new values. When an administrator...
2
by: cFleury | last post by:
This system works in a intranet w/ some 200 stations and this particular form is retaining its values among different stations...like if I enter some values in the form on station 1 walk to station...
9
by: Steve Poe | last post by:
Configuration: PHP 4.3.9 Apache 2.0.52 Hello PHP group, I am a novice to PHP. I have searched through the newsgroup on my issue but I am not sure I know what I am missing.
3
by: Nick Douglas | last post by:
I have an unbound form to generate reports from in an mdb that we share on our network drive. The users selects several options for the report, such as what to view, the sort order, etc. These...
2
by: s4lin | last post by:
problem is pagination not retaining data field i have form with general data field, and i need to select some option which is store in database, so i open another page with retrieving data from...
2
by: anusha.vempati9 | last post by:
Hi All, I am calling a cgi file from a perl module. The cgi file contains the HTML form and some HTML fields(like check boxes). In my logic, I am trying to submit the form and calling the same...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.