actually

if (intval($guess) == $number {

would be more acuate then the trim ( )
you would eliminate all alpha characters and floating points
saying it has to be a whole integer....

Joel



"Ralph Friedman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> In article <[EMAIL PROTECTED]>, Jennifer Downey
wrote:
>
> > <input type="text" size="3">
> > <INPUT TYPE="submit" VALUE="Submit my number" NAME="guess">
> >
> you've got the "Name" attribute attached to the wrong INPUT element:
>
>  <INPUT type="text" size="3"  name="guess">
>  <INPUT type="submit" value="Submit my number">
>
> > if($guess = = $number) {
> >
> incorrect syntax here. that should be:
>  if ($guess == $number) {
>
>  better would be:
>
>  if (trim($guess) == $number {
>
>  this will assure that there's no whitespace in $guess
>
> --
> Rgds
> Ralph
>
>



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

Reply via email to