QuicksearchArchives |
Sunday, September 16. 20072008 PHP Quebec Conference: Call for Speakers PHP Quebec is pleased to announce the sixth edition of the PHP Quebec Conference. The Conference will take place in Montreal, Canada between March 12 and 14th, 2008. We are looking for speakers willing to share their expertise with Canadian and United States PHP professionals.The Conference features the PHPLab, where speakers and visitors will try to find solutions to actual business problems. The two days of technical talks will be dedicated to advanced software development techniques with PHP5 and PHP6, XML, web services, databases, etc. Organizers will prioritize new and original topics in English or French. For more information, visit the website: http://conf.phpquebec.com Friday, September 7. 2007AI: Manipulating images in a whole new way
We are used to cropping and proportional resizing of our images to make them fit. We also spend hours carefully erasing unwanted elements from them. New technology allows content-aware image resizing. Totally genius!
Also download the publication by Shai Avidan and Ariel Shamir: Seam Carving for Content-Aware Image Resizing We might soon see this technology in Adobe products since they recently hired co-creator Shai Avidan. PS: Photoshop price will go up Sunday, September 2. 2007Refresh form but do not resubmit (PHP)
This question has been asked so many times that most of you don't want to hear it again. Unfortunately, the solutions that people are proposing are less than ideal.
For those who are new to the concept, a quick explanation is in order. You have a form that you display, validate and act upon (send e-mail, save to database, upload files, etc.) Once this is done, the user might refresh the page and you will end up with duplicate entries. Bad ideas to handle it are: splitting into multiple files to work around this problem, using the meta-refresh tag, setting unique identifiers and store them in session or in hidden fields, checking for duplicates after resubmission, using javascript... If you want to know why they are bad, just post a comment and I will give you a detailed explanation of the particular case. I found a quick and neat way to do it (perhaps I'm not the first, but I feel the need to share it). Append "?submit=true" to your form action and use header("Location: ...") with the current URL. Thus, once form data has been saved, you will be redirected to the same page without the POST variables. If PHP complains that output was already sent, then you have a bad approach for your output. I usually store all my output in a variable(s) and echo it when everything is okay. More on output in another entry. |
CategoriesSyndicate This BlogBlog Administration |
Powered by s9y - Design by Anna Filina