Page 1 of 1

form/function question

Posted: Thu Oct 28, 2004 10:47 am
by cto1mac
I am trying to streamline my site. I have a form, when it is submitted it calls another page and that page writes the information to my db. How can I set the form up to send those values to a function that will handle the db write. I am trying to put the function in the page, so that I can eliminate the middle man.

Thanks

Posted: Thu Oct 28, 2004 10:54 am
by phpScott
have the first page call itself and at the top check to see if the one of the values in the form isset()

Posted: Thu Oct 28, 2004 1:15 pm
by rehfeld

Code: Select all

function db_write($data) {
    // write to db
}


if (isSet($_POST['foo'])) {
    db_write($_POST['foo']);
}