Jump to content

html push button and php code


calmchess

Recommended Posts

I'm trying to use the following html code to execute a php function that simply echo's a message to the user the php function seems to get executed but the echo never shows up on the screen and i get a IE error box that says checking undefined. what am i doing wrong?

 

<input type="button" name="chAvail" onClick="<?chAvail()?>" value="Submit"></td></tr>

<?function chAvail (){echo "checking";}?>

Link to comment
https://forums.phpfreaks.com/topic/141776-html-push-button-and-php-code/
Share on other sites

yeah, PHP (server side) and HTML/JavaScript (client side) are two different worlds. the easiest way to understand what JavaScript is doing is to load up the page in the browser and do a View Source. What you see there is the client side code that is getting run.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.