|
Posted by Rik on 01/28/07 20:58
Jerry Stuckle <jstucklex@attglobal.net> wrote:
> Rik wrote:
>> php newbie <arpit.00@gmail.com> wrote:
>>> On Jan 28, 12:54 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>>>> 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
Navigation:
[Reply to this message]
|