View Single Post

  #2 (permalink)  
Old 09-06-2004
Janwillem Borleffs
 
Posts: n/a
Default Re: newbie needs help with checking for posted data

Miffed wrote:
> It's a bit of a cliche, but I'm an experienced programmer, I'm only
> new to php (and web programming in general to be honest).
>


Well, point your browser to immediately to www.php.net then, most answers to
basic questions can be found there.

> The code does work EXCEPT for the 'num_tries' bit. I know from a
> previous example that data isn't posted when the field is empty(or is
> it?) which is why (I assume) the isset() function is used to set
> num_tries to zero when nothing is received. So why doesn't this work
> second time around?
>


$num_tries should also be retrieved from the $_POST array when
register_globals is disabled:

$num_tries = ( isset( $_POST['num_tries'] ) ) ? ++$_POST['num_tries'] : 0;

> And before anyone says anything, yes I have just posted this in the
> alt.php group, but I've only just seen a post referring to this much
> busier group.


I haven't found your message there, so I won't accuse you of multi-posting
;-)


JW



Reply With Quote