Jump to content

calling php function


csckid

Recommended Posts


<form >
Search By Country:<br>
<select name="country" onClick="<?php hello();  ?>">
					<option value="Australia">Australia</option>
<option value="USA">USA</option>
</select>

</form>

<div name="display">
<?php
echo "<table border=3><tr><td>hi</td></tr></table>";
function hello(){
echo "how";
}

?>

</div>

 

 

 

i tried to call the phpfuntion hello() onclick.... but the command is not executed.......

 

plz help

Link to comment
https://forums.phpfreaks.com/topic/150273-calling-php-function/
Share on other sites

ok well i am guessing you are new to web development basically PHP is Server-Side so everything happens on the server then the page is sent to the user and PHP stooped and not called again until a new URL is clicked also when it is started again it is completely fresh starting with a new script.

you need to use Javascript it is Client-Side and so happens int the clients Web Browser. it can be used for things you want to happen when user clicks a button

 

Scott.

 

 

Link to comment
https://forums.phpfreaks.com/topic/150273-calling-php-function/#findComment-789168
Share on other sites

Agree i am sorry,

 

just dash d in there , like i said years ago, i hate JavaScript sorry.

 

I did study JavaScript, and got a cert, but i was told to study

java and continue what i new,

never did like php to much .

 

i have noticed if you don't no JavaScript and ajax there no jobs for me.

Link to comment
https://forums.phpfreaks.com/topic/150273-calling-php-function/#findComment-789227
Share on other sites

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.