$value) { foreach ($_POST as $key => $value) { $$key = $value; } } $cnic=$_REQUEST[usercnic]; //echo $cnic; exit; $a=$_REQUEST["a"]; switch (@$a) { case "Exit": call_ac(); break; case "upload": $v = CheckImage(); //echo $v; exit; if ($v == 1) { insert_data($conn,1); //echo 'sala';exit; displayform(); }else{ $errMsg ="
Note:
Picture not uploaded.
You can upload a JPG, GIF, or PNG file. (Maximum size of 30KB) Do not upload photos containing children, pets, cartoons, celebrities, nudity, artwork or copyrighted images
"; displayform(); } break; default: displayform(); } function displayform() { global $conn,$temp,$userId,$errMsg, $cnic; ?>


You may now generate your Admission Certificate from the Main Menu, to proceed click on Exit Button
:: Upload Photo (Optional)
 
0) { echo ""; }else{ echo ""; } OCIFreeStatement($stmt); ?> 0){ echo $errMsg ?> You can upload a JPG, GIF, or PNG file. (Maximum size of 30KB) Do not upload photos containing children, pets, cartoons, celebrities, nudity, artwork or copyrighted images.
select photo:
 
If you want to change your picture, you can browse and upload another photo.  
 
 
savefile(...) reads from the uploaded file. // If the data was already in a PHP variable $myv, the // $lob->save($myv) function could be used instead. if(strlen($_FILES['imgfile']['name'])>0) { if(isset($_FILES['imgfile']['name'])) { if ($lob->savefile($_FILES['imgfile']['tmp_name'])) { OCICommit($conn); }else { echo "Couldn't upload Blob\n"; } } } $lob->free(); OCIFreeStatement($stmt); } header("Location: picture.php?usercnic=$mycnic"); } function CheckImage(){ //echo'salam';exit; // echo $_FILES['imgfile']['name']; exit; if ($_FILES['imgfile']['name'] != "" and ($_FILES['imgfile']['name'] != "none") ) { $FILE_NAME = $_FILES['imgfile']['name']; $FILE_SIZE = $_FILES['imgfile']['size']; $FILE_TYPE = $_FILES['imgfile']['type']; // Naughty Opera adds the filename on the end of the // mime type - we don't want this. $FILE_TYPE = preg_replace( "/^(.+?);.*$/", "\\1", $FILE_TYPE ); //echo $FILE_TYPE; switch($FILE_TYPE) { case 'image/gif': $ext = '.gif'; break; case 'image/jpeg': $ext = '.jpg'; break; case 'image/pjpeg': $ext = '.jpg'; break; case 'image/x-png': $ext = '.png'; break; default: $ext = '.zip'; break; } $real_name = $FILE_NAME.$ext; $FILE_SIZE=intval($FILE_SIZE/1024); if($ext=='.zip'){ $return = 0; }else { // if($FILE_SIZE > 500) if($FILE_SIZE > 30) $return = 0; else $return = 1; } } return $return; } function call_ac() { header( "location:../online/step1.php"); } ?>