Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jan 2003
    Location
    CT
    Posts
    91
    Thanks
    0
    Thanked 0 Times in 0 Posts

    php and html help plz!

    ok, i am having a problem. i have a counter in php, and it logs it visitors and everything in a .txt file on my server. now, how would i go about changing the color of the text?

    (this is the php code)

    <?php
    // Our log file;
    $counter = "counter.txt";

    // Date logging;
    $today = getdate();
    $month = $today[month];
    $mday = $today[mday];
    $year = $today[year];
    $current_date = $mday . $month . $year;

    // Log visit;
    $fp = fopen($counter, "a");
    $line = $REMOTE_ADDR . "|" . $mday . $month . $year . "\n";
    $size = strlen($line);
    fputs($fp, $line, $size);
    fclose($fp);

    // Read log file into array;
    $contents = file($counter);

    // Total hits;
    $total_hits = sizeof($contents);





    // Daily hits;
    $daily_hits = array();
    for ($i=0;$i<sizeof($contents);$i++) {
    $entry = explode("|", $contents[$i]);
    if ($current_date == chop($entry[1])) {
    array_push($daily_hits, $entry[0]);
    }
    }
    $daily_hits_size = sizeof($daily_hits);






    // Let's display everything ;
    echo "Total hits: " . $total_hits . "<br>Daily hits: " . $daily_hits_size;
    ?>


    where could i make it so the text is different?
    Last edited by relyt; 01-23-2003 at 11:16 PM.

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Well assuming you wish to use CSS:


    echo "<div class=\"yaks\">Total hits: " . $total_hits . "<br>Daily hits: " . $daily_hits_size . "</div>";
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Registered User
    Join Date
    Jan 2003
    Location
    CT
    Posts
    91
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i also need help with a search engine. does anyone know where i can get one with no advertisements and that is known to work?

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts


  •  

    Posting Permissions

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