• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

(php) automatically or not

jestem pro

That is the question
Joined
Apr 20, 2013
Messages
650
Solutions
14
Reaction score
88
Hello, I'm playing with php and have a riddle.

On a one page I put a script which launches at 8 p.m (for example)

And I don't know exactly how it will be working.

1. The script will be executed when the time is reached and the page updated itself
or
2. The script will be executed if anyone refresh/reload the page although the time has outed

We assume that the website is hosted.

I must know how php works in these situations.
 
In linux, with php cli you can run PHP files directly.
helloWorld.php
PHP:
<?php
echo "Hello World";
?>

Command to run the file:
Code:
php helloWorld.php

This command can be inserted into your crontab to run at a set interval. (see post above)
Make sure to use exact path to the file tho.
 
Last edited:
Thanks for links and the command, but I think you didn't understand me xddd

I have gesior acc and I made a new page then put a script there.

The script looks like this:
PHP:
if(date( H:i:m) == "20:00:00")

And I think if the website is hosted it should work.

But I don't know. Now I'm using windows but in the future will try linux.
 

Similar threads

Back
Top