₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,045 members, 8,420,038 topics. Date: Thursday, 04 June 2026 at 10:03 AM

Toggle theme

Simple Php Quiz: Why Will This Code Not Work If You Are Uploading Files? - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingSimple Php Quiz: Why Will This Code Not Work If You Are Uploading Files? (1467 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 StatementSimple Php ChallengeSimple PHP Quiz: Kill The Rand()234

Algorithm Code To Rank Photos In WebsitesNiit Or Aptech?PIC Micro Hardware Programming Methods