Page 1 of 1

HTML button call php function

Posted: Fri Jun 14, 2002 2:58 pm
by toppac
How can I make a button in html call a php function. I know in javascript you can do the Onclick method, can this be done with php as well?

Posted: Fri Jun 14, 2002 3:01 pm
by qads
maybe you can use this:

Code: Select all

<input type="Submit" value"function" name="call">

<?php
if(IsSet($Submit))
&#123;
function();
&#125;
?>

Posted: Fri Jun 14, 2002 3:17 pm
by Jim
of

Code: Select all

if($call)&#123;

//Create Function
myfunction()&#123;

function commands
&#125;

//Call Function
myfunction();
&#125;
Maybe?

Posted: Fri Jun 14, 2002 3:25 pm
by toppac
Thanks guys these work, now i just need to debug my sql query :D

EDIT: I take that back, neither of these are working. Tried them both and they did not run the function. Any more ideas? Trying to run a function that will execute a SQL query.

Also why I am on it, how does php do a redirect or reload of a page.

Posted: Fri Jun 14, 2002 4:23 pm
by Jim
header("location:insert/url/here.com")

:)