I am not that good in php however the below code was working before I changed thr host name. the echo is not showing when I load the url , neither the insert is being executed.
$con = mysqli_connect($host,$uname,$pwd,$db);
echo 'hi'
$description= $_GET['description'];
$categorie= $_GET['categorie'];
$image=$_POST['image'];
$imagename = uniqid("uploaded_images").".png";
$imageurl="http://justedhak.com/".$imagename;
$binary=base64_decode($image);
header('Content-Type: bitmap; charset=utf-8');
$file = fopen($imagename, 'wb');
fwrite($file, $binary);
fclose($file);
$sql="INSERT INTO OBJECTS( NAME, TYOE, URL, CATEGORY, USERS_ID, HIDE_YN )
VALUES ('$imagename', 'IMAGE', '$imageurl', 'CATEG' , 1, 'N')";
if(mysqli_query($con,$sql)){
echo $sql
}
else{
echo 'failure';
}
mysqli_close($con);
Errors
Warning: mysqli_connect(): (28000/1045): Access denied for user 'je_user'@'ip-160-153-162-16.ip.secureserver.net' (using password: YES) in /home/justdb/public_html/upload_image.php on line 7
Notice: Undefined index: description in /home/justdb/public_html/upload_image.php on line 9
Notice: Undefined index: categorie in /home/justdb/public_html/upload_image.php on line 10
Notice: Undefined index: image in /home/justdb/public_html/upload_image.php on line 11
Warning: Cannot modify header information - headers already sent by (output started at /home/justdb/public_html/upload_image.php:6) in /home/justdb/public_html/upload_image.php on line 16
Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/justdb/public_html/upload_image.php on line 24
Warning: mysqli_close() expects parameter 1 to be mysqli, boolean given in /home/justdb/public_html/upload_image.php on line 30