Hi,
I have a script that uploads images into MySQL but I am have trouble resizing the image on upload. Can anyone help?
Here is my code so far:
<?php require_once('Connections/connAdmin.php'); ?>
<?php
//file properties
$file = $_FILES['content']['tmp_name'];
if
(!isset($file))
echo "please select an image.";
else {
$content = addslashes (file_get_contents ($_FILES['content']['tmp_name']));
$content_name = addslashes ($_FILES['content']['name']);
$content_size = getimagesize ($_FILES['content'] ['tmp_name']);
if (!$content_size)
echo "Thats not an image";
else {
include('includes/create_thumb3.inc.php');
if (!$insert = mysql_query("INSERT INTO dcktest.upload (id, name, content)VALUES('','$content_name','$content')"))
echo (mysql_error());
else{
$lastid = mysql_insert_id();
echo "Image uploaded<p/>Your Image<p/><img src=get.php?id=$lastid>";
}
}
}
?>
Thanks!