All pastes #414655 Raw Edit

Stuff

public php v1 · immutable
#414655 ·published 2007-03-29 04:40 UTC
rendered paste body
											case banner_upload:											$allowed = array("jpg", "gif", "png");															$line = explode('.',$userfile);															$ext = $line[1];																														if (!in_array($allowed, $ext)) {																echo "Not an allowed file type! File not Uploaded.";																break;															}																							        $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;