<?php
require('config.php');
if(isset($_POST['upload'])){
if(getimagesize($_FILES['image']['tmp_name'])==FALSE){
$first_ul_status = "Please select an image";
}else{
$image = addslashes($_FILES['image']['tmp_name']);
$name = addslashes($_FILES['image']['name']);
$image = file_get_contents($image);
$image = base64_encode($image);
saveimage($name,$image);
}
function saveimage($name,$image){
$first_ul_query = "UPDATE `users` SET `Photo Name`='$name',`Photo`='$image' WHERE `ID`='$UserSession'";
$first_ul_result = mysql_query($first_ul_query);
if($first_ul_result){
$first_ul_status = "Image uploaded";
}else{
$first_ul_status = "Image not uploaded";
}
}
}
?>
I just got this code from the web I don't remember where I got this code. But I have the video tutorial of this thats why I have this code right now. Last time this code is working to me but now my problem is that I cant call the saveimage($name,$image);
Can somebody help me out there? Thanks in advance pros :)