Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php session_start();include_once "\x75\x74\x69l\x69\x74\x79/\x6d\x79\x46\x75n\x63\x74\x..

Decoded Output download

<?php  session_start();include_once "utility/myFunction.php";if(!isset($_SESSION["a"])) redirect("index.php"); 
$y = $_SESSION["id"];db_connect();$c = mysql_query("SELECT categories FROM staff WHERE staff_id = '"."$y"."'") OR die("Cant query: ".mysql_error()); 
$k = mysql_fetch_object($c);$m = mysql_query("SELECT session, term FROM settings ORDER by id DESC LIMIT 1") OR die("Cant query: ".mysql_error()); 
$f = mysql_fetch_object($m);$n = $f->session;$i = $f->term;$fk = "";$fm = "";if(isset($_POST["go"]) ){$ff = $_POST["term"]; 
$fn = $_POST["type"];$fi = $_POST["class"];$fh = $_POST["category"];if($fn != "" || $fh != "" || $ff != ""){ 
if($fh == 1){$fy = "SELECT * FROM student, tea_comment WHERE tea_comment.classteacher ='"."$y"."' AND student.student_Id = tea_comment.student_Id AND tea_comment.term = '"."$ff"."' AND tea_comment.class = '"."$fi"."' AND tea_comment.restype = '"."$fn"."' AND tea_comment.session = '"."$n"."'"; 
}elseif($fh == 2){$fy = "SELECT * FROM student, house_comment WHERE house_comment.housetutor ='"."$y"."' AND student.student_Id = house_comment.student_Id AND house_comment.term = '"."$ff"."' AND house_comment.class = '"."$fi"."' AND house_comment.restype = '"."$fn"."' AND house_comment.session = '"."$n"."'"; 
}elseif($fh == 3){$fy = "SELECT * FROM student, principal_comment WHERE principal_comment.principal ='"."$y"."' AND student.student_Id = principal_comment.student_Id AND principal_comment.term = '"."$ff"."' AND principal_comment.class = '"."$fi"."' AND principal_comment.restype = '"."$fn"."' AND principal_comment.session = '"."$n"."'"; 
}$fd = mysql_query($fy) OR die("Cann't select student table". mysql_error()); 
if(mysql_num_rows($fd)>0){while($b = mysql_fetch_array($fd)){ 
$fm .= 
"<tr><form method=post action=''>					<td align=right><strong>Student Name</strong></td> 
					<td><input type=hidden name=cat value='"."$fh"."'> 
					<input type=hidden name=typ value='"."$fn"."'> 
					<input type=hidden name=term value='"."$ff"."'> 
					<input type=hidden name=class value='"."$fi"."'> 
					<input type=hidden name=studid[] value=" 
.$b["student_Id"].">					<input type='text'size ='45' readonly='readonly' name='studentname[]' value='"."$b"."[surname]&nbsp;"."$b"."[first_name]&nbsp;"."$b"."[other_name]'>" 
."</td>				</tr>" 
;if($fh == 1){ 
$fm .= "<tr>					<td align=right><strong>Class Teacher's Comment</strong></td> 
					<td><textarea cols=50 rows=2 name='txt[]' >"."$b"."[comment]</textarea></td> 
				</tr>" 
;  
}elseif($fh == 2){ 
$fm .= "<tr>					<td align=right><strong>House Tutor's Comment</strong></td> 
					<td><textarea cols=50 rows=2 name='txt[]' >"."$b"."[comment]</textarea></td> 
				</tr>" 
;  
}elseif($fh == 3){ 
$fm .= "<tr>					<td align=right><strong>Principal's Comment</strong></td> 
					<td><textarea cols=50 rows=2 name='txt[]' >"."$b"."[comment]</textarea></td> 
				</tr>" 
;  
} 
$fm .= "<tr>					<td colspan=2><hr></td> 
				</tr>" 
;;} 
$fm .= "<tr>					<td colspan=2>&nbsp;</td> 
				</tr><tr> 
					<td colspan=2><input type=submit  name=submit  value=Submit  /></form></td> 
				</tr>" 
;}else{$fk= message("No Comment has been made. Click on Enter Comment to make your comment", "warn"); 
}}else{$fk = message("All the fields must be selected", "warn"); 
}} 
?>

Did this file decode correctly?

Original Code

<?php  session_start();include_once "\x75\x74\x69l\x69\x74\x79/\x6d\x79\x46\x75n\x63\x74\x69o\x6e\x2e\x70h\x70";if(!isset($_SESSION["\x61"])) redirect("\x69\x6e\x64e\x78\x2e\x70h\x70");
$y = $_SESSION["\x69\x64"];db_connect();$c = mysql_query("\x53\x45\x4cE\x43\x54\x20c\x61\x74\x65\x67o\x72\x69\x65s\x20\x46\x52O\x4d\x20s\x74\x61\x66\x66\x20W\x48E\x52E\x20s\x74a\x66\x66_\x69d\x20=\x20\x27"."$y"."\x27") OR die("\x43\x61\x6et\x20\x71\x75e\x72\x79\x3a\x20".mysql_error());
$k = mysql_fetch_object($c);$m = mysql_query("\x53\x45\x4cE\x43\x54\x20s\x65\x73\x73\x69o\x6e\x2c\x20t\x65\x72\x6d \x46\x52O\x4d\x20\x73\x65\x74t\x69n\x67s\x20O\x52D\x45\x52 \x62y\x20i\x64\x20\x44\x45S\x43 \x4cI\x4dI\x54\x20\x31") OR die("\x43\x61\x6et\x20\x71\x75e\x72\x79\x3a\x20".mysql_error());
$f = mysql_fetch_object($m);$n = $f->session;$i = $f->term;$fk = "";$fm = "";if(isset($_POST["\x67\x6f"]) ){$ff = $_POST["\x74\x65\x72\x6d"];
$fn = $_POST["\x74\x79\x70\x65"];$fi = $_POST["\x63\x6c\x61\x73\x73"];$fh = $_POST["\x63\x61\x74\x65\x67\x6f\x72\x79"];if($fn != "" || $fh != "" || $ff != ""){
if($fh == 1){$fy = "\x53\x45\x4cE\x43\x54\x20*\x20\x46\x52\x4fM\x20\x73\x74u\x64\x65\x6et\x2c\x20t\x65\x61\x5f\x63\x6fm\x6de\x6et\x20W\x48E\x52\x45 \x74e\x61_\x63\x6f\x6d\x6de\x6et\x2ec\x6ca\x73\x73\x74\x65\x61\x63h\x65r\x20\x3d\x27"."$y"."\x27\x20\x41N\x44\x20\x73t\x75\x64\x65\x6et\x2e\x73\x74u\x64\x65\x6et\x5f\x49d\x20\x3d\x20\x74\x65a\x5fc\x6fm\x6de\x6et\x2e\x73t\x75d\x65n\x74\x5f\x49\x64 \x41N\x44 \x74e\x61\x5f\x63\x6f\x6d\x6de\x6et\x2e\x74\x65\x72\x6d \x3d \x27"."$ff"."\x27\x20\x41N\x44\x20\x74e\x61\x5f\x63\x6fm\x6d\x65\x6et\x2e\x63\x6ca\x73\x73 \x3d\x20\x27"."$fi"."\x27\x20\x41N\x44\x20\x74e\x61\x5f\x63\x6fm\x6d\x65\x6et\x2e\x72\x65s\x74\x79p\x65\x20\x3d\x20\x27"."$fn"."\x27\x20\x41N\x44\x20\x74e\x61\x5f\x63\x6fm\x6d\x65\x6et\x2e\x73\x65s\x73\x69o\x6e\x20\x3d\x20\x27"."$n"."\x27";
}elseif($fh == 2){$fy = "\x53\x45\x4cE\x43\x54\x20*\x20\x46\x52\x4fM\x20\x73\x74u\x64\x65\x6et\x2c\x20h\x6f\x75\x73\x65\x5fc\x6fm\x6de\x6et\x20W\x48\x45R\x45 \x68o\x75\x73\x65\x5fc\x6fm\x6de\x6et\x2e\x68\x6f\x75\x73\x65t\x75t\x6f\x72\x20\x3d\x27"."$y"."\x27\x20\x41N\x44\x20\x73t\x75\x64\x65\x6et\x2e\x73\x74u\x64\x65\x6et\x5f\x49d\x20\x3d\x20\x68\x6fu\x73e\x5fc\x6fm\x6de\x6e\x74.\x73t\x75d\x65\x6e\x74\x5fI\x64 \x41N\x44 \x68\x6f\x75\x73\x65\x5fc\x6fm\x6d\x65\x6e\x74\x2et\x65r\x6d\x20=\x20'"."$ff"."\x27\x20\x41N\x44\x20\x68o\x75\x73\x65\x5fc\x6f\x6d\x6de\x6e\x74\x2ec\x6c\x61s\x73\x20\x3d\x20\x27"."$fi"."\x27\x20\x41N\x44\x20\x68o\x75\x73\x65\x5fc\x6f\x6d\x6de\x6e\x74\x2er\x65\x73t\x79\x70\x65\x20\x3d \x27"."$fn"."\x27\x20\x41N\x44\x20\x68o\x75\x73\x65\x5fc\x6f\x6d\x6de\x6e\x74\x2es\x65\x73s\x69\x6f\x6e\x20\x3d \x27"."$n"."\x27";
}elseif($fh == 3){$fy = "\x53\x45\x4cE\x43\x54\x20*\x20\x46\x52\x4fM\x20\x73\x74u\x64\x65\x6et\x2c\x20p\x72\x69\x6e\x63\x69p\x61l\x5fc\x6fm\x6de\x6e\x74 \x57H\x45R\x45\x20\x70\x72i\x6ec\x69p\x61l\x5f\x63\x6f\x6d\x6d\x65n\x74.\x70\x72\x69\x6e\x63i\x70a\x6c\x20=\x27"."$y"."\x27\x20\x41N\x44\x20\x73t\x75\x64\x65\x6et\x2e\x73\x74u\x64\x65\x6et\x5f\x49d\x20\x3d\x20\x70\x72i\x6ec\x69p\x61l\x5fc\x6f\x6dm\x65n\x74.\x73\x74\x75\x64e\x6et\x5fI\x64 \x41\x4e\x44\x20\x70\x72i\x6ec\x69\x70\x61\x6c\x5fc\x6fm\x6d\x65n\x74.\x74\x65\x72\x6d\x20\x3d \x27"."$ff"."\x27\x20\x41N\x44\x20\x70r\x69\x6e\x63\x69p\x61\x6c\x5fc\x6f\x6d\x6de\x6e\x74.\x63\x6c\x61\x73\x73 \x3d \x27"."$fi"."\x27\x20\x41N\x44\x20\x70r\x69\x6e\x63\x69p\x61\x6c\x5fc\x6f\x6d\x6de\x6e\x74.\x72\x65\x73\x74\x79p\x65 \x3d \x27"."$fn"."\x27\x20\x41N\x44\x20\x70r\x69\x6e\x63\x69p\x61\x6c\x5fc\x6f\x6d\x6de\x6e\x74.\x73\x65\x73\x73\x69o\x6e \x3d \x27"."$n"."\x27";
}$fd = mysql_query($fy) OR die("\x43\x61\x6en\x27\x74\x20s\x65\x6c\x65\x63t\x20\x73\x74u\x64\x65\x6et\x20\x74a\x62\x6c\x65". mysql_error());
if(mysql_num_rows($fd)>0){while($b = mysql_fetch_array($fd)){
$fm .=
"\x3c\x74\x72>\x3c\x66\x6fr\x6d\x20\x6d\x65t\x68\x6f\x64=\x70\x6f\x73t\x20\x61c\x74\x69\x6f\x6e\x3d'\x27>					<\x74\x64 \x61l\x69g\x6e\x3d\x72\x69g\x68t><\x73t\x72\x6f\x6e\x67>\x53t\x75d\x65\x6e\x74\x20\x4ea\x6de\x3c\x2fs\x74r\x6f\x6e\x67>\x3c\x2ft\x64>
					<\x74d>\x3ci\x6ep\x75t\x20t\x79p\x65\x3dh\x69\x64d\x65n\x20\x6ea\x6d\x65=\x63a\x74\x20\x76a\x6c\x75\x65=\x27"."$fh"."\x27>
					\x3c\x69\x6ep\x75\x74\x20t\x79\x70\x65=\x68\x69d\x64\x65\x6e\x20\x6ea\x6de\x3dt\x79p\x20v\x61\x6cu\x65=\x27"."$fn"."\x27>
					\x3c\x69\x6ep\x75\x74\x20t\x79\x70\x65=\x68\x69d\x64\x65\x6e\x20\x6ea\x6de\x3dt\x65r\x6d \x76\x61l\x75e\x3d'"."$ff"."\x27>
					\x3c\x69\x6ep\x75\x74\x20t\x79\x70\x65=\x68\x69d\x64\x65\x6e\x20\x6ea\x6de\x3dc\x6ca\x73s\x20\x76a\x6cu\x65=\x27"."$fi"."\x27>
					\x3c\x69\x6ep\x75\x74\x20t\x79\x70\x65=\x68\x69d\x64\x65\x6e\x20\x6ea\x6de\x3ds\x74u\x64i\x64\x5b]\x20v\x61l\x75\x65\x3d"
.$b["\x73\x74\x75\x64\x65\x6e\x74\x5f\x49\x64"].">					\x3ci\x6e\x70\x75\x74 \x74\x79\x70e\x3d\x27\x74e\x78\x74'\x73\x69\x7a\x65\x20=\x274\x35'\x20r\x65a\x64\x6fn\x6cy\x3d'\x72\x65\x61\x64o\x6el\x79'\x20n\x61\x6d\x65\x3d\x27\x73t\x75d\x65\x6e\x74\x6e\x61m\x65[\x5d\x27 \x76a\x6c\x75\x65\x3d\x27"."$b"."\x5b\x73\x75r\x6e\x61\x6de\x5d\x26\x6e\x62s\x70\x3b"."$b"."\x5b\x66\x69r\x73\x74\x5fn\x61\x6d\x65\x5d&\x6e\x62\x73p\x3b"."$b"."\x5b\x6f\x74h\x65\x72\x5fn\x61\x6d\x65\x5d'>"
."\x3c\x2f\x74d>				\x3c\x2f\x74r>"
;if($fh == 1){
$fm .= "\x3c\x74\x72>					\x3c\x74\x64 \x61\x6c\x69g\x6e\x3d\x72i\x67\x68t>\x3c\x73\x74\x72o\x6eg>C\x6ca\x73s\x20\x54e\x61c\x68e\x72\x27\x73\x20C\x6fm\x6de\x6et\x3c\x2f\x73\x74\x72\x6fn\x67>\x3c\x2f\x74\x64>
					<\x74\x64>\x3c\x74\x65x\x74a\x72\x65a\x20\x63o\x6cs\x3d5\x30\x20r\x6fw\x73=\x32 \x6ea\x6d\x65=\x27\x74x\x74[\x5d\x27 >"."$b"."\x5b\x63\x6fm\x6d\x65\x6et\x5d\x3c\x2f\x74e\x78\x74\x61r\x65\x61><\x2f\x74d>
				<\x2ft\x72>"
; 
}elseif($fh == 2){
$fm .= "\x3c\x74\x72>					\x3c\x74\x64 \x61\x6c\x69g\x6e\x3d\x72i\x67\x68t>\x3c\x73\x74\x72o\x6eg>H\x6fu\x73e\x20\x54u\x74o\x72'\x73\x20\x43\x6fm\x6de\x6et\x3c/\x73\x74\x72\x6f\x6e\x67>\x3c/\x74\x64>
					<\x74d>\x3c\x74\x65\x78\x74a\x72e\x61\x20c\x6f\x6cs\x3d5\x30 \x72\x6fw\x73=\x32 \x6ea\x6de\x3d\x27t\x78\x74[\x5d'\x20>"."$b"."\x5b\x63\x6fm\x6d\x65\x6et\x5d\x3c\x2f\x74e\x78\x74\x61r\x65\x61><\x2f\x74d>
				<\x2ft\x72>"
; 
}elseif($fh == 3){
$fm .= "\x3c\x74\x72>					\x3c\x74\x64 \x61\x6c\x69g\x6e\x3d\x72i\x67\x68t>\x3c\x73\x74\x72o\x6eg>P\x72i\x6ec\x69\x70a\x6c'\x73 \x43\x6f\x6d\x6de\x6et\x3c/\x73t\x72\x6f\x6e\x67>\x3c/\x74d>
					\x3c\x74d><\x74\x65\x78\x74\x61\x72e\x61 \x63\x6fl\x73\x3d5\x30 \x72o\x77\x73=\x32 \x6ea\x6de\x3d'\x74\x78t\x5b\x5d'\x20>"."$b"."\x5b\x63\x6fm\x6d\x65\x6et\x5d\x3c\x2f\x74e\x78\x74\x61r\x65\x61><\x2f\x74d>
				<\x2ft\x72>"
; 
}
$fm .= "\x3c\x74\x72>					\x3c\x74\x64 \x63\x6f\x6cs\x70\x61\x6e=\x32><\x68\x72>\x3c\x2ft\x64>
				\x3c\x2ft\x72>"
;;}
$fm .= "\x3c\x74\x72>					\x3c\x74\x64 \x63\x6f\x6cs\x70\x61\x6e=\x32>&\x6e\x62\x73\x70\x3b<\x2ft\x64>
				<\x2ft\x72>\x3c\x74\x72>
					\x3c\x74\x64\x20\x63\x6fl\x73p\x61\x6e\x3d\x32><\x69n\x70\x75t\x20t\x79\x70\x65\x3d\x73\x75b\x6di\x74\x20 \x6e\x61m\x65=\x73u\x62\x6di\x74 \x20v\x61l\x75e\x3d\x53u\x62\x6di\x74 \x20\x2f>\x3c\x2ff\x6fr\x6d>\x3c/\x74\x64>
				\x3c\x2f\x74\x72>"
;}else{$fk= message("\x4e\x6f\x20C\x6f\x6d\x6de\x6e\x74\x20\x68a\x73\x20\x62e\x65\x6e\x20m\x61\x64e\x2e\x20\x43\x6c\x69c\x6b \x6fn\x20E\x6et\x65\x72 \x43o\x6dm\x65\x6e\x74\x20t\x6f \x6da\x6be\x20\x79\x6f\x75\x72\x20c\x6fm\x6d\x65\x6e\x74", "\x77\x61\x72n");
}}else{$fk = message("\x41\x6c\x6c \x74\x68\x65 \x66\x69\x65\x6cd\x73\x20\x6du\x73\x74\x20b\x65\x20s\x65\x6c\x65\x63\x74e\x64", "\x77\x61\x72n");
}}
?>

Function Calls

session_start 1

Variables

None

Stats

MD5 0a4b836a6b77088df74be4de75f9b186
Eval Count 0
Decode Time 104 ms