mrblues Posted March 13, 2007 Share Posted March 13, 2007 Hello I have this php script it works great ,but is there anyway to get this script to resize my pic on upload to something like 600 px wide, is this possible and can you explain it to me, maybe put it in my code I`m totaly new in php and i mean newwwwwbiiii. Thank you very mutch. Here`s the script. <?php //This is the directory where images will be saved $target = "photo/"; $target = $target . basename( $_FILES['photo']['name']); //This gets all the other information from the form $name=$_POST['name']; $email=$_POST['email']; $phone=$_POST['phone']; $pic=($_FILES['photo']['name']); // Connects to your Database mysql_connect("localhost", "*****", "********") or die(mysql_error()); mysql_select_db("********") or die(mysql_error()); //Writes the information to the database mysql_query("INSERT INTO employess (name, email, phone, photo) VALUES ('$name', '$email', '$phone', '$pic')"); if(file_exists($target)){ die("Filen findes!"); } //Writes the photo to the server if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { //Tells you if its all ok echo "Billedet ". basename( $_FILES['uploadedfile']['name']). " er blevet uploaded, og teksten er blevet tilføjet databasen"; } else { echo "Sorry, there was a problem uploading your file."; } ?> Link to comment https://forums.phpfreaks.com/topic/42586-upload-resize/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.