HEX
Server: Apache
System: Linux www3.pit.tblive.com 5.14.0-687.38.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 12 17:19:12 EDT 2026 x86_64
User: awaldron (1020)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //home/awaldron/_accomods/_apibak/schoolLookup.php
<?php
	
	include('cors.php');
	
	function stripAttributes( $html, $emptyText='' ) {
		$find = ['&nbsp;', '’', '“', '”', 'o:p', '–'];
		$repl = ['', "'", '"', '"', 'p'. '-'];
		$html = preg_replace("/<([a-z][a-z0-9]*)[^>]*?(\/?)>/si",'<$1$2>', $html);
		$html = str_ireplace($find, $repl, $html);
		$html = strip_tags($html, ['p','a','br','ul','li','ol','sub','sup','strike','i','b','strong']);
		return (empty($html) ? $emptyText : $html);
	}
	
	cors();
	
	$codes = file('schoolCodes.txt');
	$codeIn = $_GET['sc'];
	$returnCode = [];
	$codeFound = false;
	
	foreach($codes as $line) {
		$info = explode('||', $line);
		$code1 = preg_replace('/[^a-zA-Z0-9]/','', strtolower($info[1]));
		$code2 = preg_replace('/[^a-zA-Z0-9]/','', strtolower($codeIn));

		if ($code1 === $code2) {
			$codeFound = true;
			$returnCode = $info;
		}
	}
	
	if ($codeFound) {
		$data = ['success'=>true, 'schoolName'=>$returnCode[0], 'schoolCode'=>$returnCode[1]];
	}
	else {
		$data = ['success'=>false, 'data'=>null];
	}

	
	header('Content-Type: application/json');
	echo json_encode($data);