GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.119 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/JimMartinson/CST1146/Resources/Examples/Week/15/ |
Upload File : |
<?php function beginPage($title){ echo "<!DOCTYPE html>\n"; echo "<html lang=\"en\">\n"; echo "<head>\n"; echo " <title>$title</title>\n"; echo " <meta charset=\"UTF-8\">\n"; echo "</head>\n"; echo "<body>\n"; echo " <h1>$title</h1>\n"; } function endPage(){ echo' <footer style="color:silver; font-size:smaller;">Written by Jim Martinson.</footer> </body> </html> '; } function formValue($formVariable=NULL, $defaultValue=NULL){ $value = $defaultValue; if(is_null($formVariable)){ // $formVariable is null $noValue = array(); foreach($_GET as $key => $data){ $data = htmlspecialchars(trim($data)); $noValue[$key] = $data; } foreach($_POST as $key => $data){ $data = htmlspecialchars(trim($data)); $noValue[$key] = $data; } return $noValue; }else{ if(is_array($formVariable)){ //$formVariable is an array $variableArray = array(); foreach($formVariable as $index){ if(isset($_GET[$index])) { $value = htmlspecialchars(trim($_GET[$index])); $variableArray[$index] = $value; } if(isset($_POST[$index])) { $value = htmlspecialchars(trim($_POST[$index])); $variableArray[$index] = $value; } else{ $value = NULL; $variableArray[$index] = $value; } } return $variableArray; }else{ //$formVariable is a string if(strpos($formVariable, ",") !== false){ // $formVariable has comma $array = explode(",", $formVariable); return formValue($array); }else{ // $formVariable is a plain string if(isset($_GET[$formVariable])) { $value = htmlspecialchars(trim($_GET[$formVariable]));} if(isset($_POST[$formVariable])) { $value = htmlspecialchars(trim($_POST[$formVariable]));} return $value; } } } } ?>