473,473 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

form processing with input validations

I am creating a form Form1.php that posts to the another form
Form2.php.

I have input validations on the first form. I need the user to go to
the next form ONLY if the inputs from the user are valid. I have not
been able figure out how to do this since the first form always posts
to the next form no matter what.

I would really appreciate if somebody can share their php knowledge
and give me some idea on how this is done in php.

Thanks

Jan 28 '07 #1
7 1368
php newbie wrote:
I am creating a form Form1.php that posts to the another form
Form2.php.

I have input validations on the first form. I need the user to go to
the next form ONLY if the inputs from the user are valid. I have not
been able figure out how to do this since the first form always posts
to the next form no matter what.

I would really appreciate if somebody can share their php knowledge
and give me some idea on how this is done in php.

Thanks
Either do validation in the second form, and if it fails, send them back
to the first form. Or, post to the first form and validate there. If
it succeeds, go to the second form.

Either way, you can save data in the $_SESSION for later retrieval.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jan 28 '07 #2
Thanks for a prompt reply. Is there a way to achieve this same result
without using session?
Any ideas!!

On Jan 28, 12:54 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
php newbie wrote:
I am creating a form Form1.php that posts to the another form
Form2.php.
I have input validations on the first form. I need the user to go to
the next form ONLY if the inputs from the user are valid. I have not
been able figure out how to do this since the first form always posts
to the next form no matter what.
I would really appreciate if somebody can share their php knowledge
and give me some idea on how this is done in php.
ThanksEither do validation in the second form, and if it fails, send them back
to the first form. Or, post to the first form and validate there. If
it succeeds, go to the second form.

Either way, you can save data in the $_SESSION for later retrieval.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Jan 28 '07 #3
Rik
php newbie <ar******@gmail.comwrote:
On Jan 28, 12:54 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>php newbie wrote:
I am creating a form Form1.php that posts to the another form
Form2.php.
I have input validations on the first form. I need the user to go to
the next form ONLY if the inputs from the user are valid. I have not
been able figure out how to do this since the first form always posts
to the next form no matter what.
I would really appreciate if somebody can share their php knowledge
and give me some idea on how this is done in php.
ThanksEither do validation in the second form, and if it fails, send
them back
to the first form. Or, post to the first form and validate there. If
it succeeds, go to the second form.

Either way, you can save data in the $_SESSION for later retrieval.

Thanks for a prompt reply. Is there a way to achieve this same result
without using session?
Any ideas!!
You can make hidden inputs in the second form, so it will contain the
information of the first. This means that you will have to revalidate the
data from the first form when the user submits the second form though.
--
Rik Wasmus
Jan 28 '07 #4
Rik wrote:
php newbie <ar******@gmail.comwrote:
>On Jan 28, 12:54 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>>php newbie wrote:
I am creating a form Form1.php that posts to the another form
Form2.php.

I have input validations on the first form. I need the user to go to
the next form ONLY if the inputs from the user are valid. I have not
been able figure out how to do this since the first form always posts
to the next form no matter what.

I would really appreciate if somebody can share their php knowledge
and give me some idea on how this is done in php.

ThanksEither do validation in the second form, and if it fails,
send them back
to the first form. Or, post to the first form and validate there. If
it succeeds, go to the second form.

Either way, you can save data in the $_SESSION for later retrieval.

Thanks for a prompt reply. Is there a way to achieve this same result
without using session?
Any ideas!!

You can make hidden inputs in the second form, so it will contain the
information of the first. This means that you will have to revalidate
the data from the first form when the user submits the second form though.
--Rik Wasmus
The problem with this is you can't automatically go back to the first
form from the server alone. A header redirection statement won't send
the data in the hidden values.

You could do it with javascript - if the user has javscript running.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jan 28 '07 #5
php newbie wrote:
On Jan 28, 12:54 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>php newbie wrote:
>>I am creating a form Form1.php that posts to the another form
Form2.php.
I have input validations on the first form. I need the user to go to
the next form ONLY if the inputs from the user are valid. I have not
been able figure out how to do this since the first form always posts
to the next form no matter what.
I would really appreciate if somebody can share their php knowledge
and give me some idea on how this is done in php.
ThanksEither do validation in the second form, and if it fails, send them back
to the first form. Or, post to the first form and validate there. If
it succeeds, go to the second form.

Either way, you can save data in the $_SESSION for later retrieval.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

Thanks for a prompt reply. Is there a way to achieve this same result
without using session?
Any ideas!!
(Top posting fixed)

You can use other way - like javascript. But sessions are the easiest.
They are really simple to use.

P.S. Please don't top post. Thanks.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jan 28 '07 #6
Rik
Jerry Stuckle <js*******@attglobal.netwrote:
Rik wrote:
>php newbie <ar******@gmail.comwrote:
>>On Jan 28, 12:54 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
php newbie wrote:
I am creating a form Form1.php that posts to the another form
Form2.php.

I have input validations on the first form. I need the user to go to
the next form ONLY if the inputs from the user are valid. I have not
been able figure out how to do this since the first form always
posts
to the next form no matter what.

I would really appreciate if somebody can share their php knowledge
and give me some idea on how this is done in php.

ThanksEither do validation in the second form, and if it fails,
send them back
to the first form. Or, post to the first form and validate there. If
it succeeds, go to the second form.

Either way, you can save data in the $_SESSION for later retrieval.
Thanks for a prompt reply. Is there a way to achieve this same result
without using session?
Any ideas!!
You can make hidden inputs in the second form, so it will contain the
information of the first. This means that you will have to revalidate
the data from the first form when the user submits the second form
though.
--Rik Wasmus

The problem with this is you can't automatically go back to the first
form from the server alone. A header redirection statement won't send
the data in the hidden values.

You could do it with javascript - if the user has javscript running.
That's one of the reasons for me to keep several forms in one script (or a
main script that includes several forms). All the
data/requirements/validation is there, and served up based on input.
--
Rik Wasmus
Jan 28 '07 #7
On Sun, 28 Jan 2007 11:23:42 -0800, php newbie <ar******@gmail.comwrote:
>php newbie wrote:
I am creating a form Form1.php that posts to the another form
Form2.php.
I have input validations on the first form. I need the user to go to
the next form ONLY if the inputs from the user are valid. I have not
been able figure out how to do this since the first form always posts
to the next form no matter what.
I would really appreciate if somebody can share their php knowledge
and give me some idea on how this is done in php.
ThanksEither do validation in the second form, and if it fails, send
them back
to the first form. Or, post to the first form and validate there. If
it succeeds, go to the second form.

Either way, you can save data in the $_SESSION for later retrieval.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

On Jan 28, 12:54 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:

Thanks for a prompt reply. Is there a way to achieve this same result
without using session?
Any ideas!!
(Changed topposting to bottomposting)

There's really no reason to not use sessions here. However, to address the
previous concern that you can't use a header redirect to send the original
data back to the first form, you could simply use fsockopen to send a POST
request with (altered/validated) data, and have the PHP on the first form
display any default values that have been POST'ed.

This is really much more of a hassle than sessions. PHP will even
automatically try and send a session cookie by default, but if it can't,
it will use the query string.

--
Curtis
Feb 1 '07 #8

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

Similar topics

5
by: TG | last post by:
Dear PHP Group, I have two forms that are used to collect user information. The first one takes user inputted values such as fullname, city, address etc. I want these values to display in the...
1
by: Danny Anderson | last post by:
Hola, PHP folk! I have a php page that contains a self-processing form. The form holds search results. The search terms originally came from the previous page, but the user can repeatedly...
2
by: Jack | last post by:
Hi, I got a simple form where one needs to input data. The data is being processed in an asp page. However, I cannot figure out why couple of values I am typing in the form is not being retrived...
3
by: raj chahal | last post by:
Hi there i have created a registration page containing a form than sends username password to an asp processing page. If the user exists it sends the user back to the registration page with...
14
by: JNariss | last post by:
Hello, I am fairly new to asp and jscript and am now in the process of learning some form validation. I am taking one step at a time by validating each field and testing it before moving onto...
13
by: deko | last post by:
I have a basic feedback form with a submit button. After the "send" button is clicked, I want the user to be redirected to a different page that says "Your message has been sent." How do I do...
11
by: TokyoJ | last post by:
I run a small camp in Alaska for kids and my director is asking for a web form. Could someone please have a look and offer some advice on where I'm making mistake(s)? I'm using the RegExp function...
4
by: Greg Scharlemann | last post by:
I'm trying to setup a dyamic dropdown list that displays a number of text fields based on the selected number in the dropdown. The problem I am running into is capturing the data already entered...
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...
1
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.