All pastes #419183 Raw Edit

Someone

public php v1 · immutable
·published 2007-04-01 03:38 UTC
rendered paste body
											case banner_upload:											$allowed = array("jpg", "gif", "png");																									$line = explode('.',$_REQUEST['userfile']);															$ext = $line[1];												if (isset($_REQUEST['userfile']) && !in_array($ext, $allowed)) {															echo "$ext Not an allowed file type! File not Uploaded.";												} elseif (isset($_REQUEST['userfile']) && in_array($ext, $allowed)) {																												$uploaddir = 'banners/';														$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);																																													if (move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile)) {																				echo "File is valid, and was successfully uploaded.";																	}																										}																											echo "														<form enctype='multipart/form-data' action='index.php?page=banner_upload' method='post'>														 <input type='hidden' name='MAX_FILE_SIZE' value='30000' />														 <table border='0'>														 <tr>														 <td>File to upload</td>														 <td><input name='userfile' type='file' /></td>														 </tr>														 <tr>														 <td>&nbsp;</td>														 <td>														 <div align='right'>Upload file:														 <input type='submit' value='Upload' />														 </div></td></tr>														 </table>														</form>													 ";																						break;