Tuesday, August 14, 2007

Cocosul...

Un preot locuia langa o manastire si avea 10 gaini si un cocos.
Cocosul din cand in cand disparea, dar aparea pana seara. Ultima data cand a zburat nu s-a mai intors si preotul, primul lucru duminica in biserica, a intrebat lumea:
- As vrea sa stiu daca cineva are un cocos?... si toti barbatii s-au sculat in picioare...
- Nu, nu, nu, am vrut sa intreb daca cineva a vazut un cocos?...si toate femeile s-au sculat in picioare...
- Nu, nu, nu, nici asta n-am vrut sa stiu, vreau sa stiu daca cineva de aici a vazut un cocos care nu-i apartine?... si jumatate din femei s-au sculat in picioare...
- Nu, nu, nu, nici asta n-am vrut sa stiu, vreau sa stiu daca cineva a vazut cocosul meu?... si toate maicutele s-au sculat in picioare.

Monday, August 13, 2007

Se poate rezolva

Un cetatean se duce la doctor sa-i faca o radiografie la plamini.
Doctorul: - Domnule, iata radiografia. Am 2 vesti... una buna si una proasta.
Pacientul: - Care e vestea proasta?
Doctorul: - Dupa cum puteti vedea, aveti o tumoare foarte mare la plamini
Pacientul: - Si aia buna?
Doctorul: - Se poate rezolva in Photoshop

Sunday, August 12, 2007

5 mari evrei ai lumii

Moise: - Totul este lege.
Isus: - Totul este dragoste.
Marx: - Totul este bani.
Freund: - Totul este sex.
Einstein: - Totul este relativ.

Un arab la aeroport

Un arab la aeroport:
- Name?
- Abdul al-Rhazib.
- Sex?
- Three to five times a week.
- No, no. I mean male or female?
- Male, female,sometimes camel.
- Holy cow!
- Yes, cow, sheep, animals in general.
- But isn't that hostile?
- Horse style, doggy style, any style!
- Oh dear!
- No,no! Deer run too fast!

Thursday, August 9, 2007

PHP/MySQL Logging

CREATE TABLE `user_log` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`log_date` DATE,
`log_time` TIME,
`method` TEXT,
`page` TEXT,
`referer` TEXT,
`adress` TEXT,
`browser` TEXT,
PRIMARY KEY (`id`),
INDEX (`date`, `time`));

<?

$date = date("Y-m-d"); // Current date
$time = date("H:i:s"); // Current time

if (isset($_SERVER['REQUEST_METHOD'])) { // HTTP-method
$method = $_SERVER['REQUEST_METHOD'];
} else {
$method = "";
}
if (isset($_SERVER['REMOTE_ADDR'])) { // IP-adress
$ip_adress = $_SERVER['REMOTE_ADDR'];
} else {
$ip_adress = "";
}
if (isset($_SERVER['HTTP_USER_AGENT'])) { // Browser
$browser = $_SERVER['HTTP_USER_AGENT'];
} else {
$browser = "";
}
if (isset($_SERVER['PHP_SELF'])) { // Current page
$page = $_SERVER['PHP_SELF'];
} else {
$page = "";
}
if (isset($_SERVER['HTTP_REFERRER'])) { // Previous page
$referer = $_SERVER['HTTP_REFERRER'];
} else {
$referer = "";
}
?>

$sql="INSERT INTO user_log (log_date, log_time, method, page,
referer, adress, browser)VALUES('$date', '$time', '$method', '$ip_adress', '$browser', '$page' ,'$referer')";

Animated favicon

<link rel="shortcut icon" href="favicon.ico" >
<link rel="icon" href="animated_favicon1.gif" type="image/gif" >

Sending mail with mail()

<?

$email = "webmaster@yourwebsite.net"; // Recieve this by your email adress
$subject = "My Test Subject"; // Replace this by a subject
$message = "This is a test message"; // Replace this by your message
$header = "From: Webmaster@" . $_SERVER['SERVER_NAME'] . "\r\n";

if (mail($email, $subject, $message, $headers)) {
$report = "Your email has been send";
} else {
$report = "Your email could not be send";

echo "<b>$report</b>";

?>