| Server IP : 127.0.0.1 / Your IP : 216.73.216.48 Web Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 System : Windows NT DESKTOP-3H4FHQJ 10.0 build 19045 (Windows 10) AMD64 User : win 10 ( 0) PHP Version : 8.2.12 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/xampp/htdocs-coblaa/BM_game/ |
Upload File : |
<html>
<?php
session_start();
include('db.php');
//include('function.php');
?>
<div style="display:none;">
<?php
$user_ip = getenv('REMOTE_ADDR');
$geo = unserialize(file_get_contents("http://www.geoplugin.net/php.gp?ip=$user_ip"));
$city = $geo["geoplugin_city"];
$region = $geo["geoplugin_regionName"];
$country = $geo["geoplugin_countryName"];
/*echo"$user_ip";
echo "City: ".$city."<br>";
echo "Region: ".$region."<br>";
echo "Country: ".$country."<br>";
/*
geoplugin_request
geoplugin_status
geoplugin_credit
geoplugin_city
geoplugin_region
geoplugin_areaCode
geoplugin_dmaCode
geoplugin_countryCode
geoplugin_countryName
geoplugin_continentCode
geoplugin_latitude
geoplugin_longitude
geoplugin_regionCode
geoplugin_regionName
geoplugin_currencyCode
geoplugin_currencySymbol
geoplugin_currencySymbol_UTF8
geoplugin_currencyConverter
*/
if(isset($_SESSION['my_id']))
{
$my_id = $_SESSION['my_id'];
}
?>
</div>
<head>
<link rel="icon" type="image/png" href="http://craneblue.com/main_icon/crane log.png" />
<title>Buisness Mind Game</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--link rel="icon" href="kvt_con/khalaf_log.jpg" type="image/ico"-->
<link rel="stylesheet" type="text/css" href="main_css/add_product.css" />
</head>
<body>
<div class="login_div">
<form method="post" enctype="multipart/form-data" >
<div class="login_acc_title" >Add Proudct</div>
<div class="login_lebal" >Product Name</div>
<input type="text" name="product_name" class="login_acc_input" />
<div class="login_lebal" >Product Price</div>
<input type="Number" name="product_price" class="login_acc_input" />
<div class="login_lebal" >Product Image</div>
<input type="file" name="product_img" class="login_acc_input" />
<?php
if(isset($_POST['login_acc_btn']))
{
$product_name = $_POST['product_name'];
$product_price = $_POST['product_price'];
$product_img = $_FILES['product_img']['name'];
$product_img_type = explode('.',$product_img);
$product_img_type = end($product_img_type);
$product_img_url =rand();
$product_img_tmp = $_FILES['product_img']['tmp_name'];
if($product_name=="" || $product_price=="" || $product_img==""){ echo"<div class='error_output' style='float:left;width:100%;height:40px;color:red;text-align:center;'>Fill All The Filds</div>"; }else{
$insert_img="insert into bmg_producttb (my_id,product_name,product_img,product_price,cur_country,cur_city,ipuser,cur_date,cur_time)
values('$my_id','$product_name','$product_img_url.$product_img_type','$product_price','$country','$city','$user_ip',CURDATE(),CURTIME() )";
$run_insert_img = mysqli_query($con,$insert_img);
if($run_insert_img){
move_uploaded_file($product_img_tmp,'product_img/'.$product_img_url.'.'.$product_img_type);
echo"<div class='error_output' style='float:left;width:100%;height:40px;color:green;text-align:center;'>Video uploaded successfully</div>";
}else{ echo"<div class='error_output' style='float:left;width:100%;height:40px;color:red;text-align:center;'>Something went wrong</div>"; }
}
}
?>
<button id="login_acc_btn" name="login_acc_btn" class="login_acc_btn" >Add</button>
</form>
</div><!--end of login_div-->
</body>
</html>