Forum Moderators: coopster

Message Too Old, No Replies

Posting info to a script and getting it back on the form if there is e

Posting info to a script and getting it back on the form if there is error

         

Imy_S3

1:49 am on Mar 21, 2004 (gmt 0)

10+ Year Member



Hi

Got a class called a.php
has form in this class that user fills out
then presses submit button (thereofore is posting information called b.php)

Got another class called b.php
checks to see if the fields in the above class are empty with:

if ((empty($_POST['surname'])) ¦¦ (empty($_POST['forename'])))
{
what do i do here so it calls a.php posting back the information

for example if surname was filled with jones, it would reappear in the form again and teling the user that forname has been left empty.

hope u can help.

thanks in adavance

ergophobe

5:00 pm on Mar 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I almost always have forms call themselves and then redirect if necessary.

So a.php submits to a.php and only calls b.php if there is an error or a successful login, or whatever. But any validation, checking and so on is done by the page with the form. Then if there's a problem, you cna just put the values in.

Otherwise, you can

- use session vars
- use cURL functions

Tom

Imy_S3

5:19 pm on Mar 21, 2004 (gmt 0)

10+ Year Member



sorry

im confused with your solution.

can you please expand.

cheers