-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththankyou2.php
executable file
·177 lines (165 loc) · 4.65 KB
/
thankyou2.php
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><?phpinclude_once("session.php");include_once("include/database.php"); extract($_POST); $photo=""; $file="";$objDB = new Database();?><html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8" /><title>Yearbook, 2013</title><script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19055295-4']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();</script></head><body><div id="body" class="container_12 clearfix"> <div class="grid_12 pgbody"> <div class="clearfix"><div class="grid_12 alpha omega"><div class="clearfix"><div class="grid_12 alpha omega" style="background-color:white"></div></div><div class="clearfix"><div class="grid_12 alpha omega" style="background-color:white"><div class="post"><?php /*if($_FILES['file']['name'] == "") {echo "No text file selected </br>";}else{$allowedExts = array("doc", "pdf", "docx", "txt", "odt");$extension = end(explode(".", $_FILES["file"]["name"]));if ((($_FILES["file"]["type"] == "text/plain")|| ($_FILES["file"]["type"] == "application/pdf")|| ($_FILES["file"]["type"] == "application/vnd.openxmlformats-officedocument.wordprocessingml.document")|| ($_FILES["file"]["type"] == "application/msword")|| ($_FILES["file"]["type"] == "application/vnd.oasis.opendocument.text"))&& ($_FILES["file"]["size"] < 2097152)&& in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; $filename = uniqid(rand(), true).$_FILES["file"]["name"]; move_uploaded_file($_FILES["file"]["tmp_name"], "yearbook/" . $filename); $file=$filename; } }else { echo "Invalid file </br>"; }}*/?><?php /*if($_FILES['photo']['name'] == "") {echo "No photo selected </br>";}else{$allowedExtsphoto = array("jpg", "jpeg", "gif", "png");$extensionphoto = end(explode(".", $_FILES["photo"]["name"]));if ((($_FILES["photo"]["type"] == "image/gif")|| ($_FILES["photo"]["type"] == "image/jpeg")|| ($_FILES["photo"]["type"] == "image/png")|| ($_FILES["photo"]["type"] == "image/pjpeg"))&& ($_FILES["photo"]["size"] < 1048576)&& in_array($extensionphoto, $allowedExtsphoto)) { if ($_FILES["photo"]["error"] > 0) { echo "Return Code: " . $_FILES["photo"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["photo"]["name"] . "<br />"; echo "Type: " . $_FILES["photo"]["type"] . "<br />"; echo "Size: " . ($_FILES["photo"]["size"] / 1024) . " Kb<br />"; $photoname = uniqid(rand(), true).$_FILES["photo"]["name"]; move_uploaded_file($_FILES["photo"]["tmp_name"], "yearbook/" . $photoname); $photo=$photoname; } }else { echo "Invalid photo </br>"; } }*/?><?phpif($_FILES['photo1']['name'] == "") {echo "No photo selected </br>";}else{$allowedExtsphoto = array("jpg", "jpeg", "gif", "png");$extensionphoto = end(explode(".", $_FILES["photo1"]["name"]));if ((($_FILES["photo1"]["type"] == "image/gif")|| ($_FILES["photo1"]["type"] == "image/jpeg")|| ($_FILES["photo1"]["type"] == "image/png")|| ($_FILES["photo1"]["type"] == "image/pjpeg"))&& ($_FILES["photo1"]["size"] < 1048576)&& in_array($extensionphoto, $allowedExtsphoto)) { if ($_FILES["photo1"]["error"] > 0) { echo "Return Code: " . $_FILES["photo1"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["photo1"]["name"] . "<br />"; echo "Type: " . $_FILES["photo1"]["type"] . "<br />"; echo "Size: " . ($_FILES["photo1"]["size"] / 1024) . " Kb<br />"; $photoname1 = uniqid(rand(), true).$_FILES["photo1"]["name"]; move_uploaded_file($_FILES["photo1"]["tmp_name"], "yearbook/" . $photoname1); $photo1=$photoname1; } }else { echo "Invalid photo </br>"; } }?><?php $rs=$objDB->addYearbook($name,$department,$hall,$email,$mobile,$roll,$photo1); echo "Database Entry added.";?><h1>Thank you.</h1></div></div></div></div></div></div></div><footer><center>© Office of Alumni Affairs & International Relations, IIT Kharagpur</center></footer></body></html>