473,498 Members | 523 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Display and check entered data before submission

58 New Member
Greetings !
Can anyone share me some piece of code that displays user submitted data for another chance to verify and correct it before finally inserting it into the database? If insertion cannot be prevented at this level,how do i go about turning the displayed page into an updating rather than inserting page?
Thank you for your help !
May 28 '07 #1
6 4244
ak1dnar
1,584 Recognized Expert Top Contributor
Greetings !
Can anyone share me some piece of code that displays user submitted data for another chance to verify and correct it before finally inserting it into the database? If insertion cannot be prevented at this level,how do i go about turning the displayed page into an updating rather than inserting page?
Thank you for your help !
How do you want to display the submitted values(Before Inserting to database),in the same page or in a different page.
May 28 '07 #2
Jankie
58 New Member
How do you want to display the submitted values(Before Inserting to database),in the same page or in a different page.
Possibly thru action="<?php echo $_SERVER['PHP_SELF'];?>" that loads a dialog"this info is correct" this info is not correct,go back(or edit). I think a hidden field in an intermediate confirmation page would achieve the same result,i just didnt do that before.
So user fills form,click submit to be presented with their input(it will inevitably be inserted in the db by then),but the next page(where This input is correct leads to)overide any values if they update anything.
May 28 '07 #3
ak1dnar
1,584 Recognized Expert Top Contributor
Try to do some changes for this script. the original script is here
[PHP]<?php
if($_POST['send'])
{
$UNAME = $_POST['uname'];
$flag="OK"; // This is the flag and we set it to OK
$msg=""; // Initializing the message to hold the error messages

if(strlen($UNAME) < 5)
{ // checking the length of the entered userid and it must be more than 5 character in length
$msg=$msg."<li>Please enter user id more than 5 character length</li>";
$flag="NOTOK"; //setting the flag to error flag.
}
if($flag <>"OK"){
echo $msg;
}else
{
// all entries are correct and let us proceed with the database checking etc …

}
}
?>
<html>
<body>
<form action="<?php $PHP_SELF ?>" method="POST">
USER NAME : <input name="uname" type="text" value="<?=$_POST['uname']?>"/>
<input name="send" value="SEND" type="submit" />
</form>

</body>
</html>
[/PHP]
May 28 '07 #4
ak1dnar
1,584 Recognized Expert Top Contributor
More Scripts for you give it a try.
http://www.htmlcenter.com/tutorials/...s.cfm/149/PHP/
May 28 '07 #5
Jankie
58 New Member
Sorry,i was not clear enough.I meant to display the user submitted data after passing validation just so they can see ALL their entered info for a last chance
May 28 '07 #6
ak1dnar
1,584 Recognized Expert Top Contributor
Sorry,i was not clear enough.I meant to display the user submitted data after passing validation just so they can see ALL their entered info for a last chance

See this line under your Original post
Can anyone share me some piece of code that displays user submitted data for another chance to verify and correct it before finally inserting it into the database?
How do you want to verify the coding.if you application is not going to verify the user inputs who is going to do it.

Any way if you want just display user entered values, try like this.

[PHP]<?php
if($_POST['send'])
{
$form = '
<form action="'.$PHP_SELF.'" method="POST">
<input name="uname" type="hidden" value="'.$_POST['uname'].'">
<input name="continue" value="continue" type="submit" />
</from><br>';
echo '<b>Inserted Values</b><br>';
echo '<li>'.$_POST['uname'].'</li>';
echo $form;
}
if($_POST['send']){
echo 'Do the stuffs for insert to MySQL';
}
?>
<html>
<body>
<form action="<?php $PHP_SELF ?>" method="POST">
USER NAME : <input name="uname" type="text" value="<?=$_POST['uname']?>"/>
<input name="send" value="SEND" type="submit" />
</form>

</body>
</html>[/PHP]
May 28 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2157
by: dmiller23462 | last post by:
I'm trying to create a submission page for users to request PC/LAN Access....If they select "Yes" in the field asking about if they need Non Standard Software, I want several other HTML fields to...
4
1784
by: dmiller23462 | last post by:
Somebody take a look and give me any suggestions? My brain is nuked... Here's my deal....I have online submission forms on my intranet at work here....I am appending to an Access DB with the...
13
40617
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
3
2176
by: Scott | last post by:
Relative newbie here, I'm looking to display the value of radio buttons and check boxes on the page before submission. So far I can do most of it. When "Hat" is checked there are to be no color...
11
4588
by: bala | last post by:
hi!!! i need to display a disclaimer which is two page in length in a word document. i also need to format the text. the idea is something as follows on opening the application, a form which...
2
2030
by: | last post by:
While I can extract the option value from the following: <Select name='Keystring' MULTIPLE> <option value='1' name='status'>Pending</option> ..... </select> I cannot seem to extract the...
3
3101
by: Bob Sanderson | last post by:
I am trying to create a form for a MySQL database similar to a spreadsheet. The idea is to display a list of records, with the last line of the list being an input form. When the user enters data...
8
1914
mmarif4u
by: mmarif4u | last post by:
Hi everybody... I want to enter values to db like the following,,, Format is like this (810605-14-6356) This is the rite format, No a to z letters... 6 digits then - then 2 digits then - then 4...
2
3655
by: dancerman | last post by:
I want a simple as possible regex to check the format of my form submission URL string, I don't care whether is an actual real working URL, just that it be in proper URL format and, IF POSSIBLE add...
0
7124
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
7163
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
7200
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...
1
6884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7375
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...
1
4904
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4586
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.