Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /********************************************************
- // function untuk memecah suatu strings dalam beberapa bagian
- // dalam bentuk array (dalam php5, sama dengan function 'str_split()'
- // the_string : string inputan yang akan dipecah
- // the_number : jumlah karakter dalam satu baris
- */
- function stringsplit($the_string, $the_length){
- $startoff_nr = 0;
- $the_output_array = array();
- for($z = 1; $z < ceil(strlen($the_string)/$the_length)+1 ; $z++){
- $startoff_nr = ($the_length*$z)-$the_length;
- $the_output_array[] = substr($the_string, $startoff_nr, $the_length);
- }
- return($the_output_array);
- }
- /********************************************************
- // function untuk mengencode suatu strings
- */
- function encode($strEncode){
- $c=rand(1,15);
- $strEncode=stripslashes($strEncode);
- if($strEncode){
- if(substr($strEncode,0,1)=="<"){
- $strEncode='?>'.$strEncode.'<?php';
- }
- for($j=0;$j<$c-1;$j++){
- if($j==$c-1){
- $strEncode=$strEncode."//".($c<10?"0".$c:$c);
- }
- $strEncode1=base64_encode(gzdeflate($strEncode));
- $strEncode="eval(gzinflate(base64_decode('".$strEncode1."')));";
- }
- }
- $strEncode="<?php \n".$strEncode."\n ?>";
- $arr=stringsplit($strEncode,70);
- $strEncode=$arr[0];
- for($i=1;$i<count($arr);$i++){
- $strEncode.="\n".$arr[$i];
- }
- $strEncode=str_replace("\n\n","\n",$strEncode);
- return $strEncode;
- }
- ?>
- <!doctype html>
- <html>
- <head>
- <title>phpEncoder</title>
- <style>
- * {font-family:calibri,tahoma,arial,sans-serif;font-size:1em;}
- .farea {width:40.5em;height:14em;}
- .tarea {width:40em;height:10em;}
- </style>
- </head>
- <body>
- <fieldset class='farea'>
- <legend>Source</legend>
- <form method='post'>
- <textarea name='source' class='tarea'></textarea><br/>
- <input type='submit' name='submit' value='process'>
- </form>
- </fieldset>
- <fieldset class='farea'<?php if(!isset($_POST['source'])) echo " style='display:none'";?>>
- <legend>Result</legend>
- <textarea class='tarea'><?php echo (isset($_POST['source']) && !empty($_POST['source']))?encode(addslashes($_POST['source'])):'';?></textarea>
- </fieldset>
- <div>copyright © 2015 by cahyadsn</div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement