Re: +AFs-PHP-WIN+AF0- HTTP+AF8-POST+AF8-VARS - need help

From: Date: Wed, 23 Oct 2002 10:16:12 +0000
Subject: Re: +AFs-PHP-WIN+AF0- HTTP+AF8-POST+AF8-VARS - need help
Groups: php.windows 
Request: Send a blank email to php-windows+get-16492@lists.php.net to get a copy of this message
Is that a mistake: <form method=\"POST\" action=\"$PHSELF\" enctype=\"multipart/form-data\"> or just a mistyped line: $PHSELF instead of $PHP_SELF? Ciao, Nino ================================= http://www.vessella.it (italiano, esperanto, kiswahili, english) http://www.changamano.org (Iniziative di solidarietà per la Tanzania) Corso di lingua swahili: http://corsoswahili.vessella.net Corso di lingua esperanto: http://esperanto.vessella.net Jifunze lugha ya Kiesperanto: http://kiesperanto.vessella.net Kamusi/Vortaro: http://kamusi.vessella.net Vocabolario esperanto-italiano: http://vortaro.vessella.net ----- Original Message ----- From: "Aidal" <aidal@nospam.dk> To: <php-windows@lists.php.net> Sent: Wednesday, October 23, 2002 11:27 AM Subject: [PHP-WIN] HTTP_POST_VARS - need help > I'm trying to make a simple upload script. > The script is suppose to do severel checks after form submition. > The problem is that it seems that I don't have access to HTTP_POST_VARS for > some reason. > In php.ini I have the following definitions (among others of cause): > > upload_tmp_dir = "C:\php4\uploadtemp" > file_uploads = On > register_globals = On > > The sending FORM looks like this (all HTML removed): > > <form method=\"POST\" action=\"$PHSELF\" > enctype=\"multipart/form-data\"> > <input type=hidden name=AKTION value=upload_img> > <input type=file name=file> > <input type=submit value=Upload> > > The receiving script looks like this: > > switch($AKTION) { > case upload_img: > echo "upload check started<br>"; > echo $GLOBALS['file']."<br>"; > > if ($HTTP_POST_VARS['submit']) { > print_r($HTTP_POST_FILES); > if (!is_uploaded_file($HTTP_POST_FILES['file']['tmp_name'])) { > echo "The file wasn't uploaded"; > unlink($HTTP_POST_FILES['file']['tmp_name']); > } else { > $maxfilesize=10240; > if ($HTTP_POST_FILES['file']['size'] > $maxfilesize) { > echo "The file was too large"; > unlink($HTTP_POST_FILES['file']['tmp_name']); > } else { > if ($HTTP_POST_FILES['file']['type'] != "image/gif" > AND > $HTTP_POST_FILES['file']['type'] != "image/pjpeg") { > echo "This file type isn't allowed for uploads"; > unlink($HTTP_POST_FILES['file']['tmp_name']); > } else { > copy($HTTP_POST_FILES['file']['tmp_name'],"C:\\Program > > Files\\Apache\\htdocs\\nef\\images\\".$HTTP_POST_FILES['file']['name']); > unlink($HTTP_POST_FILES['file']['tmp_name']); > print "File has been successfully uploaded!"; > exit; > } > } > } > } else { > echo "No form submition was registered"; > } > break; > } > > This produces the following 3 lines of output: > > upload check started > C:\php4\uploadtemp\php9223.TMP > No form submition was registered > > Acording to my script this means that the receiving script couldn't > catch/access the HTTP_POST_VARS. > I'm aware that some variable names have changed, like HTTP_POST_FILES => > $_FILES and so on, but this shouldn't affect this script since it never get > to the part with HTTP_POST_FILES. > > If anyone can give me a clue to whats wrong here please let me know. > Also if you need more info about php.ini settings let me know and I'll post > it asap. > > Regards > ~ Aidal > > > > > > > > > > > > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.windows (#16492) next »