Jump to content

How can i call PHP functions using events ?


jd2007

Recommended Posts

You can try this:

 

<form> //include necessary elements in form tag
<input type="button" name="execute_function" value="Click" />
</form>

 

And then on whatever page you are executing the code on, include this:

 

<?php
    if(isset($_POST['execute_function'])) {
        click();
    }
?>

 

 

However, depending on what you are trying to do, a javascript function may serve you better. What is it that you want to do?

 

thanks for the reply, although it wasn't my question. i was wondering if i could push this a little further? how does one get a function to run a after a specific time frame has expired for example a slide show that reloads a new picture after 6 seconds?

It cant be done without javascript. PHP runs entirely on the server, whereas a slideshow etc runs on the client. The server can't know what is happening on the client without either the user either clicking a link or pushing a button in order to send data to the server, or javascript executing some event that sends data to the server.

 

Although I wonder if you maybe posted in the wrong thread? You arent the OP of this thread.

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.