acctman Posted December 11, 2007 Share Posted December 11, 2007 I'm working on creating a sign up page for my site, but I'm unsure as to how it should be coded. The form has the basic signup fields (name, pass, email, city, state, etc) but there is also a upload image field. I'd like to improve the upload image by adding a crop/resize image script to it. I have all the coding needed for this but I don't know how to save the data on the first page, and send the user to a second page to do image cropping then have a final page where he user submits there registration info. Another option i thought about is just having 1 page and then use an iframe to do all the image crop/resize. But, not every browser likes iframes. So what are my options here, the current registrations scripts processes with a .php script. I would like to keep everything simple. I can't use a popup because it'll probably be blocked. so options seem to be find a way to temporary save the data (without write to the db) while user goes to the image cropping page, then redisplay the data once they're done. Or a more complex way use some type of ajax/javascript/div/etc coding to allow me to insert the cropping/upload image script onto the same page as the registration... if anyone has a idea as to how this can be done please let me know Quote Link to comment Share on other sites More sharing options...
JacobYaYa Posted December 11, 2007 Share Posted December 11, 2007 If there is a form on the second page just add in <input type="hidden" name="xxx" value="<?php echo (isset($_POST['xxx']))? $_POST['xxx'] : ''; ?>" /> for each value from the first page then you can process everything on the final page. Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted December 11, 2007 Share Posted December 11, 2007 Resizing is standard fare, but cropping? I'm not real big on PHP image functions, but I can't find anything concerning cropping. Are you using this term in the same vernacular as cropping within Photoshop? That's where you region a sub-section of the image, then crop to it. I had no idea this was possible in PHP if that's what you mean... Anyways, resizing is a background process, so I don't see the need for anything to require fancy form processing. They upload the image. Your script checks for an acceptable image type, then you do an IF condition whereby if the size > allowed width or height, your script resizes it. So... your form should contain name, pass, email, etc., then a image upload input with a browse button. Seems pretty straightforward unless I'm missing something... PhREEEk Quote Link to comment Share on other sites More sharing options...
acctman Posted December 12, 2007 Author Share Posted December 12, 2007 Resizing is standard fare, but cropping? I'm not real big on PHP image functions, but I can't find anything concerning cropping. Are you using this term in the same vernacular as cropping within Photoshop? That's where you region a sub-section of the image, then crop to it. I had no idea this was possible in PHP if that's what you mean... Anyways, resizing is a background process, so I don't see the need for anything to require fancy form processing. They upload the image. Your script checks for an acceptable image type, then you do an IF condition whereby if the size > allowed width or height, your script resizes it. So... your form should contain name, pass, email, etc., then a image upload input with a browse button. Seems pretty straightforward unless I'm missing something... PhREEEk i'm using this script http://mondaybynoon.com/examples/image_crop_resize/, i would like to incorporate everything on One registration page without a next page. But before I start asking questions about the image crop script code I want to know if i should be looking more at ajax or can php handle everything Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted December 12, 2007 Share Posted December 12, 2007 Do your users really need the crop feature? That's done through Javascript. Although the resize is done through JS for that example, PHP can do the resizing. I guess we need to know what your application for these image manipulations really is. Are these images mainly for a forum type of profile avatar? If so, then resizing is really all you need, just for the sake of uniformity. If you need to go with all the bells and whistles of that example, then you're in for some programming to get that all into one page (you'll need AJAX). PhREEEk Quote Link to comment 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.