Showing posts with label coding. Show all posts
Showing posts with label coding. Show all posts

Saturday, 10 April 2010

How to Enable/Disable Image upload in PHP

Hey Guys as promised I have yet another tip to share with you.

In this post I am going to talk about how we can disable the file upload in PHP. It is fairly we simple.

All you have to do is just open up you php.ini file and locate the word:

file_uploads

As shown in the image below:



Now you can turn it On or Off.

If you turn it off the server will not accept any file uploads. Its that simple!

Enjoy!

Sunday, 4 April 2010

How to check if a variable is null in PHP!

As we were talking about various functions in PHP, one of the functions to check if the value is null is: is_null($MyVal) and here if the values is null it will return true and false if the value is not null.

You can always go for something like: !is_null($MyVal) that way, if the value is not null then do something.

Very simple and straight forward!

Ok again, leave your comment down below.

Cheers!