sgt_fireman Posted July 28, 2012 Share Posted July 28, 2012 Hey guys, So i've made quite a simple script that merges 3 images: A logo, background, and some text. <?php session_start(); $Bg = ($_POST['bg']); $Logo = ($_POST['logo']); $Text = ($_POST['text']); $bg = imagecreatefrompng('$Bg'); $fg = imagecreatefrompng('$Logo'); $Final = imagecreatefrompng('$Text'); $x = imagesx($bg); $y = imagesy($bg); imagecopy($bg, $fg, 0, 0, 0, 0, 728, 90); imagecopy($Final, $bg, 0, 0, 0, 0, 728, 90); header('Content-Type: image/png'); $UID = "test"; $Path = 'test/' . $UID . '.png'; imagepng($Final); imagepng($Final,$Path,9); imagedestroy($bg); imagedestroy($fg); imagedestroy($Final); ?> Now this works fine but I'de like to create it so that users can upload the 3 images to merge, Is there anyway to link a script like this to a form? Thanks very much guys. Quote Link to comment https://forums.phpfreaks.com/topic/266389-uploading-images-to-merge/ Share on other sites More sharing options...
Christian F. Posted July 28, 2012 Share Posted July 28, 2012 You're thinking a bit too complicated about this, try to reduce the task into simple steps and it should be a lot easier to see what you need to do. A little example of what I mean, this is what you're looking to do: Sig creator: - If form not submitted. - Show form & quit - If no files uploaded or error. - Show error - Repopulate form data. - Show form & quit. - Validate files & other input - If not validated. - Show error. - Repopulate form data. - Show form & quit. - Handle upload of files. - Merge pictures & text. Makes it a whole lot easier to see what you need to do, doesn't it? Quote Link to comment https://forums.phpfreaks.com/topic/266389-uploading-images-to-merge/#findComment-1365110 Share on other sites More sharing options...
Barand Posted July 28, 2012 Share Posted July 28, 2012 is this what you want http://uk3.php.net/manual/en/features.file-upload.multiple.php Quote Link to comment https://forums.phpfreaks.com/topic/266389-uploading-images-to-merge/#findComment-1365114 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.