D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
u166148318
/
domains
/
avrd.org
/
public_html
/
admin
/
Filename :
about.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>About</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 About Content </h3> <?php if(isset($_POST['submit'])){ $about = $_POST['about']; $mission = $_POST['mission']; $vision = $_POST['vision']; $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 = 'about/'.$rename_image_01; if($image_01_size > 30000000){ $warning_msg[] = 'image 01 size too large!'; }else{ $insert_about = $conn->prepare("INSERT INTO `about`(id, about, mission, vision, about_pic) VALUES(?,?,?,?,?)"); $insert_about->execute([null, $about, $mission, $vision, $image_01_folder,]); move_uploaded_file($image_01_tmp_name, $image_01_folder); if ($insert_about){ echo "<font size='3px' padding='5px' color='green' text-align='center'>About Content 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 > <textarea name="about" placeholder="type About Text" required cols="25" rows="5" class="box" required required ></textarea> <textarea name="mission" placeholder="type Mission Text " required cols="25" rows="5" class="box" required required ></textarea> <textarea name="vision" placeholder="type Vision Text" required cols="25" rows="5" class="box" required required ></textarea> <input type="submit" value="Add now" name="submit" class="btn"> <center> <a href="./view_about.php" ><h2>View My About</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>