Jump to content

Calling php function inside javascript function


Smudly

Recommended Posts

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?

 

<?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>

 

  • 2 weeks later...

Yeah, If you know javascript and php AJAX is not hard to learn. w3schools.com will be very helpful. Also there is a help section for AJAX if you want to post any of your problems there.

Thanks,

Colton Wagner

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.