Recent Comments

Space For Ads

Space For Ads

Jumat, 22 November 2013

Base 64 Encoder/Decoder Script

 
 hari Ini saya mau share cara bikin enkripsi sendiri.. monggo di simak..
yg males scripting lgs donlot di sini aja broo









<?php //*********************************************************************************************
//TITLE : Base64 Encoder / Decoder
//*********************************************************************************************
 
echo"<title>Base 64 Encode / Decode</title>";
echo
"<div align=center>Base 64 Encode / Decode";
    
$Crutstripslashes($_POST['c0de']);
        if (
$Crut == "")
        {
       
$Crut $_GET['c0de'];
        }
 
    
$action $_POST['action'];
    if (
$action == "")
     {
    
$action $_GET['action'];
    if (
$action == "encode"){
              
$action "enc0de";
              }
              elseif (
$action == "decode")
              {
              
$action "dec0de";
              }
        }
     
    switch(
$action){
    case 
"enc0de":
           
$output base64_encode($Crut);
               if(!
$output){
               echo 
'Ada yang salah Crut!!!';
               }
     
    echo
"<center><table width='380'><td>";
    echo 
"<p> Input: " $Crut "</p>";
    echo 
"<p> Output (Base64): " $output ."</p>";
    echo 
"<p><a href='javascript:history.back(0);'> << Back </a></p>";
    break;
     
    case 
"dec0de":
    
$output base64_decode($Crut);
    if(!
$output){
    echo 
'Ada yang salah Crut!!!';
    exit;
    }
     
    echo
"<center><table width='380'><td>";
    echo 
"<p> Input (Base64) : " $Crut "</p>";
    echo 
"<p> Output : " $output ."</p>";
    echo 
"<p><a href='javascript:history.back(0);'> << Back </a></p>";
    break;
     
    default: echo 
'<form id="form1" name="form1" method="post" action="?encode/decode">
                <p>
                   <textarea name="c0de" id="c0de" rows=8 cols=40 ></textarea>
                </p>
              
              <p>Pilih yang mau di cari</p>
              
              <p><input type=radio name="action" id="action" value="enc0de">Encode</p>
              <p><input type=radio name="action" id="action" value="dec0de">Decode</p>
     
            <input type="submit" class = "button" name="submit" id="submit" onClick="
            if(c0de.value==\'\'){alert(\'mana teksnya crut???\'); return false;}" value="Submit" />
            <input type="reset" name="reset" class="button" value="Reset"/>
     
        </p>
      </form>'
;
      
    break;
    }
    
?>

0 komentar:

Posting Komentar