...

View Full Version : php and html help plz!



relyt
01-23-2003, 10:01 PM
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?

Spookster
01-23-2003, 11:57 PM
Well assuming you wish to use CSS:


echo "<div class=\"yaks\">Total hits: " . $total_hits . "<br>Daily hits: " . $daily_hits_size . "</div>";

relyt
01-24-2003, 01:17 AM
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?

mordred
01-24-2003, 01:21 AM
http://www.mnogosearch.ru/
http://www.php.net/manual/en/ref.mnogo.php

or you could try Google... SCNR :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum