$value) { foreach ($_POST as $key => $value) { $$key = $value; } } $a=$_REQUEST["a"]; switch (@$a) { case "upload": $v = CheckImage(); if ($v == 1) { insert_data($conn,1); displayform(); }else{ $errMsg ="
Note:
Picture not uploaded.
You can upload a JPG, GIF, or PNG file. (Maximum size of 30KB)
This picture will reflect as one of the identities on your Admission Certificate. So, it should be your own and latest photograph. (Please note that uploading irrelevant photograph may lead to disqualification of applicant)
"; displayform(); } break; default: displayform(); } function displayform() { global $conn,$temp,$userId,$errMsg; ?>


:: Upload Photo
 
0) { echo ""; }else{ echo ""; } OCIFreeStatement($stmt); ?> 0){ echo $errMsg ?> You can upload a JPG, GIF, or PNG file. (Maximum size of 30KB)
This picture will reflect as one of the identities on your Admission Certificate. So, it should be your own and latest photograph. (Please note that uploading irrelevant photograph may lead to disqualification of applicant)
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); } ?> 500) if($FILE_SIZE > 30) $return = 0; else $return = 1; } } return $return; } /* function insert_data($conn,$flage) { global $conn,$userId; $lob = OCINewDescriptor($conn, OCI_D_LOB); $sql="Update CSS_APP_GENERAL set CSS_PHOTO=EMPTY_BLOB() where CSS_APPLICANT_ID=$userId RETURNING CSS_PHOTO INTO :CSS_PHOTO"; // echo $sql; exit; $stmt = OCIParse($conn, $sql); OCIBindByName($stmt, ':CSS_PHOTO', $lob, -1, OCI_B_BLOB); OCIExecute($stmt, OCI_DEFAULT); // echo $sql; exit; // The function $lob->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); } function CheckImage(){ // 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) $return = 0; else $return = 1; } } return $return; }*/ ?>