D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ipuco
/
public_html
/
superadmin
/
Filename :
testimonialsdata-add.php
back
Copy
<?php ob_start(); session_start(); include('include/connection.php'); @$emailid=$_SESSION['emailid']; @$adminid=$_SESSION['id']; $per=mysqli_query($conn,"select * from admin where id='".$adminid."'"); $perq1=mysqli_fetch_array($per); if(isset($_POST['submit'])) { $heading = $_POST['heading']; //$shortdescription = $_POST['shortdescription']; $description=addslashes($_POST['description']); $file_name1 = $_FILES['image1']['name']; $random_digit1 = rand(0000,9999); $new_file_name1 = $random_digit1.$file_name1; $path1 = "upload/".$new_file_name1; copy($_FILES['image1']['tmp_name'], $path1); $postedby = $_POST['postedby']; $status = '0'; if(mysqli_query($conn,"insert into testimonialsdata values('','$heading','$description','$new_file_name1','$postedby','$status')")) { ?> <script type="text/javascript"> alert("Data Inserted Successfully"); window.location="list-of-testimonialsdata.php"; </script> <?php } else { ?> <script type="text/javascript"> alert("Error! Data Not Inserted"); window.location="list-of-testimonialsdata.php"; </script><?php echo mysql_error(); } } ?>