> I have the insertRecord function which is supposed to be called only
> when you hit submit. For some reason I'm blanking out on how to do
> this. The function and function call ARE on the same page. I think I
> just need some logic to indicate "stop" and "go".

Every form has a submit button right?  Submit buttons are form elements
(whose value is submitted when the button is clicked), just like any other
form field.  So I have something like this:

   <INPUT NAME="submit" TYPE="submit" Value=" Click Here! ">

In my PHP code, I check the value of $submit; if it's empty, I know the form
data hasn't been submitted yet (if it had, $submit would have the value "
Click Here! "), so in that case I display the form.  If it does not have an
empty value, the user has clicked the submit button, so I can go ahead
processing the form data.  Like this:

if ( empty($submit) )
    ### Display the form
    ### Do some checks to make the the data is OK

    ### Do the Insert, or whatever else is to be done

- Darryl

  Darryl Friesen, B.Sc., Programmer/Analyst    [EMAIL PROTECTED]
  Education & Research Technology Services,     http://gollum.usask.ca/
  Department of Computing Services,
  University of Saskatchewan
  "Go not to the Elves for counsel, for they will say both no and yes"

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to