Hi All,
I just want to share my code.
A lots of website said that php is on server side and javascript is on client side...they said we cannot run php on javascript...
here's how we can run php function when you click call the onchange events on javascript.
function myfunction(){
$x="I love PHP ! by Arman de Guzman de Castro :-)";
return $x;
}
?>
<!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() {
b = "<?=myfunction();?>";
alert(b);
}
</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="armandecastro" name="armandecastro" type="text" onChange="ILovePHP();"></form><p>
</body>
</html>
try to type something on the inputbox....
hope you can help me to improve this code of mine..
cheers!