Jump to content


Photo

File Upload Problem.Kinda XD


  • Please log in to reply
2 replies to this topic

#1 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 15 July 2006 - 05:50 AM

Alright I want 2 make my script stop if they dont contain the file types i provide.

here are the file types:


$file_type = array("js","gif","jpg","txt","png","jpeg","bmp");

heres my code:

<?php
$name = $_FILES['userfile']['name'];
if(!(copy($_FILES['userfile']['tmp_name'], "images/" . $_FILES['userfile']['name']))) die("Cannot upload files.");
echo "Upload Complete!<br>";
echo "<a href='"."http://xizionz.vectoredhost.com/images/"."$name"."'>"."Here"."</a>";
?>

Dont Piss me Off today

#2 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 15 July 2006 - 05:54 AM

whats the error

#3 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 15 July 2006 - 05:56 AM

thiers no error but i just cant seem 2 check if the file types are right when adding that part i have even if the file type is correct
Dont Piss me Off today




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users