Simple Php Quiz: Why Will This Code Not Work If You Are Uploading Files? - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Simple Php Quiz: Why Will This Code Not Work If You Are Uploading Files? (1467 Views)
| Simple Php Quiz: Why Will This Code Not Work If You Are Uploading Files? by Nobody: 3:56pm On Jul 30, 2011 |
if(($_SERVER['CONTENT_TYPE']=="application/x-www-form-urlencoded")&&($_SERVER["REQUEST_METHOD"]=='POST')) {return true;}The above code is a very good way to detect if a form is about to be submitted. Now, it works fine, but if you are uploading files, it fails? why? |
| Re: Simple Php Quiz: Why Will This Code Not Work If You Are Uploading Files? by dellnet: 4:34pm On Jul 30, 2011 |
I thought I am the only one bored here, does considering MIME type count? |
| Re: Simple Php Quiz: Why Will This Code Not Work If You Are Uploading Files? by Nobody: 4:40pm On Jul 30, 2011 |
Caramba! But of course you are corecta. |
| Re: Simple Php Quiz: Why Will This Code Not Work If You Are Uploading Files? by Zahymaka(m): 6:10pm On Jul 31, 2011 |
Because uploads are sent using multipart/form-data (sp?) |
| Re: Simple Php Quiz: Why Will This Code Not Work If You Are Uploading Files? by dhtmlextreme(m): 6:47pm On Jul 31, 2011 |
Of course. . |
| Re: Simple Php Quiz: Why Will This Code Not Work If You Are Uploading Files? by Nobody: 12:04pm On Aug 01, 2011 |
@Zahymaka that only works for PHP to see the Uploaded Contents,the method type should be $_FILES because that is the Super Globals that references all (Input Files). |
| Re: Simple Php Quiz: Why Will This Code Not Work If You Are Uploading Files? by Nobody: 12:48pm On Aug 01, 2011 |
pc guru:@pc guru, do you develop android app? I need a developer. Reply, text or call 07033039109. |
| Re: Simple Php Quiz: Why Will This Code Not Work If You Are Uploading Files? by Nobody: 1:07pm On Aug 01, 2011 |
Sorry unfortunately i don't but check the Google nigeria group there are android developers there. |
| Re: Simple Php Quiz: Why Will This Code Not Work If You Are Uploading Files? by Nobody: 1:16pm On Aug 01, 2011 |
Thanks, pls can u send a link. |
Please Help Me Write This Simple Php Switch Statement • Simple Php Challenge • Simple PHP Quiz: Kill The Rand() • 2 • 3 • 4
Algorithm Code To Rank Photos In Websites • Niit Or Aptech? • PIC Micro Hardware Programming Methods