Jump to content

Singularity

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Singularity's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This must be a stupid question, but what is the code to read a textfile and store it into a variable? Example: I have a text file called "number.txt" with the number "9" in it. I have another file called "index.php" that is in the same directory. Using PHP, I want to be able to declare a variable for example "$thenumber" that is equal to whatever number is in the number.txt file. Please help!
  2. Ok, what exactly is the command that I have to run in the Cron to call up the numberfile.txt located in the public_html folder?
  3. i understand that i must use a flatfile db. can someone please post the method to do iT w/o cron? or if any other solutions are out there, please inform.
  4. Im looking for another way to do it, preferrably a method that uses only PHP without having to use cronjobs. I heard someone say that you can use srand and microtime or something to do this, but I am not sure. Remember that the random number is stored in a variable. So like $therandomnumber is equal to for example, 64 one day, and then 30 the next day, 40 the day after, etc. As long as it keeps the same number for 24 hours, and then the number changes after 24 hours. If someone can help me come up with a solution to this small problem using only PHP without the use of Cronjobs or database, please let me know. Much appreciated.
  5. Does anyone know how to make a script that generates a random number and stores it into a variable, but generates a random number for that variable every 24 hours? This is what I want to accomplish: ---- When ANY user visits my site on for example Monday, they see the number "5" (it is randomly generated out of 100 numbers). Any user who visits my site on Monday will see the number "5". After 24 hours, the system will randomly choose another number out of 100, for example, 67, and every person who visits my site on Tuesday, will see the number 67. After another 24 hours, the system will randomly choose another number out of 100, for example, 54, and every person who visits my site on Wednesday will see the number 54. ---- I hope you guys can help me out.
×
×
  • 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.