Cara lain adalah menggunakan PHP session. Silahkan lihat sourcenya ini:
Kode HTML menyembunyikan CSS
<?php
session_start();
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
$_SESSION['kunci']="gecko.web.id";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Menyembunyikan CSS</title>
<link rel="stylesheet" type="text/css" href="styles.php" media="all" />
</head>
<body>
<h1>Hello!!!!!!</h1>
<br />
<h2>iklan nih.......</h2>
<p><a class="funny blue" href="http://gecko.web.id"><b>http://gecko.web.id </b></a></p>
</body>
</html>
Kode CSS yang disembunyikan
kemudian kode CSSnya dijadiin PHP cuman dikasih header CSS seperti ini:<?php
session_start();
header("Content-type: text/css");
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
$key=$_SESSION['kunci'];
if($key!='gecko.web.id')
{
die('<h1>Dilarang ngintip!!!</h1>cari tahu caranya di www.gecko.web.id ');
}
session_destroy();
?>
.funny {
display: inline-block;
outline: none;
text-align: center;
text-decoration: none;
font: 14px/100% Arial, Helvetica, sans-serif;
padding: .5em 2em .55em;
text-shadow: 0 1px 1px rgba(0,0,0,.3);
-webkit-border-radius: .5em;
-moz-border-radius: .5em;
border-radius: .5em;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
/* blue */
.blue {
color: #ffffff;
border: solid 1px #0076a3;
background: #0095cd;
background: -webkit-gradient(linear, left top, left bottom, from(#00adee), to(#0078a5));
background: -moz-linear-gradient(top, #00adee, #0078a5);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00adee', endColorstr='#0078a5');
}
.blue:hover {
color: #fcd3a5;
background: #007ead;
background: -webkit-gradient(linear, left top, left bottom, from(#0095cc), to(#00678e));
background: -moz-linear-gradient(top, #0095cc, #00678e);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0095cc', endColorstr='#00678e');
}
.blue:active {
color: #fcd3a5; background: -webkit-gradient(linear, left top, left bottom, from(#0078a5), to(#00adee));
background: -moz-linear-gradient(top, #0078a5, #00adee);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0078a5', endColorstr='#00adee');
}
/* post title */
h1 {
color: #8f0206;
font: normal 32px/125% 'Copse', Georgia, serif;
letter-spacing: -.03em;
margin: 30px 0 10px 0;
text-decoration: none;
display: inline;
vertical-align: top;
text-shadow: 2px 2px 2px #ccc;
}
h2 {
color: #8f0206;
font: normal 25px/125% 'Copse', Georgia, serif;
letter-spacing: -.03em;
margin: 30px 0 10px 0;
text-decoration: none;
display: inline;
vertical-align: top;
text-shadow: 2px 2px 2px #ccc;
}
sekian aja gan, semoga puas.. hehe
Jangan lupa komentar buat improvement atau ada trik lain yg lebih sederhana