PHP Prevent blank upload

Ads
 

PHP Prevent blank upload

In my small PHP application, i am posting a data to server using POST method in PHP, which is working fine. But the problem is that it also accepts blank data as well as duplicate value. Is there any way to check and prevent it from posting the blank value?

Thanks!

View Answers

March 23, 2011 at 12:11 PM

To prevent the PHP application from accepting blank data and duplicate values ..you need to validate it first. See the code below...

if(isset($_POST['submit']) && !empty($_POST) ){
  // now do with your post data
}

Ads









Related Tutorials/Questions & Answers:
PHP Prevent blank upload
PHP Prevent blank upload  In my small PHP application, i am posting a data to server using POST method in PHP, which is working fine. But the problem... to check and prevent it from posting the blank value? Thanks
upload video using php
upload video using php  How to upload a video on MYSQL Server using PHP Code..? Can any one provide me an example
Advertisements
Multiple File Upload in PHP
Multiple File Upload in PHP  Hi, I am beginner in PHP scripting language. I am very interested to learn PHP application. So, can anyone explain or provide related reference about how to Multiple file upload in PHP. Thanks
upload image in php
)upload.php: <?php if(isset($_POST['upload']) && $_FILES['userfile...upload image in php  after select image,how to save it in a folder...; <td width="80"><input name="upload" type="submit" class="box" id="upload
How to Increase Upload File Size Limit in php
Size Limit for php script   Sometimes you need to upload large files. But the default file upload size settings restrict you to upload large files. PHP... can also check it: http://www.phpzag.com/php-increase-upload-file-size-limit
upload value to php server in getmethod in j2me
upload value to php server in getmethod in j2me  Dear Team, I successfully capture image and decode that image, here i have one doubt after... method to php server in j2me can you give some tips for me... Thanks and Regards
PHP code for csv file upload into mysql
PHP code for csv file upload into mysql  I want to upload a file from my pc to mysql server using upload option. while i m selecting the csv file it ll be upload the mysql database. can u send me the coding? i have tried
problem to do coding upload image in php
problem to do coding upload image in php  can i get example coding how to upload image in php?i have try it but i dont no wheter it is correct...;/form> </body> </html> 2)upload.php: <?php if ((($_FILES
prevent browser refresh
prevent browser refresh   prevent browser from refresh in Javascript
UPLOAD
UPLOAD  how to upload image using html
How to design a blank CD, design a blank CD, blank CD
How to design a blank CD       This is a blank CD example, You will learn here how to make a blank CD by taking help of this example. New File: Take a new file with any
php
php   what is php   PHP Tutorials
Running problem with NoughtsAndCrossesGame in blank
Running problem with NoughtsAndCrossesGame in blank  Hi i was having problem created NoughtsAndCrossesGame in end the it works but i runs the gui in blank. Its another way to solve it /* * To change this template, choose
php
php  what is php
php
php using javasript  how to set timer in php using javasript
php
php  i want to know about php and php plateform required software to make php program and database that used in php program?   Please visit the following link: PHP database
php
php  i want to know about php and php plateform required software to make php program and database that used in php program?   Please visit the following link: PHP database
php
php  show the constructor overloading in php
PHP
PHP  How to work in drupal with PHP
php
php  what is php   PHP is one of the most used open source server-side scripting language, which runs on almost all the platform. PHP... and Solaris. To know more about PHP, Visit Here
php
php  how to write a program in php to create pdf file
php
php  plz tell me code for PHP SQL Insert,delete,update,view is used to insert the record from HTML page to Mysql database using in single PHP form
php
php  retrieve data from mysql in php   Please visit the following links: http://www.roseindia.net/sql/mysql-table/mysql-php-select.shtml http://www.roseindia.net/sql/mysql-example/select-where.shtml
php
php  How to catch a image and link click counters using Ajax php can any one help me
php
php  how to set email remainder in php?can you help me pls
PHP
PHP  I want to create Calendar Event in PHP. Could u help me
PHP
PHP  How to check whether a username exists on a website using php and cURL and not MySQL
php
Write a simple PHP program that display the days of week as per the system date using switch case statement.  Write a simple PHP program that display the days of week as per the system date using switch case statement
PHP
PHP  I would love to do PHP project with the title of "Hospital Management System". I want to know how to make validation using jquery
php
can learn php mysql connectivity examples from the given link: PHP Mysql Connectivity
MySQL Blank Field
MySQL Blank Field This example illustrates how to find Blank field by the MySQL Query. In the table 'example' two t_count fields are blank and we find both field which has some value by query 'select * from example where t_count

Ads