| Server IP : 104.21.80.248 / Your IP : 172.71.28.156 Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30 System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586 User : SYSTEM ( 0) PHP Version : 5.6.30 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Inetpub/www/news/sfadmin/ |
Upload File : |
<?php
include('../db.php');
if($_POST)
{
if(!isset($_POST['cat-selecter']) || strlen($_POST['cat-selecter'])<1)
{
//required variables are empty
die('<div class="Msg-Error">Please Select a Category!!</div>');
}
if(!isset($_POST['img-url']) || strlen($_POST['img-url'])<1)
{
//required variables are empty
die('<div class="Msg-Error">Image URL is empty!!</div>');
}
if(!isset($_POST['story-title']) || strlen($_POST['story-title'])<1)
{
//required variables are empty
die('<div class="Msg-Error">Story title is empty!</div>');
}
if(!isset($_POST['story-description']) || strlen($_POST['story-description'])<1)
{
//required variables are empty
die('<div class="Msg-Error">Story description is empty!</div>');
}
$storytitle = $mysqli->escape_string($_POST['story-title']); // file title
$storyurl = $mysqli->escape_string($_POST['story-url']);//Image Source
$storydescription = $mysqli->escape_string($_POST['story-description']);//Image Source
$image = $mysqli->escape_string($_POST['img-url']);//Image Source
$catid = $mysqli->escape_string($_POST['cat-selecter']);//Image Source
$storyid = $mysqli->escape_string($_POST['story-id']); // Video Id
$mysqli->query("UPDATE posts SET title='$storytitle',description='$storydescription',url='$storyurl',image='$image',cat_id='$catid' WHERE id='$storyid'");
die('<div class="msg-ok">Yor post updated successfully</div>');
}else{
die('<div class="msg-error">There seems to be a problem. please try again.</div>'); //output error
}
?>