Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006

    * Info tips script


    i want to include info tips script into my site

    the script is supposed to show random info tip from all the infotips that i already defined everytime the site opens

    so what is needed is to add info tips like 100 or something then the script shows one of them everytime the site is loaded

    it doesn't have to have admin side ( maybe i can add the info tips in the php file by myself through text editor )

    just 1 php file will be enough for this script - right ?

    please help me making this small script

  2. #2
    Join Date
    May 2005
    Uk, Norwich
    Why not ask this question in the programming forum here at wht, you are more likely to find an answer.

    Hope that Helps | low cost quality hosting
    Looking for a web hosting solution? Gain complete satisfaction today.
    With our 99.95% Uptime Guarantee, 24/7 Monitoring, Friendly Support, Cpanel/Fantastico, Domains and much more, why wait?

  3. #3
    Join Date
    May 2006
    oh, my bad

    please somebody move the thread if it's not the right forum

  4. #4
    Join Date
    May 2004
    Put all your tips in a file named tips.txt, one tip per line:

    This is a tip.
    This is another tip.
    More tips on the way.
    They don't end.
    Do this to get a random tip:

    PHP Code:
    // load the tips into an array
    $tips file('tips.txt');

    // get a random tip
    $random_tip $tips[array_rand($tips)];

    // print it out
    echo 'Tip of the day: '$random_tip;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts