| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| Image upload error; PHP | |
|---|---|
| Tweet Topic Started: Feb 3 2007, 10:28 AM (551 Views) | |
| Friiks | Feb 3 2007, 10:28 AM Post #1 |
![]()
I have lost the will to live, simply nothing more to give
![]() ![]() ![]() ![]()
|
Well, no questions I have except for this - could anyone tell me whats wrong with my code?
And here's the form
When I submit the form it just gives me a blank page..so I just don't know whats wrong with it =/ Thanks, Matt. |
![]() |
|
| Ben | Feb 3 2007, 11:07 AM Post #2 |
|
Quantum-locked when observed.
![]()
|
Make sure that your form is has the enctype="multipart/form-data" attribute, or else file uploads won't work through it. You may want to post the form's code as well for us to see. ![]() Oh, and instead of copy() I might avail myself of move_uploaded_file(). You can see PHP.net's page on handling file uploads and Practical PHP Programming's page on handling file uploads for more information. |
![]() |
|
| Friiks | Feb 3 2007, 11:25 AM Post #3 |
![]()
I have lost the will to live, simply nothing more to give
![]() ![]() ![]() ![]()
|
The form is with correct enctype, know that much about upload forms. Um and it's not copy() as I tried move_uploaded_file() and still nothing. Could it be the headers? I really don't know whats wrong and I'm really tired of it after 4hours messing with it.. |
![]() |
|
| IceMetalPunk | Feb 4 2007, 07:03 PM Post #4 |
|
We are all IMPerfect. Be proud!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
It's hard to follow all your IF-ELSE conditions, but it seems like there's a case in which the location header isn't sent. I'd use the header() call at the end, OUTSIDE of all conditions, and use the conditions only to set a variable used as the location. This way, there will always be a redirection, and your problem should be solved. Plus, setting the URL variable to something like http://www.google.com in the begining of the code will let you know if the current situation isn't matching one of your conditions (i.e. if the variable isn't changed in any conditions, it'll go to google instead of some other page). -IMP
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Technology Chat · Next Topic » |
| Track Topic · E-mail Topic |
3:00 PM Jul 11
|




![]](http://b1.ifrm.com/0/1/0/p601690/pipright.png)





3:00 PM Jul 11