Click to See Complete Forum and Search --> : PHP + HTML problem ......
lting
01-01-2004, 09:12 PM
i have a php function name
FUNCTION more()
{
echo "where are you";
}
i can use a button to call this fucntion using onClick?
<input type="button" name="Click" onClick="more();">
is this make sense? or the onClick only can use for JS function?
fredmv
01-01-2004, 09:55 PM
You can only use the onclick event handler for JavaScript functions.
Cainofnod
01-01-2004, 11:17 PM
PHP is a server side technology. The onclick attribute works only with a client side language (JavaScript).
Sux0rZh@jc0rz
01-02-2004, 12:31 AM
not sure about this, but could one do, instead of onclick, action="more()"? or would one have to do action="more().php" and then have the php file look like this: <?PHP
echo "where are you";
?> pretty sure doing the action = "more().php" would work, but it'd be easier if one could do action="more()"...
Originally posted by Sux0rZh@jc0rz
pretty sure doing the action = "more().php" would work... I'm pretty sure it wouldn't... ;)
You'll have to reload the page, and probably set a query string (or something else) so the page knows what function to run.