D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
u166148318
/
domains
/
avrd.org
/
public_html
/
admin
/
Filename :
client.php
back
Copy
<?php include '../components/connect.php' ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Client</title> <!-- font awesome cdn link --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css"> <!-- custom css file link --> <link rel="stylesheet" href="./css/admin_style.css"> </head> <body> <!-- header section starts --> <?php include '../components/admin_header.php'; ?> <!-- header section ends --> <!-- register section starts --> <section class="form-container"> <form action="" method="POST" enctype="multipart/form-data"> <h3>Add Client's Testimony</h3> <?php if(isset($_POST['submit'])){ $name = $_POST['name']; $profession = $_POST['profession']; $testimony = $_POST['testimony']; $image_01 = $_FILES['client_pic']['name']; $image_01 = filter_var($image_01, FILTER_SANITIZE_STRING); $image_01_ext = pathinfo($image_01, PATHINFO_EXTENSION); $rename_image_01 = uniqid("pic", true).'.'.$image_01_ext; $image_01_tmp_name = $_FILES['client_pic']['tmp_name']; $image_01_size = $_FILES['client_pic']['size']; $image_01_folder = 'client/'.$rename_image_01; if($image_01_size > 2000000){ $warning_msg[] = 'image 01 size too large!'; }else{ $insert_testimony = $conn->prepare("INSERT INTO `testimony`(id, name, profession, testimony, client_pic) VALUES(?,?,?,?,?)"); $insert_testimony->execute([null, $name, $profession, $testimony, $image_01_folder,]); move_uploaded_file($image_01_tmp_name, $image_01_folder); if ($insert_testimony){ echo "<font size='3px' padding='5px' color='green' text-align='center'>Testimony added successfully.</font>"; }else{ echo "<font size='3px' padding='5px' color='red' text-align='center'>OOoops something went wrong, try again later.</font>"; } } } ?> <label for="client_pic"><h2>choose a Picture</h2> </label> <input type="file" name="client_pic" id="" required > <input type="text" name="name" placeholder="Type member's Name" maxlength="80" class="box" required > <input type="text" name="profession" placeholder="Type member's profession'" maxlength="80" class="box" required > <textarea name="testimony" placeholder="type the testimony" required cols="20" rows="5" class="box" required required ></textarea> <input type="submit" value="Add now" name="submit" class="btn"> <center> <a href="./view_testimony.php" ><h2>View My Testimonies</h2> </a> </center> </form> </section> <!-- register section ends --> <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js"></script> <!-- custom js file link --> <script src="./js/admin_script.js"></script> <?php include '../components/message.php'; ?> </body> </html>