[PHP] script om bestandsnaam te checken werkt niet

Pagina: 1
Acties:
  • 52 views sinds 30-01-2008

  • bartosiej
  • Registratie: Juli 2005
  • Laatst online: 13:43
hallo ik heb het volgende script om te controleren of het bestand wel een .doc, .html, .jpg of .pdf is, maar het werkt niet:

if($_FILES['bestand']['type'] == "application/msword" || $_FILES['bestand']['type'] == "text/html" || $_FILES['bestand']['type'] == "image/jpeg" || $_FILES['bestand']['type'] == "application/pdf")
{
$result = 1;
}
else
{
$result = 2;
}

maar wat voor soort bestand ik ook toevoeg, $result is altijd 2

Wat heb ik fout gedaan..

alvast bedankt,

bartosiej

  • Arto
  • Registratie: November 2005
  • Laatst online: 16-04 19:13
kijk eens wat eruit komt als je echo $_FILES['bestand']['type']; doet

  • whoami
  • Registratie: December 2000
  • Laatst online: 14:33
Hoi,
Dit is gewoon een kwestie van je brouwsel te debuggen, en kijken wat er fout gaat. Het is niet de bedoeling dat wij in P&W jouw code gaan debuggen.
Het is de bedoeling dat je zelf eerst eens even je code debugged.

https://fgheysels.github.io/


Dit topic is gesloten.