Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,155,154 members, 7,825,601 topics. Date: Sunday, 12 May 2024 at 06:31 PM

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

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

(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)

Looking For A Cybercafe To do My Internship. / Android GP Calculator For Nigerian Polytechnics; Free Source / Naigeria Is Ranked Among Top 50 Coutries That Have Best Developers In The World

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 8
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.