Re: [PHP] Problem about Reading input from a Form

2002-02-25 Thread Stewart G.

Its not a register_globals issue. You must wrap $user and $address in php 
print statements rather than just in the html.

Your name is .
Your address is .

That will work with either GET or POST.

-- Stewart

On Mon, 25 Feb 2002, Kostas Karadamoglou wrote:

> I set the register_globals On in the php.ini file but when i do php.info it 
> shows that is off.About the better way, How i can manipulate this variables, 
> can you give me an exable.
> Thank you
> 
> 
> >From: "Ford, Mike   [LSS]" <[EMAIL PROTECTED]>
> >To: 'Kostas Karadamoglou' <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> >Subject: RE: [PHP] Problem about Reading input from a Form
> >Date: Mon, 25 Feb 2002 14:30:09 -
> >
> > > -Original Message-
> > > From: Kostas Karadamoglou [mailto:[EMAIL PROTECTED]]
> > > Sent: 25 February 2002 14:09
> > >
> > > I put and the POST method but I have the same problem
> > > I don't know why, any ideas?
> > > Thank you
> > >
> > > >
> > > >-Original Message-
> > > >From: Kostas Karadamoglou [mailto:[EMAIL PROTECTED]]
> > > >Sent: Monday, February 25, 2002 12:58 PM
> > > >
> > > >I can't take the variables $user and $address from the form
> > > to the php
> > > >file.
> >
> >Which version of PHP?  Is register_globals set to Off?  If it is, you can 
> >either turn it On (if you have control of the server), or (better!) use the 
> >$HTTP_POST_VARS (4.0) or $_POST (4.1) array.
> >
> >Cheers!
> >
> >Mike
> >
> >-
> >Mike Ford,  Electronic Information Services Adviser,
> >Learning Support Services, Learning & Information Services,
> >JG125, James Graham Building, Leeds Metropolitan University,
> >Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> >Email: [EMAIL PROTECTED]
> >Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211
> 
> 
> 
> 
> _
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: form submission error trapping

2002-02-25 Thread Stewart G.

You do not need to use javascript.

Simple create a form that submits to itself. And check the values, then 
reprint the form or redirect.

Example:
\n";
}
  }

  if (!empty($err_msg)) print $err_msg;
}
?>







Hope that helps,

-- Stewart

On Mon, 18 Feb 2002, George Whiffen wrote:

> Jason,
> 
> You didn't mention Javascript checks.
> 
> Personally I really dislike having to wati for a page to reload before finding
> out that I've just failed to fill in a field.  The Javascript to do basic
> on-page checks is all pretty simple stuff.
> 
> Of course this doesn't mean we can skip checking the data again in the php!
> Javascript might be switched off, we might have a bug in the Javascript (easy to
> do), or we (or someone else) might want to simulate form entry via a url link.
> It's also quite likely that there may be checks e.g. checks for duplicate
> entries, which cannot be done on a form.
> 
> Here's some skeleton code that handles a basic form with both php and javascript
> checks, (I've deliberately tried to keep the php/Javascript as similar as
> possible).  You can try it at http://www.whiffen.net/simple.php if you want.
> 
> *** simple.php***
> 
> 
> if (isset($surname))
> {
>$errormessage = "";
> 
>if ($surname == "")
>{
>   $errormessage = $errormessage . "
You must enter a value for surname"; >} > >if ($age <= 0 or $age != floor($age)) >{ > $errormessage = $errormessage . "
Age must be a whole number"; >} > >if ($errormessage == "") >{ > // do whatever you have to with the data and maybe finish with > // a redirect to a success page >} > } > > print ' > > >