₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,344,183 members, 8,510,577 topics. Date: Friday, 30 October 2026 at 04:16 PM

Toggle theme

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? (1493 Views)

1 Reply (Go Down)

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:
@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).
@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.
1 Reply

Please Help Me Write This Simple Php Switch Statement • Simple Php Challenge • Simple PHP Quiz: Kill The Rand() • 2 • 3 • 4

Can Vb.net Window Program Be Connected To An Online Database? • 3njoying Angularjs Yet? Anyone? • What's All The Hype About Windows Server 2012 R2