calmchess Posted January 21, 2009 Share Posted January 21, 2009 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 More sharing options...
lonewolf217 Posted January 21, 2009 Share Posted January 21, 2009 taking a stab at this, but can't onClick only launch a javascript function, not a php function ? Link to comment https://forums.phpfreaks.com/topic/141776-html-push-button-and-php-code/#findComment-742200 Share on other sites More sharing options...
cooldude832 Posted January 21, 2009 Share Posted January 21, 2009 You are trying to use a javascript function as a php function. Do you know what PHP stands for? Link to comment https://forums.phpfreaks.com/topic/141776-html-push-button-and-php-code/#findComment-742202 Share on other sites More sharing options...
rhodesa Posted January 21, 2009 Share Posted January 21, 2009 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. Link to comment https://forums.phpfreaks.com/topic/141776-html-push-button-and-php-code/#findComment-742212 Share on other sites More sharing options...
jjacquay712 Posted January 21, 2009 Share Posted January 21, 2009 ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? : : : :P :P Link to comment https://forums.phpfreaks.com/topic/141776-html-push-button-and-php-code/#findComment-742386 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.