Kamu bisa Menuliskan Sourcecode berikut ini..
? php
echo "Kode yang Anda masukkan tidak cocok<br /><a
href=javascript:history.go(-1)><b>Ulangi
Lagi</b></a>";
? >
< ? php
function ANTITEXTPANJANG($isi_komentar){
// Mengatasi input komentar tanpa spasi
$split_text = explode(" ",$isi_komentar);
$split_count = count($split_text);
$max = 57;
for($i = 0; $i <= $split_count; $i++){
if(strlen($split_text[$i]) >= $max){
for($j = 0; $j <= strlen($split_text[$i]); $j++){
$char[$j] = substr($split_text[$i],$j,1);
if(($j % $max == 0) && ($j != 0)){
$v_text .= $char[$j] . ' ';
}else{
$v_text .= $char[$j];
}
}
}else{
$v_text .= " " . $split_text[$i] . " ";
}
}
return $v_text;
}
?
Thursday, November 22, 2012
Membuat DIE pada PHP
Kamu Bisa mempelajari Scrip berikut ini..
? php
die("<script>location.href='index.php';</script>");
?
? php
die("<script>location.href='index.php';</script>");
?
Membuat BACA TXT pada PHP
Kamu Bisa mempelajari Scrip berikut ini..
< ? p h p
function bacatext(){
$myFile = "notepad.txt";
$FP = fopen($myFile, 'r');
while(!feof($FP)){
$line = fgets($FP);
$line = htmlspecialchars($line);
echo($line);
}
fclose($FP);
}
echo bacatext();
?>
3GP PLAYER
< ? php
echo ("<embed src='multimedia/ironman.3gp' autostart='false' width='200' height='200'></embed>");
? >
< ? p h p
function bacatext(){
$myFile = "notepad.txt";
$FP = fopen($myFile, 'r');
while(!feof($FP)){
$line = fgets($FP);
$line = htmlspecialchars($line);
echo($line);
}
fclose($FP);
}
echo bacatext();
?>
3GP PLAYER
< ? php
echo ("<embed src='multimedia/ironman.3gp' autostart='false' width='200' height='200'></embed>");
? >
Membuat VALIDASI EMPTY pada PHP
? php
$nama=trim($_POST['nama_komentar']);
$komentar=trim($_POST['isi_komentar']);
if (empty($nama)){echo "Anda belum mengisikan NAMA<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (empty($komentar)){echo "Anda belum mengisikan KOMENTAR<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (strlen($komentar) > 1000){echo "KOMENTAR Anda terlalu panjang (max 1000 char)<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
else{}
? >
CAPTCA.PHP
< ? php
session_start();
header("Content-type: image/png");
$captcha_image = imagecreatefrompng("ypathicon/captcha.png");
$captcha_font = imageloadfont("ypathicon/font.gdf");
$captcha_text = substr(md5(uniqid('')),-6,6);
$_SESSION['captcha_session'] = $captcha_text;
$captcha_color = imagecolorallocate($captcha_image,0,0,0);
imagestring($captcha_image,$captcha_font,15,5,$captcha_text,$captcha_color);
imagepng($captcha_image);
imagedestroy($captcha_image);
? >
==============================================================
< ? php
//Form komentar
$materi="berita";
$idberita="B1108001";
$iddata=$idberita;
echo "<br /><br /><b>Isi Komentar Anda :</b>
<table width='100%' style='border: 1pt dashed #0000CC;padding: 10px;'>
<form name='form' action='?' method='POST' onSubmit='return validasi(this)'>
<input type='hidden' name='iddata' value='$iddata'>
<tr><td>Nama </td><td> : <input type='text' name='nama_komentar' size='25'></td></tr>
<tr><td>Email </td><td> : <input type='text' name='email_komentar' size='50' maxlength='50'></td></tr>
<tr><td valign=top>Komentar </td><td> <textarea name='isi_komentar' style='width: 300px; height: 100px;'></textarea></td></tr>
<tr><td> </td><td> <img src='captcha.php'></td></tr>
<tr><td> </td><td> (Masukkan 6 kode diatas)<br />
<input type='text' name='kodecaptcha' size='6' maxlength='6'><br /></td></tr>
<tr><td> </td><td> <input type='submit' name='Kirim' value='Kirim'></td></tr>
</form></table><br />";
?>
< ? php
if(!empty($_POST['kodecaptcha'])){
if($_POST['kodecaptcha']==$_SESSION['captcha_session']){
$nama_komentar=trim($_POST['nama_komentar']);
$isi_komentar=trim($_POST['isi_komentar']);
$email_komentar=trim($_POST['email_komentar']);
if (empty($nama_komentar)){echo "Maaf, Anda belum mengisikan Nama Anda...<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (empty($komentar)){echo "Anda belum mengisikan Komentar Anda <br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (strlen($komentar) > 1000){echo "Maaf, KOMENTAR Anda terlalu panjang (max 1000 char)<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
else{
//SIMPAN KOMENTAR
}
}
else{
echo"<script>alert('Maaf, Kode Captcha Anda salah...Silakan cek kembali...');
document.location.href='javascript:history.go(-1)';</script>";
}
}
else{
echo"<script>alert('Silakan isi Kode Captcha Anda...Atau Silakan cek kembali...');
document.location.href='javascript:history.go(-1)';</script>";
}
?
$nama=trim($_POST['nama_komentar']);
$komentar=trim($_POST['isi_komentar']);
if (empty($nama)){echo "Anda belum mengisikan NAMA<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (empty($komentar)){echo "Anda belum mengisikan KOMENTAR<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (strlen($komentar) > 1000){echo "KOMENTAR Anda terlalu panjang (max 1000 char)<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
else{}
? >
CAPTCA.PHP
< ? php
session_start();
header("Content-type: image/png");
$captcha_image = imagecreatefrompng("ypathicon/captcha.png");
$captcha_font = imageloadfont("ypathicon/font.gdf");
$captcha_text = substr(md5(uniqid('')),-6,6);
$_SESSION['captcha_session'] = $captcha_text;
$captcha_color = imagecolorallocate($captcha_image,0,0,0);
imagestring($captcha_image,$captcha_font,15,5,$captcha_text,$captcha_color);
imagepng($captcha_image);
imagedestroy($captcha_image);
? >
==============================================================
< ? php
//Form komentar
$materi="berita";
$idberita="B1108001";
$iddata=$idberita;
echo "<br /><br /><b>Isi Komentar Anda :</b>
<table width='100%' style='border: 1pt dashed #0000CC;padding: 10px;'>
<form name='form' action='?' method='POST' onSubmit='return validasi(this)'>
<input type='hidden' name='iddata' value='$iddata'>
<tr><td>Nama </td><td> : <input type='text' name='nama_komentar' size='25'></td></tr>
<tr><td>Email </td><td> : <input type='text' name='email_komentar' size='50' maxlength='50'></td></tr>
<tr><td valign=top>Komentar </td><td> <textarea name='isi_komentar' style='width: 300px; height: 100px;'></textarea></td></tr>
<tr><td> </td><td> <img src='captcha.php'></td></tr>
<tr><td> </td><td> (Masukkan 6 kode diatas)<br />
<input type='text' name='kodecaptcha' size='6' maxlength='6'><br /></td></tr>
<tr><td> </td><td> <input type='submit' name='Kirim' value='Kirim'></td></tr>
</form></table><br />";
?>
< ? php
if(!empty($_POST['kodecaptcha'])){
if($_POST['kodecaptcha']==$_SESSION['captcha_session']){
$nama_komentar=trim($_POST['nama_komentar']);
$isi_komentar=trim($_POST['isi_komentar']);
$email_komentar=trim($_POST['email_komentar']);
if (empty($nama_komentar)){echo "Maaf, Anda belum mengisikan Nama Anda...<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (empty($komentar)){echo "Anda belum mengisikan Komentar Anda <br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (strlen($komentar) > 1000){echo "Maaf, KOMENTAR Anda terlalu panjang (max 1000 char)<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
else{
//SIMPAN KOMENTAR
}
}
else{
echo"<script>alert('Maaf, Kode Captcha Anda salah...Silakan cek kembali...');
document.location.href='javascript:history.go(-1)';</script>";
}
}
else{
echo"<script>alert('Silakan isi Kode Captcha Anda...Atau Silakan cek kembali...');
document.location.href='javascript:history.go(-1)';</script>";
}
?
Membuat BACK JAVASCIPT pada PHP
? php
echo "Kode yang Anda masukkan tidak cocok<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b></a>";
? >
< ? php
function ANTITEXTPANJANG($isi_komentar){
// Mengatasi input komentar tanpa spasi
$split_text = explode(" ",$isi_komentar);
$split_count = count($split_text);
$max = 57;
for($i = 0; $i <= $split_count; $i++){
if(strlen($split_text[$i]) >= $max){
for($j = 0; $j <= strlen($split_text[$i]); $j++){
$char[$j] = substr($split_text[$i],$j,1);
if(($j % $max == 0) && ($j != 0)){
$v_text .= $char[$j] . ' ';
}else{
$v_text .= $char[$j];
}
}
}else{
$v_text .= " " . $split_text[$i] . " ";
}
}
return $v_text;
}
?
echo "Kode yang Anda masukkan tidak cocok<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b></a>";
? >
< ? php
function ANTITEXTPANJANG($isi_komentar){
// Mengatasi input komentar tanpa spasi
$split_text = explode(" ",$isi_komentar);
$split_count = count($split_text);
$max = 57;
for($i = 0; $i <= $split_count; $i++){
if(strlen($split_text[$i]) >= $max){
for($j = 0; $j <= strlen($split_text[$i]); $j++){
$char[$j] = substr($split_text[$i],$j,1);
if(($j % $max == 0) && ($j != 0)){
$v_text .= $char[$j] . ' ';
}else{
$v_text .= $char[$j];
}
}
}else{
$v_text .= " " . $split_text[$i] . " ";
}
}
return $v_text;
}
?
Membuat ENKRIPSI KATA UBAH_TEKS pada PHP
ENKRIPSI KATA UBAH_TEKS:
< ? php
function ubah_teks($teks){
$teks = strrev($teks);
$st = "";
for ($i=0; $i < strlen($teks); $i++){
$ascii = ord(substr($teks, $i, 1));
$hex = dechex($ascii);
if (strlen($hex) == 1)
$hex = "0" . $hex;
$st = $st . $hex;
}
return $st;
}
function balik_teks($teks){
$st = "";
for ($i=0; $i < strlen($teks) / 2; $i++){
$dua_angka = substr($teks, 2 * $i, 2);
$des = hexdec($dua_angka);
$kar = chr($des);
$st = $st . $kar;
}
$st = strrev($st);
return $st;
}
? >
< ? php
function THUMB($fupload_name,$direktori){
// File gambar yang di upload
$file_upload = $direktori . $fupload_name;
// Simpan gambar dalam ukuran sebenarnya
$nama_gbr_asli = $_FILES['fupload']['tmp_name'];
move_uploaded_file($nama_gbr_asli, $file_upload);
// Dapatkan identitas file asli dari file jpg yang di upload
$gbr_asli = imagecreatefromjpeg($file_upload);
$lebar = imageSX($gbr_asli);
$tinggi = imageSY($gbr_asli);
// Simpan dalam versi yang diinginkan 200 pixel (thumbnailnya)
$thu_lebar = 200;
$thu_tinggi = ($thu_lebar/$lebar)*$tinggi;
// Fungsi untuk mengubah ukuran gambar (resample)
$gbr_thumb = imagecreatetruecolor($thu_lebar,$thu_tinggi);
imagecopyresampled($gbr_thumb, $gbr_asli, 0, 0, 0, 0, $thu_lebar, $thu_tinggi, $lebar, $tinggi);
// Simpan gambar yang versi thumbnailnya
imagejpeg($gbr_thumb,$direktori . "kecil_" . $fupload_name);
// Hapus gambar yang ada di memori
imagedestroy($gbr_asli);
imagedestroy($gbr_thumb);
}
?
Membuat MARQUEE GAMBAR LEFT pada PHP
<script language="JavaScript">
function bukajendela(url) {
window.open(url, "window_baru", "width=800,height=600,left=320,top=100,resizable=1,scrollbars=1");
}
</script>
<marquee onmouseover=this.stop() onmouseout=this.start() scrollamount=2 scrolldelay=90 direction=left width=100% height=150>
< ? php
$s = mysql_query("SELECT * FROM `galeri`");
while ($w = mysql_fetch_array($s)) {
$idgaleri=$w["id-galeri"];
echo "
<a href='#' onclick=\"bukajendela('zoom.php?id=$idgaleri')\">
<img src='img_galeri/kecil_$w[gbr_gallery]' border=0>
</a> ";
}
? >
</marquee>
function bukajendela(url) {
window.open(url, "window_baru", "width=800,height=600,left=320,top=100,resizable=1,scrollbars=1");
}
</script>
<marquee onmouseover=this.stop() onmouseout=this.start() scrollamount=2 scrolldelay=90 direction=left width=100% height=150>
< ? php
$s = mysql_query("SELECT * FROM `galeri`");
while ($w = mysql_fetch_array($s)) {
$idgaleri=$w["id-galeri"];
echo "
<a href='#' onclick=\"bukajendela('zoom.php?id=$idgaleri')\">
<img src='img_galeri/kecil_$w[gbr_gallery]' border=0>
</a> ";
}
? >
</marquee>
Membuat KALENDER TABEL Pada PHP
? php
$month= date ("m");
$year=date("Y");
$day=date("d");
$endDate=date("t",mktime(0,0,0,$month,$day,$year));
echo '<font face="arial" size="2">';
echo '<table align="center" border="0" cellpadding=5 cellspacing=5 style=""><tr><td align=center>';
echo "Hari ini tanggal : ".date("d F Y ",mktime(0,0,0,$month,$day,$year));
echo '</td></tr></table>';
echo '<table align="center" border="0" cellpadding=1 cellspacing=1 style="border:1px solid #CCCCCC">
<tr bgcolor="#EFEFEF">
<td align=center><font color=red>Minggu</font></td>
<td align=center>Senin</td>
<td align=center>Selasa</td>
<td align=center>Rabu</td>
<td align=center>Kamis</td>
<td align=center>Jumat</td>
<td align=center>Sabtu</td>
</tr>';
$s=date ("w", mktime (0,0,0,$month,1,$year));
for ($ds=1;$ds<=$s;$ds++) {
echo "<td style=\"font-family:arial;color:#B3D9FF\" align=center valign=middle bgcolor=\"#FFFFFF\"></td>";
}
for ($d=1;$d<=$endDate;$d++) {
if (date("w",mktime (0,0,0,$month,$d,$year)) == 0) { echo "<tr>"; }
$fontColor="#000000";
if (date("D",mktime (0,0,0,$month,$d,$year)) == "Sun") { $fontColor="red"; }
echo "<td style=\"font-family:arial;color:#333333\" align=center valign=middle> <span style=\"color:$fontColor\">$d</span></td>";
if (date("w",mktime (0,0,0,$month,$d,$year)) == 6) { echo "</tr>"; }}
echo '</table>';
?
$month= date ("m");
$year=date("Y");
$day=date("d");
$endDate=date("t",mktime(0,0,0,$month,$day,$year));
echo '<font face="arial" size="2">';
echo '<table align="center" border="0" cellpadding=5 cellspacing=5 style=""><tr><td align=center>';
echo "Hari ini tanggal : ".date("d F Y ",mktime(0,0,0,$month,$day,$year));
echo '</td></tr></table>';
echo '<table align="center" border="0" cellpadding=1 cellspacing=1 style="border:1px solid #CCCCCC">
<tr bgcolor="#EFEFEF">
<td align=center><font color=red>Minggu</font></td>
<td align=center>Senin</td>
<td align=center>Selasa</td>
<td align=center>Rabu</td>
<td align=center>Kamis</td>
<td align=center>Jumat</td>
<td align=center>Sabtu</td>
</tr>';
$s=date ("w", mktime (0,0,0,$month,1,$year));
for ($ds=1;$ds<=$s;$ds++) {
echo "<td style=\"font-family:arial;color:#B3D9FF\" align=center valign=middle bgcolor=\"#FFFFFF\"></td>";
}
for ($d=1;$d<=$endDate;$d++) {
if (date("w",mktime (0,0,0,$month,$d,$year)) == 0) { echo "<tr>"; }
$fontColor="#000000";
if (date("D",mktime (0,0,0,$month,$d,$year)) == "Sun") { $fontColor="red"; }
echo "<td style=\"font-family:arial;color:#333333\" align=center valign=middle> <span style=\"color:$fontColor\">$d</span></td>";
if (date("w",mktime (0,0,0,$month,$d,$year)) == 6) { echo "</tr>"; }}
echo '</table>';
?
Membuat RANDOM GAMBAR : 1.jpg,2.jpg dst 160.jpg pada PHP
? php
echo '<font face="Verdana, Arial, Helvetica, sans-serif" size="2">';
$file_type = ".jpg";
$folder_gambar = "images";
$nilai_pertama = "1";
$jumlah_gambar = "160";
$acak = mt_rand($nilai_pertama, $jumlah_gambar);
$image_name = $acak . $file_type;
echo ("<div align='center'>
<b>Gambar ditampilkan secara acak</b><br><br>
<a href='http://lp2maray.co.id/gbshow.php?id=$acak'>
<img src='$folder_gambar/$image_name' border='0' title='Buku-buku LP2M ARAY' />
</div>");
?
echo '<font face="Verdana, Arial, Helvetica, sans-serif" size="2">';
$file_type = ".jpg";
$folder_gambar = "images";
$nilai_pertama = "1";
$jumlah_gambar = "160";
$acak = mt_rand($nilai_pertama, $jumlah_gambar);
$image_name = $acak . $file_type;
echo ("<div align='center'>
<b>Gambar ditampilkan secara acak</b><br><br>
<a href='http://lp2maray.co.id/gbshow.php?id=$acak'>
<img src='$folder_gambar/$image_name' border='0' title='Buku-buku LP2M ARAY' />
</div>");
?
Membuat YAHOO MESSENGER Pada PHP
? php
echo '<font face="Verdana, Arial, Helvetica, sans-serif" size="2">';
$daftar_idyahoo="rini_dyah,riadi_m";
$proses=explode(",",$daftar_idyahoo);
reset($proses);
foreach ($proses as $tujuan) {
echo ("$tujuan<br>
<a href='http://messenger.yahoo.com/edit/send/?.target=$tujuan'>
<img border=0 src='http://opi.yahoo.com/online?u=$tujuan&m=g&t=2&l=us'></a><br>"
);
}
?
echo '<font face="Verdana, Arial, Helvetica, sans-serif" size="2">';
$daftar_idyahoo="rini_dyah,riadi_m";
$proses=explode(",",$daftar_idyahoo);
reset($proses);
foreach ($proses as $tujuan) {
echo ("$tujuan<br>
<a href='http://messenger.yahoo.com/edit/send/?.target=$tujuan'>
<img border=0 src='http://opi.yahoo.com/online?u=$tujuan&m=g&t=2&l=us'></a><br>"
);
}
?
Wednesday, November 21, 2012
Membuat PEMBACAAN IP pada PHP
? php
echo '<font face="verdana" size="2">';
$useragent = $_SERVER ['HTTP_USER_AGENT'];
echo ("<b>Deteksi Browser</b><br>Browser yang Anda gunakan sekarang adalah :<br> $useragent");
? >
< ? php
if ($HTTP_X_FORWARDED_FOR){
echo "<b>INFO :</b> Proxy yang Anda gunakan...<br>";
echo "Terhubung melalui : " . $HTTP_VIA . " - " . $REMOTE_ADDR;
$ip=$HTTP_X_FORWARDED_FOR;
echo "<br>IP Anda adalah : <b>$ip</b>";
}
else{
echo "Anda tidak menggunakan proxy<br>";
$host = gethostbyaddr($REMOTE_ADDR);
$ip2=$REMOTE_ADDR;
echo "IP Anda adalah : <b>$ip2</b>" ;
echo " ($host)";
}
? >
< ? php
function BACA_TEXT(){
$myFile = "./isi.txt";
$FP = fopen('isi.txt', 'r');
while(!feof($FP)){$line = fgets($FP);$line = htmlspecialchars($line);echo($line);}
fclose($FP);
}
echo baca();
?
echo '<font face="verdana" size="2">';
$useragent = $_SERVER ['HTTP_USER_AGENT'];
echo ("<b>Deteksi Browser</b><br>Browser yang Anda gunakan sekarang adalah :<br> $useragent");
? >
< ? php
if ($HTTP_X_FORWARDED_FOR){
echo "<b>INFO :</b> Proxy yang Anda gunakan...<br>";
echo "Terhubung melalui : " . $HTTP_VIA . " - " . $REMOTE_ADDR;
$ip=$HTTP_X_FORWARDED_FOR;
echo "<br>IP Anda adalah : <b>$ip</b>";
}
else{
echo "Anda tidak menggunakan proxy<br>";
$host = gethostbyaddr($REMOTE_ADDR);
$ip2=$REMOTE_ADDR;
echo "IP Anda adalah : <b>$ip2</b>" ;
echo " ($host)";
}
? >
< ? php
function BACA_TEXT(){
$myFile = "./isi.txt";
$FP = fopen('isi.txt', 'r');
while(!feof($FP)){$line = fgets($FP);$line = htmlspecialchars($line);echo($line);}
fclose($FP);
}
echo baca();
?
Membuat SEARCHING GOOGLE. pada PHP
SEARCHING GOOGLE
<form method="get" action="http://www.google.com/search">
<INPUT TYPE='text' name='q' size=31 maxlength=255 value=''>
<INPUT TYPE='hidden' name='hl' value='lacak'>
<INPUT type='submit' name='cari' VALUE='Proses Pencarian'></p>
</FORM>
COUNTER TXT
<div id="Layer1">
Terimakasih, Anda adalah pengunjung ke : <b><? echo counter()." </b>Kami";?></b>
<?php
function counter(){
if (isset($visitor)){
if ($visitor=="visited")
include("counter.txt");
}
else {
$file=fopen("counter.txt","r+");
$nilai=fread($file,filesize("counter.txt"));
fclose($file);
$nilai += 1;
$file=fopen("counter.txt","w+");
fputs($file,$nilai);
fclose($file);
include("counter.txt");
}
}
?>
</div>
isi counter.txt=235
<form method="get" action="http://www.google.com/search">
<INPUT TYPE='text' name='q' size=31 maxlength=255 value=''>
<INPUT TYPE='hidden' name='hl' value='lacak'>
<INPUT type='submit' name='cari' VALUE='Proses Pencarian'></p>
</FORM>
COUNTER TXT
<div id="Layer1">
Terimakasih, Anda adalah pengunjung ke : <b><? echo counter()." </b>Kami";?></b>
<?php
function counter(){
if (isset($visitor)){
if ($visitor=="visited")
include("counter.txt");
}
else {
$file=fopen("counter.txt","r+");
$nilai=fread($file,filesize("counter.txt"));
fclose($file);
$nilai += 1;
$file=fopen("counter.txt","w+");
fputs($file,$nilai);
fclose($file);
include("counter.txt");
}
}
?>
</div>
isi counter.txt=235
Membuat PENGIRIMAN EMAIL. pada PHP
?
echo '<font face="Verdana, Arial, Helvetica, sans-serif" size="2">';
$kirim=mail($email_tujuan,$judul_pesan,$isi_pesan, "From: ".$email_anda."\nContent-Type: text/html; charset=iso-8859-1");
if ($kirim){
$isi_pesan = str_replace("\n","<br>", $isi_pesan);
echo("Email telah dikirim ke <b>$email_tujuan</b><br><br>");
echo("<b>Isi pesan :</b><br>$isi_pesan");
}else{
echo ("Email tidak dapat dikirim");
}
?
echo '<font face="Verdana, Arial, Helvetica, sans-serif" size="2">';
$kirim=mail($email_tujuan,$judul_pesan,$isi_pesan, "From: ".$email_anda."\nContent-Type: text/html; charset=iso-8859-1");
if ($kirim){
$isi_pesan = str_replace("\n","<br>", $isi_pesan);
echo("Email telah dikirim ke <b>$email_tujuan</b><br><br>");
echo("<b>Isi pesan :</b><br>$isi_pesan");
}else{
echo ("Email tidak dapat dikirim");
}
?
Membuat NAMA UPLOAD FIL. pada PHP
? php
if ($_FILES[file] != "") {
@copy($_FILES[file][tmp_name],"imagesku/".$_FILES[file][name]) or die("Proses upload Gagal");
} else {
die("Tidak ada file yang akan diupload");
}
?
<b>Anda telah berhasil melakukan upload file :</b><br>
<? echo "Nama File : " .$_FILES[file][name]; ?><br>
<? echo "Ukuran File : " .round($_FILES[file][size]/1024);?> kb<br>
<? echo "Jenis File : " .$_FILES[file][type]; ?><br>
if ($_FILES[file] != "") {
@copy($_FILES[file][tmp_name],"imagesku/".$_FILES[file][name]) or die("Proses upload Gagal");
} else {
die("Tidak ada file yang akan diupload");
}
?
<b>Anda telah berhasil melakukan upload file :</b><br>
<? echo "Nama File : " .$_FILES[file][name]; ?><br>
<? echo "Ukuran File : " .round($_FILES[file][size]/1024);?> kb<br>
<? echo "Jenis File : " .$_FILES[file][type]; ?><br>
Membuat MENGUPLOAD. pada PHP
? php
echo "<b>Silahkan Anda Upload File di sini</b><br /><br />";
echo ("
<form enctype='multipart/form-data' action='' method='POST'>
<input name='file' type='file' />
<input type='submit' value='Upload' />
</form>
");
?
echo "<b>Silahkan Anda Upload File di sini</b><br /><br />";
echo ("
<form enctype='multipart/form-data' action='' method='POST'>
<input name='file' type='file' />
<input type='submit' value='Upload' />
</form>
");
?
Membuat ANTI INJECTION. pada PHP
?
function anti_injection($data){
$filter = mysql_real_escape_string(stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES))));
return $filter;
}
?
function anti_injection($data){
$filter = mysql_real_escape_string(stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES))));
return $filter;
}
?
Membuat SQL-SEO. pada PHP
? php
function seo_title($s) {
$c = array (' ');
$d = array ('-','/','\\',',','.','#',':',';','\'','"','[',']','{','}',')','(','|','`','~','!','@','%','$','^','&','*','=','?','+');
$s = str_replace($d, '', $s); // Hilangkan karakter yang telah disebutkan di array $d
$s = strtolower(str_replace($c, '-', $s)); // Ganti spasi dengan tanda - dan ubah hurufnya menjadi kecil semua
return $s;
}
?
function seo_title($s) {
$c = array (' ');
$d = array ('-','/','\\',',','.','#',':',';','\'','"','[',']','{','}',')','(','|','`','~','!','@','%','$','^','&','*','=','?','+');
$s = str_replace($d, '', $s); // Hilangkan karakter yang telah disebutkan di array $d
$s = strtolower(str_replace($c, '-', $s)); // Ganti spasi dengan tanda - dan ubah hurufnya menjadi kecil semua
return $s;
}
?
Membuat AUTO-LINK . pada PHP
? php
function autolink ($str){
$str = eregi_replace("([[:space:]])((f|ht)tps?:\/\/[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $str); //http
$str = eregi_replace("([[:space:]])(www\.[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $str); // www.
$str = eregi_replace("([[:space:]])([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})","\\1<a href=\"mailto:\\2\">\\2</a>", $str); // mail
$str = eregi_replace("^((f|ht)tp:\/\/[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "<a href=\"\\1\" target=\"_blank\">\\1</a>", $str); //http
$str = eregi_replace("^(www\.[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "<a href=\"http://\\1\" target=\"_blank\">\\1</a>", $str); // www.
$str = eregi_replace("^([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})","<a href=\"mailto:\\1\">\\1</a>", $str); // mail
return $str;
}
?
function autolink ($str){
$str = eregi_replace("([[:space:]])((f|ht)tps?:\/\/[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $str); //http
$str = eregi_replace("([[:space:]])(www\.[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $str); // www.
$str = eregi_replace("([[:space:]])([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})","\\1<a href=\"mailto:\\2\">\\2</a>", $str); // mail
$str = eregi_replace("^((f|ht)tp:\/\/[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "<a href=\"\\1\" target=\"_blank\">\\1</a>", $str); //http
$str = eregi_replace("^(www\.[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "<a href=\"http://\\1\" target=\"_blank\">\\1</a>", $str); // www.
$str = eregi_replace("^([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})","<a href=\"mailto:\\1\">\\1</a>", $str); // mail
return $str;
}
?
Membuat kata-kata Tidak Sopan/Kata-Kata Jelek (Sensor ) . pada PHP
? php
function sensor($teks){
$w = mysql_query("SELECT * FROM katajelek");
while ($r = mysql_fetch_array($w)){
$teks = str_replace($r['kata'], $r['ganti'], $teks);
}
return $teks;
}
?
function sensor($teks){
$w = mysql_query("SELECT * FROM katajelek");
while ($r = mysql_fetch_array($w)){
$teks = str_replace($r['kata'], $r['ganti'], $teks);
}
return $teks;
}
?
Membuat TANGGAL INDONESIA. pada PHP
? php
function tgl_indo($tgl){
$tanggal = substr($tgl,8,2);
$bulan = getBulan(substr($tgl,5,2));
$tahun = substr($tgl,0,4);
return $tanggal.' '.$bulan.' '.$tahun;
}
function getBulan($bln){
switch ($bln){
case 1:
return "Januari";
break;
case 2:
return "Februari";
break;
case 3:
return "Maret";
break;
case 4:
return "April";
break;
case 5:
return "Mei";
break;
case 6:
return "Juni";
break;
case 7:
return "Juli";
break;
case 8:
return "Agustus";
break;
case 9:
return "September";
break;
case 10:
return "Oktober";
break;
case 11:
return "November";
break;
case 12:
return "Desember";
break;
}
}
?
function tgl_indo($tgl){
$tanggal = substr($tgl,8,2);
$bulan = getBulan(substr($tgl,5,2));
$tahun = substr($tgl,0,4);
return $tanggal.' '.$bulan.' '.$tahun;
}
function getBulan($bln){
switch ($bln){
case 1:
return "Januari";
break;
case 2:
return "Februari";
break;
case 3:
return "Maret";
break;
case 4:
return "April";
break;
case 5:
return "Mei";
break;
case 6:
return "Juni";
break;
case 7:
return "Juli";
break;
case 8:
return "Agustus";
break;
case 9:
return "September";
break;
case 10:
return "Oktober";
break;
case 11:
return "November";
break;
case 12:
return "Desember";
break;
}
}
?
Membuat KALENDER pada PHP
? php
function buatkalender($tanggal,$bulan,$tahun) {
$bulanan=array(1=>"Januari","Februari","Maret","April",
"Mei","Juni","Juli","Agustus","September",
"Oktober","November","Desember");
$bln=date("n");
$thn=date("Y");
$jmlhari = date("t",mktime(0,0,0,$bulan,1,$tahun));
$haritglsatu = date("w",mktime(0,0,0,$bulan,1,$tahun));
$kalender = "<table cellspacing=1 cellpadding=4
border=0 class=tabel_data>\n";
$kalender .= "<tr class=tr_terang>
<td colspan=7>$bulanan[$bln], $thn
</td></tr>\n";
$kalender .= "<tr class=tr_judul>
<td>M</td><td>S</td><td>S</td><td>R</td>
<td>K</td><td>J</td><td>S</td></tr>\n";
$a = 1;
$adabaris = TRUE;
$mulaicetak = 0;
while ($adabaris) {
$kalender .= "<tr align=center class=tr_terang>";
for ($i = 0; $i < 7; $i++ ) {
if ($mulaicetak < $haritglsatu) {
$kalender .= "<td> </td>";
$mulaicetak++;
}
elseif ($a <= $jmlhari) {
$tt = $a;
if ($a == $tanggal) {
$tt = "<span style='color: blue; font-weight: bold;
font-size: larger; text-decoration: blink;'>
$tt</span>";
}
if ($i == 0) {
$tt = "<font color=\"#FF0000\">$tt</font>";
}
$kalender .= "<td>$tt</td>";
$a++;
}
else {
$kalender .= "<td> </td>";
}
}
$kalender .= "</tr>\n";
if ($a <= $jmlhari) {
$adabaris = TRUE;
}
else {
$adabaris = FALSE;
}
}
$kalender .= "</table>\n";
return $kalender;
}
function buatkalender($tanggal,$bulan,$tahun) {
$bulanan=array(1=>"Januari","Februari","Maret","April",
"Mei","Juni","Juli","Agustus","September",
"Oktober","November","Desember");
$bln=date("n");
$thn=date("Y");
$jmlhari = date("t",mktime(0,0,0,$bulan,1,$tahun));
$haritglsatu = date("w",mktime(0,0,0,$bulan,1,$tahun));
$kalender = "<table cellspacing=1 cellpadding=4
border=0 class=tabel_data>\n";
$kalender .= "<tr class=tr_terang>
<td colspan=7>$bulanan[$bln], $thn
</td></tr>\n";
$kalender .= "<tr class=tr_judul>
<td>M</td><td>S</td><td>S</td><td>R</td>
<td>K</td><td>J</td><td>S</td></tr>\n";
$a = 1;
$adabaris = TRUE;
$mulaicetak = 0;
while ($adabaris) {
$kalender .= "<tr align=center class=tr_terang>";
for ($i = 0; $i < 7; $i++ ) {
if ($mulaicetak < $haritglsatu) {
$kalender .= "<td> </td>";
$mulaicetak++;
}
elseif ($a <= $jmlhari) {
$tt = $a;
if ($a == $tanggal) {
$tt = "<span style='color: blue; font-weight: bold;
font-size: larger; text-decoration: blink;'>
$tt</span>";
}
if ($i == 0) {
$tt = "<font color=\"#FF0000\">$tt</font>";
}
$kalender .= "<td>$tt</td>";
$a++;
}
else {
$kalender .= "<td> </td>";
}
}
$kalender .= "</tr>\n";
if ($a <= $jmlhari) {
$adabaris = TRUE;
}
else {
$adabaris = FALSE;
}
}
$kalender .= "</table>\n";
return $kalender;
}
Membuat LIBRARY pada PHP
? php
date_default_timezone_set('Asia/Jakarta'); // PHP 6 mengharuskan penyebutan timezone.
$seminggu = array("Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu");
$hari = date("w");
$hari_ini = $seminggu[$hari];
$tgl_sekarang = date("Ymd");
$tgl_skrg = date("d");
$bln_sekarang = date("m");
$thn_sekarang = date("Y");
$jam_sekarang = date("H:i:s");
$nama_bln=array(1=> "Januari", "Februari", "Maret", "April", "Mei",
"Juni", "Juli", "Agustus", "September",
"Oktober", "November", "Desember");
? >
==============================================================
BUAT-KALENDER
< ? php
function buatkalender($tanggal,$bulan,$tahun) {
$bulanan=array(1=>"Januari","Februari","Maret","April",
"Mei","Juni","Juli","Agustus","September",
"Oktober","November","Desember");
$bln=date("n");
$thn=date("Y");
$jmlhari = date("t",mktime(0,0,0,$bulan,1,$tahun));
$haritglsatu = date("w",mktime(0,0,0,$bulan,1,$tahun));
$kalender = "<table cellspacing=1 cellpadding=4
border=0 class=tabel_data>\n";
$kalender .= "<tr class=tr_terang>
<td colspan=7>$bulanan[$bln], $thn
</td></tr>\n";
$kalender .= "<tr class=tr_judul>
<td>M</td><td>S</td><td>S</td><td>R</td>
<td>K</td><td>J</td><td>S</td></tr>\n";
$a = 1;
$adabaris = TRUE;
$mulaicetak = 0;
while ($adabaris) {
$kalender .= "<tr align=center class=tr_terang>";
for ($i = 0; $i < 7; $i++ ) {
if ($mulaicetak < $haritglsatu) {
$kalender .= "<td> </td>";
$mulaicetak++;
}
elseif ($a <= $jmlhari) {
$tt = $a;
if ($a == $tanggal) {
$tt = "<span style='color: blue; font-weight: bold;
font-size: larger; text-decoration: blink;'>
$tt</span>";
}
if ($i == 0) {
$tt = "<font color=\"#FF0000\">$tt</font>";
}
$kalender .= "<td>$tt</td>";
$a++;
}
else {
$kalender .= "<td> </td>";
}
}
$kalender .= "</tr>\n";
if ($a <= $jmlhari) {
$adabaris = TRUE;
}
else {
$adabaris = FALSE;
}
}
$kalender .= "</table>\n";
return $kalender;
}
date_default_timezone_set('Asia/Jakarta'); // PHP 6 mengharuskan penyebutan timezone.
$seminggu = array("Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu");
$hari = date("w");
$hari_ini = $seminggu[$hari];
$tgl_sekarang = date("Ymd");
$tgl_skrg = date("d");
$bln_sekarang = date("m");
$thn_sekarang = date("Y");
$jam_sekarang = date("H:i:s");
$nama_bln=array(1=> "Januari", "Februari", "Maret", "April", "Mei",
"Juni", "Juli", "Agustus", "September",
"Oktober", "November", "Desember");
? >
==============================================================
BUAT-KALENDER
< ? php
function buatkalender($tanggal,$bulan,$tahun) {
$bulanan=array(1=>"Januari","Februari","Maret","April",
"Mei","Juni","Juli","Agustus","September",
"Oktober","November","Desember");
$bln=date("n");
$thn=date("Y");
$jmlhari = date("t",mktime(0,0,0,$bulan,1,$tahun));
$haritglsatu = date("w",mktime(0,0,0,$bulan,1,$tahun));
$kalender = "<table cellspacing=1 cellpadding=4
border=0 class=tabel_data>\n";
$kalender .= "<tr class=tr_terang>
<td colspan=7>$bulanan[$bln], $thn
</td></tr>\n";
$kalender .= "<tr class=tr_judul>
<td>M</td><td>S</td><td>S</td><td>R</td>
<td>K</td><td>J</td><td>S</td></tr>\n";
$a = 1;
$adabaris = TRUE;
$mulaicetak = 0;
while ($adabaris) {
$kalender .= "<tr align=center class=tr_terang>";
for ($i = 0; $i < 7; $i++ ) {
if ($mulaicetak < $haritglsatu) {
$kalender .= "<td> </td>";
$mulaicetak++;
}
elseif ($a <= $jmlhari) {
$tt = $a;
if ($a == $tanggal) {
$tt = "<span style='color: blue; font-weight: bold;
font-size: larger; text-decoration: blink;'>
$tt</span>";
}
if ($i == 0) {
$tt = "<font color=\"#FF0000\">$tt</font>";
}
$kalender .= "<td>$tt</td>";
$a++;
}
else {
$kalender .= "<td> </td>";
}
}
$kalender .= "</tr>\n";
if ($a <= $jmlhari) {
$adabaris = TRUE;
}
else {
$adabaris = FALSE;
}
}
$kalender .= "</table>\n";
return $kalender;
}
Membuat TITTLE BERJALAN pada PHP
<script type='text/javascript'>
var thumbnail_mode = "float" ;
summary_noimg = 730;
summary_img = 640;
img_thumb_height = 200;
img_thumb_width = 250;
</script>
<script src='http://blogergadgets.googlecode.com/files/excerpt.js' type='text/javascript'></script>
<script type="text/javascript">(function(){var a;var b=navigator.userAgent;a=-1!=b.indexOf("Mobile")&&-1!=b.indexOf("WebKit")&&-1==b.indexOf("iPad")||-1!=b.indexOf("Opera Mini")?!0:!1;if(a){var c;a:{var d=window.location.href,e=d.split("?");switch(e.length){case 1:c=d+"?m=1";break a;case 2:c=0<=e[1].search("(^|&)m=")?null:d+"&m=1";break a;default:c=null}}c&&window.location.replace(c)};})();
</script><script type="text/javascript">
if (window.jstiming) window.jstiming.load.tick('headEnd');
</script></head>
<script type='text/javascript'>
//<![CDATA[
msg = " --- Galieh Inside ";
msg = " | Its The Best Place to Share | Felani Galieh Prabawa | G & R | Rina Andriani --- " + msg;pos = 0;
function scrollMSG() {
document.title = msg.substring(pos, msg.length) + msg.substring(0, pos); pos++;
if (pos > msg.length) pos = 0
window.setTimeout("scrollMSG()",100);
}
scrollMSG();
//]]>
< /script >
var thumbnail_mode = "float" ;
summary_noimg = 730;
summary_img = 640;
img_thumb_height = 200;
img_thumb_width = 250;
</script>
<script src='http://blogergadgets.googlecode.com/files/excerpt.js' type='text/javascript'></script>
<script type="text/javascript">(function(){var a;var b=navigator.userAgent;a=-1!=b.indexOf("Mobile")&&-1!=b.indexOf("WebKit")&&-1==b.indexOf("iPad")||-1!=b.indexOf("Opera Mini")?!0:!1;if(a){var c;a:{var d=window.location.href,e=d.split("?");switch(e.length){case 1:c=d+"?m=1";break a;case 2:c=0<=e[1].search("(^|&)m=")?null:d+"&m=1";break a;default:c=null}}c&&window.location.replace(c)};})();
</script><script type="text/javascript">
if (window.jstiming) window.jstiming.load.tick('headEnd');
</script></head>
<script type='text/javascript'>
//<![CDATA[
msg = " --- Galieh Inside ";
msg = " | Its The Best Place to Share | Felani Galieh Prabawa | G & R | Rina Andriani --- " + msg;pos = 0;
function scrollMSG() {
document.title = msg.substring(pos, msg.length) + msg.substring(0, pos); pos++;
if (pos > msg.length) pos = 0
window.setTimeout("scrollMSG()",100);
}
scrollMSG();
//]]>
< /script >
Membuat IF NOT .JPG pada PHP
$lokasi_file = $_FILES['fupload']['tmp_name'];
$tipe_file = $_FILES['fupload']['type'];
$nama_file = $_FILES['fupload']['name'];
$acak = rand(1,99);
$nama_file_unik = $acak.$nama_file;
if (!empty($_POST['tag_seo'])){
$tag_seo = $_POST['tag_seo'];
$tag=implode(',',$tag_seo);
}
$judul_seo = seo_title($_POST['judul']);
// Apabila ada gambar yang diupload
if (!empty($lokasi_file)){
if ($tipe_file != "image/jpeg" AND $tipe_file != "image/pjpeg"){
echo "<script>window.alert('Upload Gagal, Pastikan File yang di Upload bertipe *.JPG');
window.location=('../../media.php?module=berita)</script>";
}
else{
UploadImage($nama_file_unik);
}
?>
<?php
// Upload gambar untuk berita
function UploadImage($fupload_name){
//direktori gambar
$vdir_upload = "../../../foto_berita/";
$vfile_upload = $vdir_upload . $fupload_name;
//Simpan gambar dalam ukuran sebenarnya
move_uploaded_file($_FILES["fupload"]["tmp_name"], $vfile_upload);
//identitas file asli
$im_src = imagecreatefromjpeg($vfile_upload);
$src_width = imageSX($im_src);
$src_height = imageSY($im_src);
//Simpan dalam versi small 110 pixel
//Set ukuran gambar hasil perubahan
$dst_width = 110;
$dst_height = ($dst_width/$src_width)*$src_height;
//proses perubahan ukuran
$im = imagecreatetruecolor($dst_width,$dst_height);
imagecopyresampled($im, $im_src, 0, 0, 0, 0, $dst_width, $dst_height, $src_width, $src_height);
//Simpan gambar
imagejpeg($im,$vdir_upload . "small_" . $fupload_name);
//Simpan dalam versi medium 360 pixel
//Set ukuran gambar hasil perubahan
$dst_width2 = 390;
$dst_height2 = ($dst_width2/$src_width)*$src_height;
//proses perubahan ukuran
$im2 = imagecreatetruecolor($dst_width2,$dst_height2);
imagecopyresampled($im2, $im_src, 0, 0, 0, 0, $dst_width2, $dst_height2, $src_width, $src_height);
//Simpan gambar
imagejpeg($im2,$vdir_upload . "medium_" . $fupload_name);
//Hapus gambar di memori komputer
imagedestroy($im_src);
imagedestroy($im);
imagedestroy($im2);
}
$tipe_file = $_FILES['fupload']['type'];
$nama_file = $_FILES['fupload']['name'];
$acak = rand(1,99);
$nama_file_unik = $acak.$nama_file;
if (!empty($_POST['tag_seo'])){
$tag_seo = $_POST['tag_seo'];
$tag=implode(',',$tag_seo);
}
$judul_seo = seo_title($_POST['judul']);
// Apabila ada gambar yang diupload
if (!empty($lokasi_file)){
if ($tipe_file != "image/jpeg" AND $tipe_file != "image/pjpeg"){
echo "<script>window.alert('Upload Gagal, Pastikan File yang di Upload bertipe *.JPG');
window.location=('../../media.php?module=berita)</script>";
}
else{
UploadImage($nama_file_unik);
}
?>
<?php
// Upload gambar untuk berita
function UploadImage($fupload_name){
//direktori gambar
$vdir_upload = "../../../foto_berita/";
$vfile_upload = $vdir_upload . $fupload_name;
//Simpan gambar dalam ukuran sebenarnya
move_uploaded_file($_FILES["fupload"]["tmp_name"], $vfile_upload);
//identitas file asli
$im_src = imagecreatefromjpeg($vfile_upload);
$src_width = imageSX($im_src);
$src_height = imageSY($im_src);
//Simpan dalam versi small 110 pixel
//Set ukuran gambar hasil perubahan
$dst_width = 110;
$dst_height = ($dst_width/$src_width)*$src_height;
//proses perubahan ukuran
$im = imagecreatetruecolor($dst_width,$dst_height);
imagecopyresampled($im, $im_src, 0, 0, 0, 0, $dst_width, $dst_height, $src_width, $src_height);
//Simpan gambar
imagejpeg($im,$vdir_upload . "small_" . $fupload_name);
//Simpan dalam versi medium 360 pixel
//Set ukuran gambar hasil perubahan
$dst_width2 = 390;
$dst_height2 = ($dst_width2/$src_width)*$src_height;
//proses perubahan ukuran
$im2 = imagecreatetruecolor($dst_width2,$dst_height2);
imagecopyresampled($im2, $im_src, 0, 0, 0, 0, $dst_width2, $dst_height2, $src_width, $src_height);
//Simpan gambar
imagejpeg($im2,$vdir_upload . "medium_" . $fupload_name);
//Hapus gambar di memori komputer
imagedestroy($im_src);
imagedestroy($im);
imagedestroy($im2);
}
Membuat KONEKSI pada PHP
$server = "localhost";
$username = "root";
$password = "";
$database = "dblokomedia";
// Koneksi dan memilih database di server
mysql_connect($server,$username,$password) or die("Koneksi gagal");
mysql_select_db($database) or die("Database tidak bisa dibuka");
$username = "root";
$password = "";
$database = "dblokomedia";
// Koneksi dan memilih database di server
mysql_connect($server,$username,$password) or die("Koneksi gagal");
mysql_select_db($database) or die("Database tidak bisa dibuka");
Kumpulan Sourcecode PhP Untuk Anda
Daftar Isi
KONEKSI
< ? php
$server = "localhost";
$username = "root";
$password = "";
$database = "dblokomedia";
// Koneksi dan memilih database di server
mysql_connect($server,$username,$password) or die("Koneksi gagal");
mysql_select_db($database) or die("Database tidak bisa dibuka");
? >
==============================================================
IF NOT .JPG
< ? php
$lokasi_file = $_FILES['fupload']['tmp_name'];
$tipe_file = $_FILES['fupload']['type'];
$nama_file = $_FILES['fupload']['name'];
$acak = rand(1,99);
$nama_file_unik = $acak.$nama_file;
if (!empty($_POST['tag_seo'])){
$tag_seo = $_POST['tag_seo'];
$tag=implode(',',$tag_seo);
}
$judul_seo = seo_title($_POST['judul']);
// Apabila ada gambar yang diupload
if (!empty($lokasi_file)){
if ($tipe_file != "image/jpeg" AND $tipe_file != "image/pjpeg"){
echo "<script>window.alert('Upload Gagal, Pastikan File yang di Upload bertipe *.JPG');
window.location=('../../media.php?module=berita)</script>";
}
else{
UploadImage($nama_file_unik);
}
?>
<?php
// Upload gambar untuk berita
function UploadImage($fupload_name){
//direktori gambar
$vdir_upload = "../../../foto_berita/";
$vfile_upload = $vdir_upload . $fupload_name;
//Simpan gambar dalam ukuran sebenarnya
move_uploaded_file($_FILES["fupload"]["tmp_name"], $vfile_upload);
//identitas file asli
$im_src = imagecreatefromjpeg($vfile_upload);
$src_width = imageSX($im_src);
$src_height = imageSY($im_src);
//Simpan dalam versi small 110 pixel
//Set ukuran gambar hasil perubahan
$dst_width = 110;
$dst_height = ($dst_width/$src_width)*$src_height;
//proses perubahan ukuran
$im = imagecreatetruecolor($dst_width,$dst_height);
imagecopyresampled($im, $im_src, 0, 0, 0, 0, $dst_width, $dst_height, $src_width, $src_height);
//Simpan gambar
imagejpeg($im,$vdir_upload . "small_" . $fupload_name);
//Simpan dalam versi medium 360 pixel
//Set ukuran gambar hasil perubahan
$dst_width2 = 390;
$dst_height2 = ($dst_width2/$src_width)*$src_height;
//proses perubahan ukuran
$im2 = imagecreatetruecolor($dst_width2,$dst_height2);
imagecopyresampled($im2, $im_src, 0, 0, 0, 0, $dst_width2, $dst_height2, $src_width, $src_height);
//Simpan gambar
imagejpeg($im2,$vdir_upload . "medium_" . $fupload_name);
//Hapus gambar di memori komputer
imagedestroy($im_src);
imagedestroy($im);
imagedestroy($im2);
}
? >
==============================================================
TITTLE BERJALAN:
<script type='text/javascript'>
var thumbnail_mode = "float" ;
summary_noimg = 730;
summary_img = 640;
img_thumb_height = 200;
img_thumb_width = 250;
</script>
<script src='http://blogergadgets.googlecode.com/files/excerpt.js' type='text/javascript'></script>
<script type="text/javascript">(function(){var a;var b=navigator.userAgent;a=-1!=b.indexOf("Mobile")&&-1!=b.indexOf("WebKit")&&-1==b.indexOf("iPad")||-1!=b.indexOf("Opera Mini")?!0:!1;if(a){var c;a:{var d=window.location.href,e=d.split("?");switch(e.length){case 1:c=d+"?m=1";break a;case 2:c=0<=e[1].search("(^|&)m=")?null:d+"&m=1";break a;default:c=null}}c&&window.location.replace(c)};})();
</script><script type="text/javascript">
if (window.jstiming) window.jstiming.load.tick('headEnd');
</script></head>
<script type='text/javascript'>
//<![CDATA[
msg = " --- Galieh Inside ";
msg = " | Its The Best Place to Share | Felani Galieh Prabawa | G & R | Rina Andriani --- " + msg;pos = 0;
function scrollMSG() {
document.title = msg.substring(pos, msg.length) + msg.substring(0, pos); pos++;
if (pos > msg.length) pos = 0
window.setTimeout("scrollMSG()",100);
}
scrollMSG();
//]]>
< /script >
==============================================================
LIBRARY
< ? php
date_default_timezone_set('Asia/Jakarta'); // PHP 6 mengharuskan penyebutan timezone.
$seminggu = array("Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu");
$hari = date("w");
$hari_ini = $seminggu[$hari];
$tgl_sekarang = date("Ymd");
$tgl_skrg = date("d");
$bln_sekarang = date("m");
$thn_sekarang = date("Y");
$jam_sekarang = date("H:i:s");
$nama_bln=array(1=> "Januari", "Februari", "Maret", "April", "Mei",
"Juni", "Juli", "Agustus", "September",
"Oktober", "November", "Desember");
? >
==============================================================
BUAT-KALENDER
< ? php
function buatkalender($tanggal,$bulan,$tahun) {
$bulanan=array(1=>"Januari","Februari","Maret","April",
"Mei","Juni","Juli","Agustus","September",
"Oktober","November","Desember");
$bln=date("n");
$thn=date("Y");
$jmlhari = date("t",mktime(0,0,0,$bulan,1,$tahun));
$haritglsatu = date("w",mktime(0,0,0,$bulan,1,$tahun));
$kalender = "<table cellspacing=1 cellpadding=4
border=0 class=tabel_data>\n";
$kalender .= "<tr class=tr_terang>
<td colspan=7>$bulanan[$bln], $thn
</td></tr>\n";
$kalender .= "<tr class=tr_judul>
<td>M</td><td>S</td><td>S</td><td>R</td>
<td>K</td><td>J</td><td>S</td></tr>\n";
$a = 1;
$adabaris = TRUE;
$mulaicetak = 0;
while ($adabaris) {
$kalender .= "<tr align=center class=tr_terang>";
for ($i = 0; $i < 7; $i++ ) {
if ($mulaicetak < $haritglsatu) {
$kalender .= "<td> </td>";
$mulaicetak++;
}
elseif ($a <= $jmlhari) {
$tt = $a;
if ($a == $tanggal) {
$tt = "<span style='color: blue; font-weight: bold;
font-size: larger; text-decoration: blink;'>
$tt</span>";
}
if ($i == 0) {
$tt = "<font color=\"#FF0000\">$tt</font>";
}
$kalender .= "<td>$tt</td>";
$a++;
}
else {
$kalender .= "<td> </td>";
}
}
$kalender .= "</tr>\n";
if ($a <= $jmlhari) {
$adabaris = TRUE;
}
else {
$adabaris = FALSE;
}
}
$kalender .= "</table>\n";
return $kalender;
}
? >
==============================================================
TGL-INDO
< ? php
function tgl_indo($tgl){
$tanggal = substr($tgl,8,2);
$bulan = getBulan(substr($tgl,5,2));
$tahun = substr($tgl,0,4);
return $tanggal.' '.$bulan.' '.$tahun;
}
function getBulan($bln){
switch ($bln){
case 1:
return "Januari";
break;
case 2:
return "Februari";
break;
case 3:
return "Maret";
break;
case 4:
return "April";
break;
case 5:
return "Mei";
break;
case 6:
return "Juni";
break;
case 7:
return "Juli";
break;
case 8:
return "Agustus";
break;
case 9:
return "September";
break;
case 10:
return "Oktober";
break;
case 11:
return "November";
break;
case 12:
return "Desember";
break;
}
}
? >
==============================================================
KATA-JELEK/ Kurang baik (SENSOR)
< ? php
function sensor($teks){
$w = mysql_query("SELECT * FROM katajelek");
while ($r = mysql_fetch_array($w)){
$teks = str_replace($r['kata'], $r['ganti'], $teks);
}
return $teks;
}
? >
==============================================================
AUTO-LINK
< ? php
function autolink ($str){
$str = eregi_replace("([[:space:]])((f|ht)tps?:\/\/[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $str); //http
$str = eregi_replace("([[:space:]])(www\.[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $str); // www.
$str = eregi_replace("([[:space:]])([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})","\\1<a href=\"mailto:\\2\">\\2</a>", $str); // mail
$str = eregi_replace("^((f|ht)tp:\/\/[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "<a href=\"\\1\" target=\"_blank\">\\1</a>", $str); //http
$str = eregi_replace("^(www\.[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "<a href=\"http://\\1\" target=\"_blank\">\\1</a>", $str); // www.
$str = eregi_replace("^([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})","<a href=\"mailto:\\1\">\\1</a>", $str); // mail
return $str;
}
? >
==============================================================
SQL-SEO
< ? php
function seo_title($s) {
$c = array (' ');
$d = array ('-','/','\\',',','.','#',':',';','\'','"','[',']','{','}',')','(','|','`','~','!','@','%','$','^','&','*','=','?','+');
$s = str_replace($d, '', $s); // Hilangkan karakter yang telah disebutkan di array $d
$s = strtolower(str_replace($c, '-', $s)); // Ganti spasi dengan tanda - dan ubah hurufnya menjadi kecil semua
return $s;
}
? >
==============================================================
ANTI INJECTION
< ?
function anti_injection($data){
$filter = mysql_real_escape_string(stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES))));
return $filter;
}
? >
==============================================================
UPLOAD
< ? php
echo "<b>Silahkan Anda Upload File di sini</b><br /><br />";
echo ("
<form enctype='multipart/form-data' action='' method='POST'>
<input name='file' type='file' />
<input type='submit' value='Upload' />
</form>
");
? >
==============================================================
NAMA UPLOAD FILE
< ? php
if ($_FILES[file] != "") {
@copy($_FILES[file][tmp_name],"imagesku/".$_FILES[file][name]) or die("Proses upload Gagal");
} else {
die("Tidak ada file yang akan diupload");
}
? >
<b>Anda telah berhasil melakukan upload file :</b><br>
<? echo "Nama File : " .$_FILES[file][name]; ?><br>
<? echo "Ukuran File : " .round($_FILES[file][size]/1024);?> kb<br>
<? echo "Jenis File : " .$_FILES[file][type]; ?><br>
==============================================================
KIRIM EMAIL
< ?
echo '<font face="Verdana, Arial, Helvetica, sans-serif" size="2">';
$kirim=mail($email_tujuan,$judul_pesan,$isi_pesan, "From: ".$email_anda."\nContent-Type: text/html; charset=iso-8859-1");
if ($kirim){
$isi_pesan = str_replace("\n","<br>", $isi_pesan);
echo("Email telah dikirim ke <b>$email_tujuan</b><br><br>");
echo("<b>Isi pesan :</b><br>$isi_pesan");
}else{
echo ("Email tidak dapat dikirim");
}
? >
==============================================================
SEARCHING GOOGLE
<form method="get" action="http://www.google.com/search">
<INPUT TYPE='text' name='q' size=31 maxlength=255 value=''>
<INPUT TYPE='hidden' name='hl' value='lacak'>
<INPUT type='submit' name='cari' VALUE='Proses Pencarian'></p>
</FORM>
COUNTER TXT
<div id="Layer1">
Terimakasih, Anda adalah pengunjung ke : <b><? echo counter()." </b>Kami";?></b>
<?php
function counter(){
if (isset($visitor)){
if ($visitor=="visited")
include("counter.txt");
}
else {
$file=fopen("counter.txt","r+");
$nilai=fread($file,filesize("counter.txt"));
fclose($file);
$nilai += 1;
$file=fopen("counter.txt","w+");
fputs($file,$nilai);
fclose($file);
include("counter.txt");
}
}
?>
</div>
isi counter.txt=235
==============================================================
MEMBACA IP:
< ? php
echo '<font face="verdana" size="2">';
$useragent = $_SERVER ['HTTP_USER_AGENT'];
echo ("<b>Deteksi Browser</b><br>Browser yang Anda gunakan sekarang adalah :<br> $useragent");
? >
< ? php
if ($HTTP_X_FORWARDED_FOR){
echo "<b>INFO :</b> Proxy yang Anda gunakan...<br>";
echo "Terhubung melalui : " . $HTTP_VIA . " - " . $REMOTE_ADDR;
$ip=$HTTP_X_FORWARDED_FOR;
echo "<br>IP Anda adalah : <b>$ip</b>";
}
else{
echo "Anda tidak menggunakan proxy<br>";
$host = gethostbyaddr($REMOTE_ADDR);
$ip2=$REMOTE_ADDR;
echo "IP Anda adalah : <b>$ip2</b>" ;
echo " ($host)";
}
? >
< ? php
function BACA_TEXT(){
$myFile = "./isi.txt";
$FP = fopen('isi.txt', 'r');
while(!feof($FP)){$line = fgets($FP);$line = htmlspecialchars($line);echo($line);}
fclose($FP);
}
echo baca();
? >
==============================================================
YAHOO MESSENGER:
< ? php
echo '<font face="Verdana, Arial, Helvetica, sans-serif" size="2">';
$daftar_idyahoo="rini_dyah,riadi_m";
$proses=explode(",",$daftar_idyahoo);
reset($proses);
foreach ($proses as $tujuan) {
echo ("$tujuan<br>
<a href='http://messenger.yahoo.com/edit/send/?.target=$tujuan'>
<img border=0 src='http://opi.yahoo.com/online?u=$tujuan&m=g&t=2&l=us'></a><br>"
);
}
? >
==============================================================
RANDOM GAMBAR : 1.jpg,2.jpg dst 160.jpg
< ? php
echo '<font face="Verdana, Arial, Helvetica, sans-serif" size="2">';
$file_type = ".jpg";
$folder_gambar = "images";
$nilai_pertama = "1";
$jumlah_gambar = "160";
$acak = mt_rand($nilai_pertama, $jumlah_gambar);
$image_name = $acak . $file_type;
echo ("<div align='center'>
<b>Gambar ditampilkan secara acak</b><br><br>
<a href='http://lp2maray.co.id/gbshow.php?id=$acak'>
<img src='$folder_gambar/$image_name' border='0' title='Buku-buku LP2M ARAY' />
</div>");
? >
==============================================================
KALENDER TABEL:
< ? php
$month= date ("m");
$year=date("Y");
$day=date("d");
$endDate=date("t",mktime(0,0,0,$month,$day,$year));
echo '<font face="arial" size="2">';
echo '<table align="center" border="0" cellpadding=5 cellspacing=5 style=""><tr><td align=center>';
echo "Hari ini tanggal : ".date("d F Y ",mktime(0,0,0,$month,$day,$year));
echo '</td></tr></table>';
echo '<table align="center" border="0" cellpadding=1 cellspacing=1 style="border:1px solid #CCCCCC">
<tr bgcolor="#EFEFEF">
<td align=center><font color=red>Minggu</font></td>
<td align=center>Senin</td>
<td align=center>Selasa</td>
<td align=center>Rabu</td>
<td align=center>Kamis</td>
<td align=center>Jumat</td>
<td align=center>Sabtu</td>
</tr>';
$s=date ("w", mktime (0,0,0,$month,1,$year));
for ($ds=1;$ds<=$s;$ds++) {
echo "<td style=\"font-family:arial;color:#B3D9FF\" align=center valign=middle bgcolor=\"#FFFFFF\"></td>";
}
for ($d=1;$d<=$endDate;$d++) {
if (date("w",mktime (0,0,0,$month,$d,$year)) == 0) { echo "<tr>"; }
$fontColor="#000000";
if (date("D",mktime (0,0,0,$month,$d,$year)) == "Sun") { $fontColor="red"; }
echo "<td style=\"font-family:arial;color:#333333\" align=center valign=middle> <span style=\"color:$fontColor\">$d</span></td>";
if (date("w",mktime (0,0,0,$month,$d,$year)) == 6) { echo "</tr>"; }}
echo '</table>';
? >
==============================================================
MARQUEE GAMBAR LEFT
<script language="JavaScript">
function bukajendela(url) {
window.open(url, "window_baru", "width=800,height=600,left=320,top=100,resizable=1,scrollbars=1");
}
</script>
<marquee onmouseover=this.stop() onmouseout=this.start() scrollamount=2 scrolldelay=90 direction=left width=100% height=150>
< ? php
$s = mysql_query("SELECT * FROM `galeri`");
while ($w = mysql_fetch_array($s)) {
$idgaleri=$w["id-galeri"];
echo "
<a href='#' onclick=\"bukajendela('zoom.php?id=$idgaleri')\">
<img src='img_galeri/kecil_$w[gbr_gallery]' border=0>
</a> ";
}
? >
</marquee>
==============================================================
DIE
< ? php
die("<script>location.href='index.php';</script>");
? >
ENKRIPSI KATA UBAH_TEKS:
< ? php
function ubah_teks($teks){
$teks = strrev($teks);
$st = "";
for ($i=0; $i < strlen($teks); $i++){
$ascii = ord(substr($teks, $i, 1));
$hex = dechex($ascii);
if (strlen($hex) == 1)
$hex = "0" . $hex;
$st = $st . $hex;
}
return $st;
}
function balik_teks($teks){
$st = "";
for ($i=0; $i < strlen($teks) / 2; $i++){
$dua_angka = substr($teks, 2 * $i, 2);
$des = hexdec($dua_angka);
$kar = chr($des);
$st = $st . $kar;
}
$st = strrev($st);
return $st;
}
? >
< ? php
function THUMB($fupload_name,$direktori){
// File gambar yang di upload
$file_upload = $direktori . $fupload_name;
// Simpan gambar dalam ukuran sebenarnya
$nama_gbr_asli = $_FILES['fupload']['tmp_name'];
move_uploaded_file($nama_gbr_asli, $file_upload);
// Dapatkan identitas file asli dari file jpg yang di upload
$gbr_asli = imagecreatefromjpeg($file_upload);
$lebar = imageSX($gbr_asli);
$tinggi = imageSY($gbr_asli);
// Simpan dalam versi yang diinginkan 200 pixel (thumbnailnya)
$thu_lebar = 200;
$thu_tinggi = ($thu_lebar/$lebar)*$tinggi;
// Fungsi untuk mengubah ukuran gambar (resample)
$gbr_thumb = imagecreatetruecolor($thu_lebar,$thu_tinggi);
imagecopyresampled($gbr_thumb, $gbr_asli, 0, 0, 0, 0, $thu_lebar, $thu_tinggi, $lebar, $tinggi);
// Simpan gambar yang versi thumbnailnya
imagejpeg($gbr_thumb,$direktori . "kecil_" . $fupload_name);
// Hapus gambar yang ada di memori
imagedestroy($gbr_asli);
imagedestroy($gbr_thumb);
}
? >
==============================================================
BACK JAVASCIPT
< ? php
echo "Kode yang Anda masukkan tidak cocok<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b></a>";
? >
< ? php
function ANTITEXTPANJANG($isi_komentar){
// Mengatasi input komentar tanpa spasi
$split_text = explode(" ",$isi_komentar);
$split_count = count($split_text);
$max = 57;
for($i = 0; $i <= $split_count; $i++){
if(strlen($split_text[$i]) >= $max){
for($j = 0; $j <= strlen($split_text[$i]); $j++){
$char[$j] = substr($split_text[$i],$j,1);
if(($j % $max == 0) && ($j != 0)){
$v_text .= $char[$j] . ' ';
}else{
$v_text .= $char[$j];
}
}
}else{
$v_text .= " " . $split_text[$i] . " ";
}
}
return $v_text;
}
? >
==============================================================
VALIDASI EMPTY
< ? php
$nama=trim($_POST['nama_komentar']);
$komentar=trim($_POST['isi_komentar']);
if (empty($nama)){echo "Anda belum mengisikan NAMA<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (empty($komentar)){echo "Anda belum mengisikan KOMENTAR<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (strlen($komentar) > 1000){echo "KOMENTAR Anda terlalu panjang (max 1000 char)<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
else{}
? >
CAPTCA.PHP
< ? php
session_start();
header("Content-type: image/png");
$captcha_image = imagecreatefrompng("ypathicon/captcha.png");
$captcha_font = imageloadfont("ypathicon/font.gdf");
$captcha_text = substr(md5(uniqid('')),-6,6);
$_SESSION['captcha_session'] = $captcha_text;
$captcha_color = imagecolorallocate($captcha_image,0,0,0);
imagestring($captcha_image,$captcha_font,15,5,$captcha_text,$captcha_color);
imagepng($captcha_image);
imagedestroy($captcha_image);
? >
==============================================================
< ? php
//Form komentar
$materi="berita";
$idberita="B1108001";
$iddata=$idberita;
echo "<br /><br /><b>Isi Komentar Anda :</b>
<table width='100%' style='border: 1pt dashed #0000CC;padding: 10px;'>
<form name='form' action='?' method='POST' onSubmit='return validasi(this)'>
<input type='hidden' name='iddata' value='$iddata'>
<tr><td>Nama </td><td> : <input type='text' name='nama_komentar' size='25'></td></tr>
<tr><td>Email </td><td> : <input type='text' name='email_komentar' size='50' maxlength='50'></td></tr>
<tr><td valign=top>Komentar </td><td> <textarea name='isi_komentar' style='width: 300px; height: 100px;'></textarea></td></tr>
<tr><td> </td><td> <img src='captcha.php'></td></tr>
<tr><td> </td><td> (Masukkan 6 kode diatas)<br />
<input type='text' name='kodecaptcha' size='6' maxlength='6'><br /></td></tr>
<tr><td> </td><td> <input type='submit' name='Kirim' value='Kirim'></td></tr>
</form></table><br />";
?>
< ? php
if(!empty($_POST['kodecaptcha'])){
if($_POST['kodecaptcha']==$_SESSION['captcha_session']){
$nama_komentar=trim($_POST['nama_komentar']);
$isi_komentar=trim($_POST['isi_komentar']);
$email_komentar=trim($_POST['email_komentar']);
if (empty($nama_komentar)){echo "Maaf, Anda belum mengisikan Nama Anda...<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (empty($komentar)){echo "Anda belum mengisikan Komentar Anda <br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (strlen($komentar) > 1000){echo "Maaf, KOMENTAR Anda terlalu panjang (max 1000 char)<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
else{
//SIMPAN KOMENTAR
}
}
else{
echo"<script>alert('Maaf, Kode Captcha Anda salah...Silakan cek kembali...');
document.location.href='javascript:history.go(-1)';</script>";
}
}
else{
echo"<script>alert('Silakan isi Kode Captcha Anda...Atau Silakan cek kembali...');
document.location.href='javascript:history.go(-1)';</script>";
}
? >
==============================================================
BACA TXT
<?
function bacatext(){
$myFile = "notepad.txt";
$FP = fopen($myFile, 'r');
while(!feof($FP)){
$line = fgets($FP);
$line = htmlspecialchars($line);
echo($line);
}
fclose($FP);
}
echo bacatext();
?>
3GP PLAYER
< ? php
echo ("<embed src='multimedia/ironman.3gp' autostart='false' width='200' height='200'></embed>");
? >
- KONEKSI
- IF NOT .JPG
- LIBRARY
- BUAT-KALENDER
- TGL-INDO
- KATA-JELEK(SENSOR)
- AUTO-LINK
- SQL-SEO
- ANTI INJECTION
- UPLOAD
- KIRIM EMAIL
- NAMA UPLOAD FILE
- SEARCHING GOOGLE
- COUNTER TXT
- MEMBACA IP:
- BACA_TEXT
- YAHOO MESSENGER:
- RANDOM GAMBAR : 1.jpg,2.jpg dst 160.jpg
- KALENDER TABEL:
- MARQUEE GAMBAR LEFT
- DIE
- ENKRIPSI KATA UBAH_TEKS:
- THUMB
- REFRESH META
- BACK JAVASCIPT
- ANTITEXTPANJANG
- VALIDASI EMPTY
- CAPTCA.PHP
- BACA TXT
- 3GP PLAYER
KONEKSI
< ? php
$server = "localhost";
$username = "root";
$password = "";
$database = "dblokomedia";
// Koneksi dan memilih database di server
mysql_connect($server,$username,$password) or die("Koneksi gagal");
mysql_select_db($database) or die("Database tidak bisa dibuka");
? >
==============================================================
IF NOT .JPG
< ? php
$lokasi_file = $_FILES['fupload']['tmp_name'];
$tipe_file = $_FILES['fupload']['type'];
$nama_file = $_FILES['fupload']['name'];
$acak = rand(1,99);
$nama_file_unik = $acak.$nama_file;
if (!empty($_POST['tag_seo'])){
$tag_seo = $_POST['tag_seo'];
$tag=implode(',',$tag_seo);
}
$judul_seo = seo_title($_POST['judul']);
// Apabila ada gambar yang diupload
if (!empty($lokasi_file)){
if ($tipe_file != "image/jpeg" AND $tipe_file != "image/pjpeg"){
echo "<script>window.alert('Upload Gagal, Pastikan File yang di Upload bertipe *.JPG');
window.location=('../../media.php?module=berita)</script>";
}
else{
UploadImage($nama_file_unik);
}
?>
<?php
// Upload gambar untuk berita
function UploadImage($fupload_name){
//direktori gambar
$vdir_upload = "../../../foto_berita/";
$vfile_upload = $vdir_upload . $fupload_name;
//Simpan gambar dalam ukuran sebenarnya
move_uploaded_file($_FILES["fupload"]["tmp_name"], $vfile_upload);
//identitas file asli
$im_src = imagecreatefromjpeg($vfile_upload);
$src_width = imageSX($im_src);
$src_height = imageSY($im_src);
//Simpan dalam versi small 110 pixel
//Set ukuran gambar hasil perubahan
$dst_width = 110;
$dst_height = ($dst_width/$src_width)*$src_height;
//proses perubahan ukuran
$im = imagecreatetruecolor($dst_width,$dst_height);
imagecopyresampled($im, $im_src, 0, 0, 0, 0, $dst_width, $dst_height, $src_width, $src_height);
//Simpan gambar
imagejpeg($im,$vdir_upload . "small_" . $fupload_name);
//Simpan dalam versi medium 360 pixel
//Set ukuran gambar hasil perubahan
$dst_width2 = 390;
$dst_height2 = ($dst_width2/$src_width)*$src_height;
//proses perubahan ukuran
$im2 = imagecreatetruecolor($dst_width2,$dst_height2);
imagecopyresampled($im2, $im_src, 0, 0, 0, 0, $dst_width2, $dst_height2, $src_width, $src_height);
//Simpan gambar
imagejpeg($im2,$vdir_upload . "medium_" . $fupload_name);
//Hapus gambar di memori komputer
imagedestroy($im_src);
imagedestroy($im);
imagedestroy($im2);
}
? >
==============================================================
TITTLE BERJALAN:
<script type='text/javascript'>
var thumbnail_mode = "float" ;
summary_noimg = 730;
summary_img = 640;
img_thumb_height = 200;
img_thumb_width = 250;
</script>
<script src='http://blogergadgets.googlecode.com/files/excerpt.js' type='text/javascript'></script>
<script type="text/javascript">(function(){var a;var b=navigator.userAgent;a=-1!=b.indexOf("Mobile")&&-1!=b.indexOf("WebKit")&&-1==b.indexOf("iPad")||-1!=b.indexOf("Opera Mini")?!0:!1;if(a){var c;a:{var d=window.location.href,e=d.split("?");switch(e.length){case 1:c=d+"?m=1";break a;case 2:c=0<=e[1].search("(^|&)m=")?null:d+"&m=1";break a;default:c=null}}c&&window.location.replace(c)};})();
</script><script type="text/javascript">
if (window.jstiming) window.jstiming.load.tick('headEnd');
</script></head>
<script type='text/javascript'>
//<![CDATA[
msg = " --- Galieh Inside ";
msg = " | Its The Best Place to Share | Felani Galieh Prabawa | G & R | Rina Andriani --- " + msg;pos = 0;
function scrollMSG() {
document.title = msg.substring(pos, msg.length) + msg.substring(0, pos); pos++;
if (pos > msg.length) pos = 0
window.setTimeout("scrollMSG()",100);
}
scrollMSG();
//]]>
< /script >
==============================================================
LIBRARY
< ? php
date_default_timezone_set('Asia/Jakarta'); // PHP 6 mengharuskan penyebutan timezone.
$seminggu = array("Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu");
$hari = date("w");
$hari_ini = $seminggu[$hari];
$tgl_sekarang = date("Ymd");
$tgl_skrg = date("d");
$bln_sekarang = date("m");
$thn_sekarang = date("Y");
$jam_sekarang = date("H:i:s");
$nama_bln=array(1=> "Januari", "Februari", "Maret", "April", "Mei",
"Juni", "Juli", "Agustus", "September",
"Oktober", "November", "Desember");
? >
==============================================================
BUAT-KALENDER
< ? php
function buatkalender($tanggal,$bulan,$tahun) {
$bulanan=array(1=>"Januari","Februari","Maret","April",
"Mei","Juni","Juli","Agustus","September",
"Oktober","November","Desember");
$bln=date("n");
$thn=date("Y");
$jmlhari = date("t",mktime(0,0,0,$bulan,1,$tahun));
$haritglsatu = date("w",mktime(0,0,0,$bulan,1,$tahun));
$kalender = "<table cellspacing=1 cellpadding=4
border=0 class=tabel_data>\n";
$kalender .= "<tr class=tr_terang>
<td colspan=7>$bulanan[$bln], $thn
</td></tr>\n";
$kalender .= "<tr class=tr_judul>
<td>M</td><td>S</td><td>S</td><td>R</td>
<td>K</td><td>J</td><td>S</td></tr>\n";
$a = 1;
$adabaris = TRUE;
$mulaicetak = 0;
while ($adabaris) {
$kalender .= "<tr align=center class=tr_terang>";
for ($i = 0; $i < 7; $i++ ) {
if ($mulaicetak < $haritglsatu) {
$kalender .= "<td> </td>";
$mulaicetak++;
}
elseif ($a <= $jmlhari) {
$tt = $a;
if ($a == $tanggal) {
$tt = "<span style='color: blue; font-weight: bold;
font-size: larger; text-decoration: blink;'>
$tt</span>";
}
if ($i == 0) {
$tt = "<font color=\"#FF0000\">$tt</font>";
}
$kalender .= "<td>$tt</td>";
$a++;
}
else {
$kalender .= "<td> </td>";
}
}
$kalender .= "</tr>\n";
if ($a <= $jmlhari) {
$adabaris = TRUE;
}
else {
$adabaris = FALSE;
}
}
$kalender .= "</table>\n";
return $kalender;
}
? >
==============================================================
TGL-INDO
< ? php
function tgl_indo($tgl){
$tanggal = substr($tgl,8,2);
$bulan = getBulan(substr($tgl,5,2));
$tahun = substr($tgl,0,4);
return $tanggal.' '.$bulan.' '.$tahun;
}
function getBulan($bln){
switch ($bln){
case 1:
return "Januari";
break;
case 2:
return "Februari";
break;
case 3:
return "Maret";
break;
case 4:
return "April";
break;
case 5:
return "Mei";
break;
case 6:
return "Juni";
break;
case 7:
return "Juli";
break;
case 8:
return "Agustus";
break;
case 9:
return "September";
break;
case 10:
return "Oktober";
break;
case 11:
return "November";
break;
case 12:
return "Desember";
break;
}
}
? >
==============================================================
KATA-JELEK/ Kurang baik (SENSOR)
< ? php
function sensor($teks){
$w = mysql_query("SELECT * FROM katajelek");
while ($r = mysql_fetch_array($w)){
$teks = str_replace($r['kata'], $r['ganti'], $teks);
}
return $teks;
}
? >
==============================================================
AUTO-LINK
< ? php
function autolink ($str){
$str = eregi_replace("([[:space:]])((f|ht)tps?:\/\/[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $str); //http
$str = eregi_replace("([[:space:]])(www\.[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $str); // www.
$str = eregi_replace("([[:space:]])([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})","\\1<a href=\"mailto:\\2\">\\2</a>", $str); // mail
$str = eregi_replace("^((f|ht)tp:\/\/[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "<a href=\"\\1\" target=\"_blank\">\\1</a>", $str); //http
$str = eregi_replace("^(www\.[a-z0-9~#%@\&:=?+\/\.,_-]+[a-z0-9~#%@\&=?+\/_.;-]+)", "<a href=\"http://\\1\" target=\"_blank\">\\1</a>", $str); // www.
$str = eregi_replace("^([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})","<a href=\"mailto:\\1\">\\1</a>", $str); // mail
return $str;
}
? >
==============================================================
SQL-SEO
< ? php
function seo_title($s) {
$c = array (' ');
$d = array ('-','/','\\',',','.','#',':',';','\'','"','[',']','{','}',')','(','|','`','~','!','@','%','$','^','&','*','=','?','+');
$s = str_replace($d, '', $s); // Hilangkan karakter yang telah disebutkan di array $d
$s = strtolower(str_replace($c, '-', $s)); // Ganti spasi dengan tanda - dan ubah hurufnya menjadi kecil semua
return $s;
}
? >
==============================================================
ANTI INJECTION
< ?
function anti_injection($data){
$filter = mysql_real_escape_string(stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES))));
return $filter;
}
? >
==============================================================
UPLOAD
< ? php
echo "<b>Silahkan Anda Upload File di sini</b><br /><br />";
echo ("
<form enctype='multipart/form-data' action='' method='POST'>
<input name='file' type='file' />
<input type='submit' value='Upload' />
</form>
");
? >
==============================================================
NAMA UPLOAD FILE
< ? php
if ($_FILES[file] != "") {
@copy($_FILES[file][tmp_name],"imagesku/".$_FILES[file][name]) or die("Proses upload Gagal");
} else {
die("Tidak ada file yang akan diupload");
}
? >
<b>Anda telah berhasil melakukan upload file :</b><br>
<? echo "Nama File : " .$_FILES[file][name]; ?><br>
<? echo "Ukuran File : " .round($_FILES[file][size]/1024);?> kb<br>
<? echo "Jenis File : " .$_FILES[file][type]; ?><br>
==============================================================
KIRIM EMAIL
< ?
echo '<font face="Verdana, Arial, Helvetica, sans-serif" size="2">';
$kirim=mail($email_tujuan,$judul_pesan,$isi_pesan, "From: ".$email_anda."\nContent-Type: text/html; charset=iso-8859-1");
if ($kirim){
$isi_pesan = str_replace("\n","<br>", $isi_pesan);
echo("Email telah dikirim ke <b>$email_tujuan</b><br><br>");
echo("<b>Isi pesan :</b><br>$isi_pesan");
}else{
echo ("Email tidak dapat dikirim");
}
? >
==============================================================
SEARCHING GOOGLE
<form method="get" action="http://www.google.com/search">
<INPUT TYPE='text' name='q' size=31 maxlength=255 value=''>
<INPUT TYPE='hidden' name='hl' value='lacak'>
<INPUT type='submit' name='cari' VALUE='Proses Pencarian'></p>
</FORM>
COUNTER TXT
<div id="Layer1">
Terimakasih, Anda adalah pengunjung ke : <b><? echo counter()." </b>Kami";?></b>
<?php
function counter(){
if (isset($visitor)){
if ($visitor=="visited")
include("counter.txt");
}
else {
$file=fopen("counter.txt","r+");
$nilai=fread($file,filesize("counter.txt"));
fclose($file);
$nilai += 1;
$file=fopen("counter.txt","w+");
fputs($file,$nilai);
fclose($file);
include("counter.txt");
}
}
?>
</div>
isi counter.txt=235
==============================================================
MEMBACA IP:
< ? php
echo '<font face="verdana" size="2">';
$useragent = $_SERVER ['HTTP_USER_AGENT'];
echo ("<b>Deteksi Browser</b><br>Browser yang Anda gunakan sekarang adalah :<br> $useragent");
? >
< ? php
if ($HTTP_X_FORWARDED_FOR){
echo "<b>INFO :</b> Proxy yang Anda gunakan...<br>";
echo "Terhubung melalui : " . $HTTP_VIA . " - " . $REMOTE_ADDR;
$ip=$HTTP_X_FORWARDED_FOR;
echo "<br>IP Anda adalah : <b>$ip</b>";
}
else{
echo "Anda tidak menggunakan proxy<br>";
$host = gethostbyaddr($REMOTE_ADDR);
$ip2=$REMOTE_ADDR;
echo "IP Anda adalah : <b>$ip2</b>" ;
echo " ($host)";
}
? >
< ? php
function BACA_TEXT(){
$myFile = "./isi.txt";
$FP = fopen('isi.txt', 'r');
while(!feof($FP)){$line = fgets($FP);$line = htmlspecialchars($line);echo($line);}
fclose($FP);
}
echo baca();
? >
==============================================================
YAHOO MESSENGER:
< ? php
echo '<font face="Verdana, Arial, Helvetica, sans-serif" size="2">';
$daftar_idyahoo="rini_dyah,riadi_m";
$proses=explode(",",$daftar_idyahoo);
reset($proses);
foreach ($proses as $tujuan) {
echo ("$tujuan<br>
<a href='http://messenger.yahoo.com/edit/send/?.target=$tujuan'>
<img border=0 src='http://opi.yahoo.com/online?u=$tujuan&m=g&t=2&l=us'></a><br>"
);
}
? >
==============================================================
RANDOM GAMBAR : 1.jpg,2.jpg dst 160.jpg
< ? php
echo '<font face="Verdana, Arial, Helvetica, sans-serif" size="2">';
$file_type = ".jpg";
$folder_gambar = "images";
$nilai_pertama = "1";
$jumlah_gambar = "160";
$acak = mt_rand($nilai_pertama, $jumlah_gambar);
$image_name = $acak . $file_type;
echo ("<div align='center'>
<b>Gambar ditampilkan secara acak</b><br><br>
<a href='http://lp2maray.co.id/gbshow.php?id=$acak'>
<img src='$folder_gambar/$image_name' border='0' title='Buku-buku LP2M ARAY' />
</div>");
? >
==============================================================
KALENDER TABEL:
< ? php
$month= date ("m");
$year=date("Y");
$day=date("d");
$endDate=date("t",mktime(0,0,0,$month,$day,$year));
echo '<font face="arial" size="2">';
echo '<table align="center" border="0" cellpadding=5 cellspacing=5 style=""><tr><td align=center>';
echo "Hari ini tanggal : ".date("d F Y ",mktime(0,0,0,$month,$day,$year));
echo '</td></tr></table>';
echo '<table align="center" border="0" cellpadding=1 cellspacing=1 style="border:1px solid #CCCCCC">
<tr bgcolor="#EFEFEF">
<td align=center><font color=red>Minggu</font></td>
<td align=center>Senin</td>
<td align=center>Selasa</td>
<td align=center>Rabu</td>
<td align=center>Kamis</td>
<td align=center>Jumat</td>
<td align=center>Sabtu</td>
</tr>';
$s=date ("w", mktime (0,0,0,$month,1,$year));
for ($ds=1;$ds<=$s;$ds++) {
echo "<td style=\"font-family:arial;color:#B3D9FF\" align=center valign=middle bgcolor=\"#FFFFFF\"></td>";
}
for ($d=1;$d<=$endDate;$d++) {
if (date("w",mktime (0,0,0,$month,$d,$year)) == 0) { echo "<tr>"; }
$fontColor="#000000";
if (date("D",mktime (0,0,0,$month,$d,$year)) == "Sun") { $fontColor="red"; }
echo "<td style=\"font-family:arial;color:#333333\" align=center valign=middle> <span style=\"color:$fontColor\">$d</span></td>";
if (date("w",mktime (0,0,0,$month,$d,$year)) == 6) { echo "</tr>"; }}
echo '</table>';
? >
==============================================================
MARQUEE GAMBAR LEFT
<script language="JavaScript">
function bukajendela(url) {
window.open(url, "window_baru", "width=800,height=600,left=320,top=100,resizable=1,scrollbars=1");
}
</script>
<marquee onmouseover=this.stop() onmouseout=this.start() scrollamount=2 scrolldelay=90 direction=left width=100% height=150>
< ? php
$s = mysql_query("SELECT * FROM `galeri`");
while ($w = mysql_fetch_array($s)) {
$idgaleri=$w["id-galeri"];
echo "
<a href='#' onclick=\"bukajendela('zoom.php?id=$idgaleri')\">
<img src='img_galeri/kecil_$w[gbr_gallery]' border=0>
</a> ";
}
? >
</marquee>
==============================================================
DIE
< ? php
die("<script>location.href='index.php';</script>");
? >
ENKRIPSI KATA UBAH_TEKS:
< ? php
function ubah_teks($teks){
$teks = strrev($teks);
$st = "";
for ($i=0; $i < strlen($teks); $i++){
$ascii = ord(substr($teks, $i, 1));
$hex = dechex($ascii);
if (strlen($hex) == 1)
$hex = "0" . $hex;
$st = $st . $hex;
}
return $st;
}
function balik_teks($teks){
$st = "";
for ($i=0; $i < strlen($teks) / 2; $i++){
$dua_angka = substr($teks, 2 * $i, 2);
$des = hexdec($dua_angka);
$kar = chr($des);
$st = $st . $kar;
}
$st = strrev($st);
return $st;
}
? >
< ? php
function THUMB($fupload_name,$direktori){
// File gambar yang di upload
$file_upload = $direktori . $fupload_name;
// Simpan gambar dalam ukuran sebenarnya
$nama_gbr_asli = $_FILES['fupload']['tmp_name'];
move_uploaded_file($nama_gbr_asli, $file_upload);
// Dapatkan identitas file asli dari file jpg yang di upload
$gbr_asli = imagecreatefromjpeg($file_upload);
$lebar = imageSX($gbr_asli);
$tinggi = imageSY($gbr_asli);
// Simpan dalam versi yang diinginkan 200 pixel (thumbnailnya)
$thu_lebar = 200;
$thu_tinggi = ($thu_lebar/$lebar)*$tinggi;
// Fungsi untuk mengubah ukuran gambar (resample)
$gbr_thumb = imagecreatetruecolor($thu_lebar,$thu_tinggi);
imagecopyresampled($gbr_thumb, $gbr_asli, 0, 0, 0, 0, $thu_lebar, $thu_tinggi, $lebar, $tinggi);
// Simpan gambar yang versi thumbnailnya
imagejpeg($gbr_thumb,$direktori . "kecil_" . $fupload_name);
// Hapus gambar yang ada di memori
imagedestroy($gbr_asli);
imagedestroy($gbr_thumb);
}
? >
==============================================================
BACK JAVASCIPT
< ? php
echo "Kode yang Anda masukkan tidak cocok<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b></a>";
? >
< ? php
function ANTITEXTPANJANG($isi_komentar){
// Mengatasi input komentar tanpa spasi
$split_text = explode(" ",$isi_komentar);
$split_count = count($split_text);
$max = 57;
for($i = 0; $i <= $split_count; $i++){
if(strlen($split_text[$i]) >= $max){
for($j = 0; $j <= strlen($split_text[$i]); $j++){
$char[$j] = substr($split_text[$i],$j,1);
if(($j % $max == 0) && ($j != 0)){
$v_text .= $char[$j] . ' ';
}else{
$v_text .= $char[$j];
}
}
}else{
$v_text .= " " . $split_text[$i] . " ";
}
}
return $v_text;
}
? >
==============================================================
VALIDASI EMPTY
< ? php
$nama=trim($_POST['nama_komentar']);
$komentar=trim($_POST['isi_komentar']);
if (empty($nama)){echo "Anda belum mengisikan NAMA<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (empty($komentar)){echo "Anda belum mengisikan KOMENTAR<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (strlen($komentar) > 1000){echo "KOMENTAR Anda terlalu panjang (max 1000 char)<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
else{}
? >
CAPTCA.PHP
< ? php
session_start();
header("Content-type: image/png");
$captcha_image = imagecreatefrompng("ypathicon/captcha.png");
$captcha_font = imageloadfont("ypathicon/font.gdf");
$captcha_text = substr(md5(uniqid('')),-6,6);
$_SESSION['captcha_session'] = $captcha_text;
$captcha_color = imagecolorallocate($captcha_image,0,0,0);
imagestring($captcha_image,$captcha_font,15,5,$captcha_text,$captcha_color);
imagepng($captcha_image);
imagedestroy($captcha_image);
? >
==============================================================
< ? php
//Form komentar
$materi="berita";
$idberita="B1108001";
$iddata=$idberita;
echo "<br /><br /><b>Isi Komentar Anda :</b>
<table width='100%' style='border: 1pt dashed #0000CC;padding: 10px;'>
<form name='form' action='?' method='POST' onSubmit='return validasi(this)'>
<input type='hidden' name='iddata' value='$iddata'>
<tr><td>Nama </td><td> : <input type='text' name='nama_komentar' size='25'></td></tr>
<tr><td>Email </td><td> : <input type='text' name='email_komentar' size='50' maxlength='50'></td></tr>
<tr><td valign=top>Komentar </td><td> <textarea name='isi_komentar' style='width: 300px; height: 100px;'></textarea></td></tr>
<tr><td> </td><td> <img src='captcha.php'></td></tr>
<tr><td> </td><td> (Masukkan 6 kode diatas)<br />
<input type='text' name='kodecaptcha' size='6' maxlength='6'><br /></td></tr>
<tr><td> </td><td> <input type='submit' name='Kirim' value='Kirim'></td></tr>
</form></table><br />";
?>
< ? php
if(!empty($_POST['kodecaptcha'])){
if($_POST['kodecaptcha']==$_SESSION['captcha_session']){
$nama_komentar=trim($_POST['nama_komentar']);
$isi_komentar=trim($_POST['isi_komentar']);
$email_komentar=trim($_POST['email_komentar']);
if (empty($nama_komentar)){echo "Maaf, Anda belum mengisikan Nama Anda...<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (empty($komentar)){echo "Anda belum mengisikan Komentar Anda <br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
elseif (strlen($komentar) > 1000){echo "Maaf, KOMENTAR Anda terlalu panjang (max 1000 char)<br /><a href=javascript:history.go(-1)><b>Ulangi Lagi</b>";}
else{
//SIMPAN KOMENTAR
}
}
else{
echo"<script>alert('Maaf, Kode Captcha Anda salah...Silakan cek kembali...');
document.location.href='javascript:history.go(-1)';</script>";
}
}
else{
echo"<script>alert('Silakan isi Kode Captcha Anda...Atau Silakan cek kembali...');
document.location.href='javascript:history.go(-1)';</script>";
}
? >
==============================================================
BACA TXT
<?
function bacatext(){
$myFile = "notepad.txt";
$FP = fopen($myFile, 'r');
while(!feof($FP)){
$line = fgets($FP);
$line = htmlspecialchars($line);
echo($line);
}
fclose($FP);
}
echo bacatext();
?>
3GP PLAYER
< ? php
echo ("<embed src='multimedia/ironman.3gp' autostart='false' width='200' height='200'></embed>");
? >
Subscribe to:
Posts (Atom)