PHP Classes

File: admin/insert-image.php

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra  >  Giga CMS  >  admin/insert-image.php  >  Download  
File: admin/insert-image.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Giga CMS
Multi-user content management system
Author: By
Last change:
Date: 5 years ago
Size: 756 bytes


Class file image Download
include "../inc/init.php";

$servername = "$set->db_host";
$username = "$set->db_user";
$password = "$set->db_pass";
$dbname = "$set->db_name";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
"Connection failed: " . $conn->connect_error);

$image = mysqli_real_escape_string($conn,$_POST['image']);
$title = mysqli_real_escape_string($conn,$_POST['title']);
$desc = mysqli_real_escape_string($conn,$_POST['desc']);

$query = "INSERT INTO `".MLS_PREFIX."slideshow`(`title`,`desc`,`image`) VALUES ('".$title."', '".$desc."', '".$image."')";
mysqli_query($conn,$query)or die(mysqli_error());

header("location: slideshow.php");