1 2 3 4 5 6 7 8 9 10 11 12 13
| require_once('Connections/webcar.php');
mysql_select_db($database_webcar, $webcar);
$rep_destination=$_SERVER['DOCUMENT_ROOT']."/Foto";
$extensions_ok = array('png', 'gif', 'jpg', 'jpeg');
$MAX_FILE_SIZE = 300000;
if($_POST['ok']){ if (is_uploaded_file($_FILES["photo"]["tmp_name"]))
$destination=$rep_destination."/".$_FILES["photo"]["name"];
move_uploaded_file($_FILES["photo"]["tmp_name"],$destination);
$photo=$_FILES['photo']['name'];
$sql="update annonce set photo='Foto/$photo', img='oui' where idannonce='$idannonce'";
$res=mysql_query($sql) or die (mysql_error());
header ("location: home.php");
} |
Partager