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?

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.