Re: Image / file uploader

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Craig Hoffman wrote:
> This is really becoming an irritating small bug.  I tried the curly
> brackets and the photo name still does not show up when I echo out the
> query.  Everything else about the script works fine.  Why does PHP choke
> on forms that submit files to themselves?  I am slowly running out
> things to try...
>
> Suggestions?

Remove the action attribute of your <form> tag. Default is to post back to same page.

>>    echo ("<form method='post' action='{$_SERVER['PHP_SELF']}'
>> encType='multipart/form-data'>

Also .... yuk!

Have you considered at the very least separating your presentation layer out into separate files so that you don't echo() your HTML? This will make your life easier if ever you want some non-PHP person to help w/ layout. It'll also make your life easier if you want to redesign the form later w/o having to muck around in your processing logic or if you want to add caching to your site. It'll also make your life easier if you want to move templates out of the web root or want to change your app design to use an object-oriented application framework (like Mojavi, Binarycloud, etc.). etc., etc., etc.

Hans

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux