> Is it possible to have a form submit button call a function. Like for
> updating a record in a database or for deleting data. Rather than a
> new page or with PHP_SELF
Not really.
PHP lives on the server.
The HTML and its submit button live on the browser.
Any functions in the PHP script that existed before the browser got the HTML
are long-gone and dead by the time the user clicks the button.
So if you want anything to change on the server as a result of their click,
you pretty much need to contact the server somehow, and access a URL to do
it.
That generally means you want to send back a whole new web page to tell them
it worked (or failed).
If for some really weird reason you don't wanna do that, you probably
*COULD* use onClick and some JavaScript (unreliable) to access a PHP URL and
execute your delete, but not have the form page change at all. Can't think
of a valid human-interface need for this, but it might be possible to do.
--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
--
PHP General 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]