Calling php function inside javascript function
Posted: Fri Oct 08, 2010 10:35 am
How can I call a PHP Function inside a Javascript Function? This is what I have so far, but I don't think I'm doing it the right way.
Any suggestions?
Any suggestions?
Code: Select all
<?php
function phpQuery(){
$query = mysql_query("INSERT INTO mytable VALUES('','name','email')");
}
?>
<script type="text/javascript">
function delayQueries()
{
timeoutID = window.setTimeout(doQueries, 2000);
}
function doQueries()
{
var runQuery = "<?php phpQuery(); ?>";
}
</script>