Re: [PHP] Hmm.. this is strange..
Thank you very much Tolga! if(empty($_FILES['filbane']['name'])) 24.04.2012 17:54 tarihinde, Karl-Arne Gjersøyen yazdı: > Here I try to check if the input file is empty or not. But still it > did not work. I receive OK even when the input file field is empty.. > > if(!isset($_POST['last_opp_fil'])){ > header('Location: bildegalleri.html'); > } else { > $bildefil = $_FILES['filbane']; > if(empty($bildefil)){ > header('Location: bildegalleri.html'); > } else { > ?> > > > > > Bildegalleri > > > Bildegalleri > echo "OK"; > } > } > ?> > > > > Den 16:48 24. april 2012 skrev Serge Fonville > følgende: >> >> Hi, >> >> Instead of just checking if the variable is not set, additionally >> check if it is empty >> >> Kind regards/met vriendelijke groet, >> >> Serge Fonville >> >> http://www.sergefonville.nl >> >> Convince Google!! >> They need to add GAL support on Android (star to agree) >> http://code.google.com/p/android/issues/detail?id=4602 >> >> >> 2012/4/24 Karl-Arne Gjersøyen: >>> >>> Hello. >>> I have a upload form in a html file and a corresponding PHP file that >>> shall take care of the information. >>> But I am doing something newbie error here.. >>> >>> What am I doing wrong? (The text is norwegian, but you still see and >>> understand the PHP code) >>> >>> bildegalleri.html >>> - >>> >>> >>> >>> >>> Opplasting til Fotogalleri >>> >>> >>> >>> Opplasting til Fotogalleri >>> >>> >>> Velg bilde for opplasting >>> Filbane >>> >>> >>> >>> >>> >>> >>> >>> bildegalleri.php >>> - >>> >> if(!isset($_POST['last_opp_fil'])){ >>> header('Location: bildegalleri.html'); >>> } >>> elseif(empty($_FILES['filbane'])){ >>> header('Location: bildegalleri.html'); >>> } else { >>> ?> >>> >>> >>> >>> >>> Bildegalleri >>> >>> >>> Bildegalleri >>> >> echo "OK"; >>> } >>> ?> >>> >>> >>> >>> When I run this script, I always get "Ok". Even when the input file >>> field is empty.. Can someone tell me what I am doing wroing in this? >>> >>> Thanks for you time and effort to help me out. >>> >>> Karl >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> -- Hjemmeside: http://www.karl-arne.name/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hmm.. this is strange..
Here I try to check if the input file is empty or not. But still it did not work. I receive OK even when the input file field is empty.. Bildegalleri Bildegalleri Den 16:48 24. april 2012 skrev Serge Fonville følgende: > Hi, > > Instead of just checking if the variable is not set, additionally > check if it is empty > > Kind regards/met vriendelijke groet, > > Serge Fonville > > http://www.sergefonville.nl > > Convince Google!! > They need to add GAL support on Android (star to agree) > http://code.google.com/p/android/issues/detail?id=4602 > > > 2012/4/24 Karl-Arne Gjersøyen : >> Hello. >> I have a upload form in a html file and a corresponding PHP file that >> shall take care of the information. >> But I am doing something newbie error here.. >> >> What am I doing wrong? (The text is norwegian, but you still see and >> understand the PHP code) >> >> bildegalleri.html >> - >> >> >> >> >> Opplasting til Fotogalleri >> >> >> >> Opplasting til Fotogalleri >> >> >> Velg bilde for opplasting >> Filbane >> >> >> >> >> >> >> >> bildegalleri.php >> - >> > if(!isset($_POST['last_opp_fil'])){ >> header('Location: bildegalleri.html'); >> } >> elseif(empty($_FILES['filbane'])){ >> header('Location: bildegalleri.html'); >> } else { >> ?> >> >> >> >> >> Bildegalleri >> >> >> Bildegalleri >> > echo "OK"; >> } >> ?> >> >> >> >> When I run this script, I always get "Ok". Even when the input file >> field is empty.. Can someone tell me what I am doing wroing in this? >> >> Thanks for you time and effort to help me out. >> >> Karl >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hmm.. this is strange..
Hi, Instead of just checking if the variable is not set, additionally check if it is empty Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Google!! They need to add GAL support on Android (star to agree) http://code.google.com/p/android/issues/detail?id=4602 2012/4/24 Karl-Arne Gjersøyen : > Hello. > I have a upload form in a html file and a corresponding PHP file that > shall take care of the information. > But I am doing something newbie error here.. > > What am I doing wrong? (The text is norwegian, but you still see and > understand the PHP code) > > bildegalleri.html > - > > > > > Opplasting til Fotogalleri > > > > Opplasting til Fotogalleri > > > Velg bilde for opplasting > Filbane > > > > > > > > bildegalleri.php > - > if(!isset($_POST['last_opp_fil'])){ > header('Location: bildegalleri.html'); > } > elseif(empty($_FILES['filbane'])){ > header('Location: bildegalleri.html'); > } else { > ?> > > > > > Bildegalleri > > > Bildegalleri > echo "OK"; > } > ?> > > > > When I run this script, I always get "Ok". Even when the input file > field is empty.. Can someone tell me what I am doing wroing in this? > > Thanks for you time and effort to help me out. > > Karl > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hmm.. this is strange..
Hello. I have a upload form in a html file and a corresponding PHP file that shall take care of the information. But I am doing something newbie error here.. What am I doing wrong? (The text is norwegian, but you still see and understand the PHP code) bildegalleri.html - Opplasting til Fotogalleri Opplasting til Fotogalleri Velg bilde for opplasting Filbane bildegalleri.php - Bildegalleri Bildegalleri When I run this script, I always get "Ok". Even when the input file field is empty.. Can someone tell me what I am doing wroing in this? Thanks for you time and effort to help me out. Karl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php