Server : LiteSpeed System : Linux in-mum-web1112.main-hosting.eu 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64 User : u451330669 ( 451330669) PHP Version : 8.2.27 Disable Function : NONE Directory : /home/u451330669/domains/heertourstravels.in/public_html/admin/ |
<?php
require('top.inc.php');
$video='';
$msg='';
if(isset($_GET['id']) && $_GET['id']!=''){
$id=get_safe_value($con,$_GET['id']);
$res=mysqli_query($con,"select * from video where id='$id'");
$check=mysqli_num_rows($res);
if($check>0){
$row=mysqli_fetch_assoc($res);
$video=$row['video'];
}else{
header('location:video.php');
die();
}
}
if(isset($_POST['submit'])){
$video=get_safe_value($con,$_POST['video']);
$res=mysqli_query($con,"select * from video where video='$video'");
$check=mysqli_num_rows($res);
if($check>0){
if(isset($_GET['id']) && $_GET['id']!=''){
$getData=mysqli_fetch_assoc($res);
if($id==$getData['id']){
}else{
$msg="video already exist";
}
}else{
$msg="video already exist";
}
}
if($msg==''){
if(isset($_GET['id']) && $_GET['id']!=''){
mysqli_query($con,"update video set video='$video' where id='$id'");
}else{
mysqli_query($con,"insert into video(video,status) values('$video','1')");
}
header('location:video.php');
die();
}
}
?>
<div class="main-panel">
<div class="content-wrapper">
<div class="row">
<h1 class="card-title ml10">Basic form elements</h1>
<div class="col-12 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<form method="post" enctype="multipart/form-data">
<div class="card-body card-block">
<div class="form-group">
<label for="video" class=" form-control-label">You tube embed url</label>
<input type="url" name="video" placeholder="Enter You tube embed url" class="form-control" required value="<?php echo $video?>">
</div>
<button id="payment-button" name="submit" type="submit" class="btn btn-lg btn-info btn-block">
<span id="payment-button-amount">Submit</span>
</button>
<div class="field_error"><?php echo $msg?></div>
</form>
</div>
</div>
</div>
</div>
</div>
<?php
require('footer.inc.php');
?>