|
||||||
| PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hi guys,
I made/used an image uploader script today. This is how the code works now after POSTing the details with a form. PHP Code:
How can I create some kind of if statement that says "if they havent entered anything into the image field then dont do stuff" ? I tried echoing $_FILES['new_image'] but it comes back as "array". I have not used $_FILES before so do not understand this. Thanks. |
| Sponsored Links |
|
|
|
|||||
|
$_FILES is a global multi-dimensional array defined by php. If you would like to see the contents of the array you can use the print_r() function.
PHP Code:
PHP Code:
I've written a upload class that you can modify if you would like: PHP: Upload Class
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||
|
Ah I see. Thanks John.
The upload script all works now apart from this null issue so I'd rather not change it with a different system now but will look at yours. Is there a way I can add an "if null" check? |
|
|||||
|
Quote:
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||||
|
100% true? Wow, this must be a first!
![]() Say you have a variable: PHP Code:
However, if you use: PHP Code:
Finally, if we pass a space to the variable: PHP Code:
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VB 6.0: Tutorial, How to make a GIF in your application | TcM | VB Tutorials | 17 | 07-01-2008 03:26 PM |
| How to make image straight - Photoshop | ahsan16 | Photoshop Tutorials | 7 | 06-20-2008 10:38 AM |
| An important exam! | Zael | C and C++ | 12 | 01-22-2008 09:08 PM |
| Mysql/Php help need | mittalmak | PHP Forum | 17 | 01-12-2008 12:36 PM |
| Make a script vulnerable to SQL injection? | shibbythestoner | PHP Forum | 7 | 12-15-2007 08:56 PM |