|
Server IP : 86.38.243.193 / Your IP : 216.73.217.143 Web Server : LiteSpeed System : Linux in-mum-web1336.main-hosting.eu 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64 User : u493057690 ( 493057690) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : ON Directory (0755) : /home/u493057690/domains/iasfindia.com/public_html/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
require_once 'admin/connect.php';
if(ISSET($_POST['add_registration'])){
$sql = "Select serial_id from registration order by id desc limit 1";
$run = mysqli_query($conn,$sql);
if(mysqli_num_rows($run) > 0){
$row = mysqli_fetch_array($run);
$serial_id = $row['serial_id'];
$serial_id = ++$serial_id;
}
else{
$serial_id = "IASF/INC/1001";
}
$name = $_POST['name'];
$father_name = $_POST['father_name'];
$dob = $_POST['dob'];
$address = $_POST['address'];
$contact_no = $_POST['contact_no'];
$emailid = $_POST['emailid'];
$state = $_POST['state'];
$dist = $_POST['dist'];
$country = $_POST['country'];
$sport = $_POST['sport'];
$designation = $_POST['designation'];
$adhar_no = $_POST['adhar_no'];
$age_category = $_POST['age_category'];
$coach = $_POST['coach'];
$reg_date = $_POST['reg_date'];
$t_name = $_POST['t_name'];
$uploadedfile="uploadedfile1" ;
$file_type = $_FILES[$uploadedfile]['type'];
$file_name = $_FILES[$uploadedfile]['name'];
$file_name= str_replace(" ","_",$file_name);
if($file_name!="")
{
$file_ext = strtolower(substr($file_name,strrpos($file_name,".")));
$FILE_MIMES = array('application/rtf','application/doc','application/pdf','image/jpeg','image/jpg','image/gif','image/png','image/tiff','image/bmp');
$FILE_EXTS = array('.rtf','.docx','.doc','.pdf','.jpeg','.jpg','.JPG','.gif','.GIF','.png','.PNG','.tiff','.TIFF','.bmp','.BMP');
if (!in_array($file_type, $FILE_MIMES) && !in_array($file_ext, $FILE_EXTS) )
{
echo "Sorry, $file_name($file_type) is not allowed to be uploaded.";
exit();
}
$target_path="files/";
if(is_dir("files/".strtotime("now")))
{
$t_path=strtotime("now");
$target_path =$target_path.$t_path;
$target_path =$target_path."/";
$target_path = $target_path . $file_name;
}
else
{
mkdir(("files/".strtotime("now")),0777, true);
$t_path=strtotime("now");
$target_path =$target_path.$t_path;
$target_path =$target_path."/";
$target_path = $target_path . $file_name;
}
$_FILES[$uploadedfile]['tmp_name'];
if(move_uploaded_file($_FILES[$uploadedfile]['tmp_name'], $target_path))
{
$f_name=$target_path;
}
}
else
{
$f_name="null";
}
$uploadedfile2="uploadedfile2" ;
$file_type = $_FILES[$uploadedfile2]['type'];
$file_name = $_FILES[$uploadedfile2]['name'];
$file_name= str_replace(" ","_",$file_name);
if($file_name!="")
{
$file_ext = strtolower(substr($file_name,strrpos($file_name,".")));
$FILE_MIMES = array('application/rtf','application/doc','application/pdf','image/jpeg','image/jpg','image/gif','image/png','image/tiff','image/bmp');
$FILE_EXTS = array('.rtf','.docx','.doc','.pdf','.jpeg','.jpg','.JPG','.gif','.GIF','.png','.PNG','.tiff','.TIFF','.bmp','.BMP');
if (!in_array($file_type, $FILE_MIMES) && !in_array($file_ext, $FILE_EXTS) )
{
echo "Sorry, $file_name($file_type) is not allowed to be uploaded.";
exit();
}
$target_path="files/";
if(is_dir("files/".strtotime("now")))
{
$t_path=strtotime("now");
$target_path =$target_path.$t_path;
$target_path =$target_path."/";
$target_path = $target_path . $file_name;
}
else
{
mkdir(("files/".strtotime("now")),0777, true);
$t_path=strtotime("now");
$target_path =$target_path.$t_path;
$target_path =$target_path."/";
$target_path = $target_path . $file_name;
}
$_FILES[$uploadedfile2]['tmp_name'];
if(move_uploaded_file($_FILES[$uploadedfile2]['tmp_name'], $target_path))
{
$f_name1=$target_path;
}
}
else
{
$f_name1="null";
}
$uploadedfile3="uploadedfile3" ;
$file_type = $_FILES[$uploadedfile3]['type'];
$file_name = $_FILES[$uploadedfile3]['name'];
$file_name= str_replace(" ","_",$file_name);
if($file_name!="")
{
$file_ext = strtolower(substr($file_name,strrpos($file_name,".")));
$FILE_MIMES = array('application/rtf','application/doc','application/pdf','image/jpeg','image/jpg','image/gif','image/png','image/tiff','image/bmp');
$FILE_EXTS = array('.rtf','.docx','.doc','.pdf','.jpeg','.jpg','.JPG','.gif','.GIF','.png','.PNG','.tiff','.TIFF','.bmp','.BMP');
if (!in_array($file_type, $FILE_MIMES) && !in_array($file_ext, $FILE_EXTS) )
{
echo "Sorry, $file_name($file_type) is not allowed to be uploaded.";
exit();
}
$target_path="files/";
if(is_dir("files/".strtotime("now")))
{
$t_path=strtotime("now");
$target_path =$target_path.$t_path;
$target_path =$target_path."/";
$target_path = $target_path . $file_name;
}
else
{
mkdir(("files/".strtotime("now")),0777, true);
$t_path=strtotime("now");
$target_path =$target_path.$t_path;
$target_path =$target_path."/";
$target_path = $target_path . $file_name;
}
$_FILES[$uploadedfile3]['tmp_name'];
if(move_uploaded_file($_FILES[$uploadedfile3]['tmp_name'], $target_path))
{
$f_name2=$target_path;
}
}
else
{
$f_name2="null";
}
// $sql11 = "SELECT name, dob FROM registration WHERE t_name = '".$t_name."' AND name = '".$name."' AND dob = '".$dob."'";
//$run = mysqli_query($mysqli, $sql11);
// $chk = mysqli_num_rows($run);
//if($chk>0)
//{
//echo '100';
//}
//else
//{
//$sql = "insert into registration(serial_id, name, father_name, dob, address, contact_no, emailid, state, dist, country, sport, designation, adhar_no, age_category, photo, adhar_card, signature, coach, reg_date, result, status, t_name) values('$serial_id', '$name', '$father_name', '$dob', '$address', '$contact_no', '$emailid', '$state', '$dist', '$country', '$sport', '$designation', '$adhar_no', '$age_category', '$f_name', '$f_name1', '$f_name2', '$coach', '$reg_date', 'Not Decided', 'Pending', 'Tournament Name')";
// if($mysqli->query($sql) === true){
// echo "101";
// }
// else{
// echo '102';
// }
// }
//$mysqli->close();
$sql = "INSERT INTO `registration` (serial_id, name, father_name, dob, address, contact_no, emailid, state, dist, country, sport, designation, adhar_no, age_category, photo, adhar_card, signature, coach, reg_date, result, status, t_name) VALUES('$serial_id', '$name', '$father_name', '$dob', '$address', '$contact_no', '$emailid', '$state', '$dist', '$country', '$sport', '$designation', '$adhar_no', '$age_category', '$f_name', '$f_name1', '$f_name2', '$coach', '$reg_date', 'Not Decided', 'Pending', '2ND NATIONAL AMATEUR GAMES 2022')";
mysqli_query($conn,$sql);
echo "<script>alert(\"Registration Successfully\")</script>";
echo "<script> window.location=\"thank-you.php\"</script>";
}
?>