Jump to content

How to call a php file from another php file


imryn

Recommended Posts

If I use a one of these options

 

include("file.php");

require("file.php");

include_once("file.php");

require_once("file.php");

 

can I then do this <Body OnLoad="Rotate.php"> ?

 

Best Regards!

Link to comment
Share on other sites

onLoad is normally associated with Javascript.... it wouldn't have any affect with a php file.

 

what are you trying to achieve by this?

 

If you want a function that exists within a php file to occur when a page is loaded, you should include that file with one of the methods that have been shown to you... and then manually call the required function(s) for what you need.

 

ie: litterally type functionName() somewhere in your document after the inclusion...

Link to comment
Share on other sites

Triphis, thank you, I think I understand now what was being said... you cleared up my confusion, I did not realize I could to the #include("rotate.php") then in my code just call the function to start the script.

 

Here the story, I have rotate.php that lives in the image dir, and when it is called it displays a different image to the web browser everytime it is called. I originally had a javascript that I had to everyday load 3 new images into an array to display on the index page every 35 seconds, now I want to call rotate.php to do my dirty work.

 

Is there another way or should I say a better way to do all of this?

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.