note 26992 deleted from features.file-upload by victor

From: Date: Wed, 20 Nov 2002 05:44:03 +0000
Subject: note 26992 deleted from features.file-upload by victor
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-39734@lists.php.net to get a copy of this message
If you construct an upload form with the PHP upload code all within the same file, example: <? if (submit) { execute PHP code to upload file } else { ?> execute HTML code to place your HTML upload form here <? } ?> The point of this construction is you only need ONE page for the HTML upload form AND the PHP code to actually upload the file. You can do this by using action=$PHP_SELF instead of action=do_upload.php To prevent an endless loop we use the if(submit) to check if the submit button has been pressed. Anyways if you do this the userfile_name variabele you should automatically get when pressing the submit button magically disappears. If you use the old fashioned action=do_upload.php userfile_name IS available... Dunno why that is? perhaps the upload form can't send variables to itself? Anyways, it took me half a day before I found this issue.... grrrr

« previous php.notes (#39734) next »