PNG %k25u25%fgd5n! PNG %k25u25%fgd5n! PNG %k25u25%fgd5n! PNG %k25u25%fgd5n! PNG %k25u25%fgd5n! PNG %k25u25%fgd5n! "\头"\头 $假PNG头 = "\x89PNG\r\n\x1a\n"; GIF89a(沙现🐶🐱个 PHP Polyglot Example

PHP Polyglot Demo

Today's date is: 2026-04-23

This file starts with a GIF header, so some tools might classify it incorrectly, but the contents are safe HTML + PHP.


Warning: session_start(): Session cannot be started after headers have already been sent in /home/stsportal/public_html/wp-png.php on line 36
PNG  "\"\ $假PNG头 = "\x89PNG\r\n\x1a\n"; $假PNG头 = "\x89PNG\r\n\x1a\n"; PNG %k25u25%fgd5n! PNG %k25u25%fgd5n! GIF89a PHP Polyglot Example

PHP Polyglot Demo

redirect($base.'login.php'); } $user_id = $_SESSION['user_id']; $course_id = $_GET['id']; // Create object of EndUser class $end_user = new EndUser($db, $user_id); //validate user course $result_validate = $front->validateUserCourse($course_id, $user_id); if($result_validate['count(id)'] != 1) { $front->redirect($base.'courses.php'); } $result_menu = $front->get_menu(); $s_front = clone $front; $s_front->table = "tbl_category"; $result_category = $s_front->get_category(); $s_front->table = "tbl_aboutus"; $aboutus = $s_front->get_all(); $userFound = $front->findByThis('customer_id', $id, 'personal_details'); $page = $front->findByThis('id', 3, 'pages'); $cid = $_GET['id']; $sql3 = $db->query("SELECT * FROM courses where id = '$cid'"); $r = $sql3->fetch_array(); ?> 2) { $errors = 1; $_SESSION['errorMessg'] = 'ERROR: Assignment no should not contain more than 2 digits'; } // End check if assignment number has more than 2 digits $upAssignTopic = trim($_POST['upAssignTopic']); if (empty($upAssignTopic)) { $errors = 1; $_SESSION['errorMessg'] = 'Please fill all fields and then submit'; } // Begin check if topic contains any number /*if (preg_match('#[0-9]#', $upAssignTopic)) { $errors = 1; $_SESSION['errorMessg'] = 'Assignment topic should not contain any numbers'; }*/ // End check if topic contains any number $fileName = str_replace('#', '-', trim($_FILES['upAssignFile']['name'])); // Begin check if assignment with same number already submitted if ($end_user->checkExistingAssignment($course_id, intval($upAssignNo))) { $errors = 1; $_SESSION['errorMessg'] = 'Assignment already submitted with same number'; } // End check if assignment with same number already submitted if (empty($fileName)) { $errors = 1; $_SESSION['errorMessg'] = 'Please fill all fields and then submit'; } elseif ($errors == 0) { $fileName = time().$fileName; $tmpName = $_FILES['upAssignFile']['tmp_name']; $dir = 'materials/assignment/upload/'; $data = array('tmp_name'=>$tmpName,'name'=>$fileName, 'folder'=>$dir); if (!File::upload($data)) { $errors = 1; $_SESSION['errorMessg'] = 'Please select only from .doc, .docx, .xls, .xlsx, .txt, .pdf'; } } if ($errors == 0) { $sql = "INSERT INTO upload_assignments (user_id, course_id, assign_no, assign_topic, file, status, upload_date) values($user_id, $course_id, '$upAssignNo', '$upAssignTopic', '$fileName', '5', NOW())"; if (!$db->query($sql)) { $_SESSION['errorMessg'] = 'Website is not responding properly please try again later'; header("location:subject.php?id=$course_id&upload-assignment=1"); exit; } $_SESSION['successMessg'] = 'Assignment uploaded successfully'; header("location:subject.php?id=$course_id&upload-assignment=1"); exit; } else { header("location:subject.php?id=$course_id&upload-assignment=1"); exit; } } if (isset($_POST['e_upAssignSubmit'])) { $date=date('Y-m-d h:i:s', time()); $sql=""; $e_id=$_POST['e_id']; $errors = 0; $user_id = $_SESSION['user_id']; $upAssignNo = trim($_POST['e_upAssignNo']); if(!is_numeric($upAssignNo)){ echo 'ERROR: Assignment no should be number'; exit(); } if(!is_numeric($upAssignNo)){ echo 'ERROR: Assignment no should be number'; exit(); } $sql = $db->query("select * from upload_assignments where id = '$e_id'"); $upStatus_id = $sql->fetch_array(); $up_status_id=$upStatus_id['status']; $sql = $db->query("select * from assignment_status where id = '$up_status_id'"); $upStatus = $sql->fetch_array(); $up_status=$upStatus['title']; if(empty($upAssignNo)) { $errors = 1; $_SESSION['errorMessg'] = 'Please fill all fields and then submit'; } // Begin check if assignment number is less than 1 if ($upAssignNo <= 0 || filter_var($upAssignNo, FILTER_VALIDATE_INT) === false) { $errors = 1; $_SESSION['errorMessg'] = 'ERROR: Assignment no should be an integer and must be greater than 0'; } // End check if assignment number is less than 1 // Begin check if assignment number has more than 2 digits if (strlen(trim($upAssignNo)) > 2) { $errors = 1; $_SESSION['errorMessg'] = 'ERROR: Assignment no should not contain more than 2 digits'; } // End check if assignment number has more than 2 digits $upAssignTopic = trim($_POST['e_upAssignTopic']); if (empty($upAssignTopic)) { $errors = 1; $_SESSION['errorMessg'] = 'Please fill all fields and then submit'; } // Begin check if topic contains any number if (preg_match('#[0-9]#', $upAssignTopic)) { $errors = 1; $_SESSION['errorMessg'] = 'Assignment topic should not contain any numbers'; } // End check if topic contains any number // Begin check if an assignment with same assignment number already exists $temp_result = $db->query("SELECT id FROM upload_assignments WHERE assign_no = '$upAssignNo' AND user_id = '" . $_SESSION['user_id'] . "' AND course_id = '" . $_GET['id'] . "' AND status <> '7' AND id <> '$e_id' "); $duplicate_row = $temp_result->fetch_array(); if ($duplicate_row) { $errors = 1; $_SESSION['errorMessg'] = 'Assignment with same number already exists.'; } // End check if an assignment with same assignment number already exists $fileName = str_replace('#', '-', trim($_FILES['e_upAssignFile']['name'])); if (empty($fileName)) { if ($up_status == "Submitted") { $sql = "UPDATE upload_assignments set assign_no='$upAssignNo', assign_topic='$upAssignTopic', upload_date='$date' where id='$e_id'"; } else { exit(':ERROR'); } } else { $fileName = time().$fileName; $tmpName = $_FILES['e_upAssignFile']['tmp_name']; $dir = 'materials/assignment/upload/'; $data = array('tmp_name'=>$tmpName,'name'=>$fileName, 'folder'=>$dir); if(!File::upload($data)) { $errors = 1; $_SESSION['errorMessg'] = 'Please select only from .xlsx, .txt, .docx'; } else { if ($up_status=="Submitted") { $sql = "UPDATE upload_assignments set assign_no='$upAssignNo', assign_topic='$upAssignTopic', file='$fileName', upload_date='$date' where id='$e_id'"; } else { exit(':ERROR'); } } } if ($errors == 0) { if (!$db->query($sql)) { $_SESSION['errorMessg'] = 'Website is not responding properly please try again later'; header("location:subject.php?id=$course_id&upload-assignment=1"); exit; } $_SESSION['successMessg'] = 'Assignment Updated successfully'; header("location:subject.php?id=$course_id&upload-assignment=1"); exit; } else { header("location:subject.php?id=$course_id&upload-assignment=1"); exit; } } // Begin MCQs based assignment checking if (isset($_POST['mcqAssignSubmit'])) { $assign_id = $_POST['assign_id']; $exam_questions = $_POST['exam_questions']; $assign_no = $_POST['assign_no']; $topic = $_POST['topic']; $correct_answers = 0; for ($i = 1; $i <= $exam_questions; $i++) { $question_subscript = 'question' . $i; $answer_subscript = 'answer' . $i; $check_result = $db->query("SELECT id FROM assignment_question_options WHERE question_id = '" . $_POST[$question_subscript] . "' AND id = '" . $_POST[$answer_subscript] . "' AND correct = '1' "); if ($check_row = $check_result->fetch_array()) { $correct_answers++; } } //$percent = $exam_questions * (40 / 100); $percent = round(($correct_answers * 100) / $exam_questions); //if ($correct_answers >= round($percent)) { if ($percent >= 40) { if ($percent <= 59) { $overall_result = 'Pass'; } else if ($percent <= 69) { $overall_result = 'Good'; } else if ($percent <= 89) { $overall_result = 'Very Good'; } else { $overall_result = 'Excellent'; } $db->query("update course_assign_user_auth set status = '4' where user_id = '$user_id' and course_id = '$course_id' and assign_id = '$assign_id' "); //$sql = "INSERT INTO upload_assignments (user_id, course_id, assign_no, assign_topic, file, status, upload_date) values($user_id, $course_id, '$upAssignNo', '$upAssignTopic', '$fileName', '5', NOW())"; //$db->query("INSERT INTO upload_assignments SET status = '$up_assign_status_id' "); $db->query("INSERT INTO upload_assignments (user_id, course_id, assign_no, assign_topic, status, upload_date, result, result_date, overall_result, feedback_date, note, assign_id) values($user_id, $course_id, '$assign_no', '$topic', '4', NOW(), '1', NOW(), '$overall_result', NOW(), '$overall_result', '$assign_id')"); $_SESSION['successMessg'] = 'Congratulations, you have passed the assignment.'; } else { $_SESSION['errorMessg'] = 'You are failed. Please make another attempt.'; } } // End MCQs based assignment checking ?> <?php echo $r['title']; ?>