chriscloyd Posted January 26, 2007 Share Posted January 26, 2007 Hi there,Right now i have a script that uploads an image to my server. Im having trouble makeing the script to make it a thumbnail , so pretty much a problem creating two copies of the file im uploading and making one a thumbnail heres my script so far can someone help me out?[code]<?phpinclude("../config.php");$id = $_GET['id'];$get_project = mysql_query("SELECT * FROM projects WHERE id = '$id'");$project = mysql_fetch_assoc($get_project);$pclient = $project['clientid'];$get_client = mysql_query("SELECT * FROM users WHERE id = '$pclient'") or die(mysql_error());$client = mysql_fetch_array($get_client);$pname = $client['first'].' '.$client['last'];$file_name = $HTTP_POST_FILES['screenshot']['name'];$random_digit = rand(0000,9999);$new_file_name = "$pname.$random_digit.$file_name";$path= "screenshots/".$new_file_name;$pid = $_GET['id'];copy($HTTP_POST_FILES['screenshot']['tmp_name'],$path);mysql_query("INSERT INTO project_screenshots (`pid`,`name`,`location`) VALUES ('$pid','$new_file_name','$path')");header("Location: ../projects.php?page=viewproject&id=$id");?>[/code] Link to comment https://forums.phpfreaks.com/topic/35820-create-image-thumbnail/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.