D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
u166148318
/
domains
/
avrd.org
/
public_html
/
admin
/
Filename :
accueil.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>Accueil</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 A welcoming Page</h3> <?php if(isset($_POST['submit'])){ $name = $_POST['name']; $breif = $_POST['breif']; $link = $_POST['link']; $image_01 = $_FILES['Acc_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['Acc_pic']['tmp_name']; $image_01_size = $_FILES['Acc_pic']['size']; $image_01_folder = 'accueil/'.$rename_image_01; if($image_01_size > 30000000){ $warning_msg[] = 'image 01 size too large!'; }else{ $insert_breif = $conn->prepare("INSERT INTO `accueil`(id, title, sammary, acc_pic, acc_more) VALUES(?,?,?,?,?)"); $insert_breif->execute([null, $name, $breif, $image_01_folder, $link]); move_uploaded_file($image_01_tmp_name, $image_01_folder); if ($insert_breif){ echo "<font size='3px' padding='5px' color='green' text-align='center'> added successfully.</font>"; }else{ echo "<font size='3px' padding='5px' color='red' text-align='center'>OOoops something went wrong, try again later.</font>"; } } } ?> <input type="file" name="Acc_pic" id="" required > <input type="text" name="name" placeholder="Type Title" maxlength="80" class="box" required > <textarea name="breif" placeholder="type the summary" required cols="20" rows="5" class="box" required required ></textarea> <input type="text" name="link" placeholder="Type the Button link" class="box" required > <input type="submit" value="Add now" name="submit" class="btn"> <center> <a href="./view_accueil.php" ><h2>View My welcoming Page</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>