Jump to content

calling php function in javascript events e.g. onchange


rm_phpfreaks

Recommended Posts

<?php
function myfunction(){
echo "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG!";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script language="javascript" type="text/javascript">
function ILovePHP() {
window.document.write('<?=myfunction();?>');
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form action="" method="post"><input name="" type="text" onChange="ILovePHP();"></form><p>
</body>
</html>

 

Run ECHO COMMAND when you type some text on textbox.

 

 

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.