Jump to content

Archived

This topic is now archived and is closed to further replies.

scheols

File Upload Problem.Kinda XD

Recommended Posts

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:

[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>";
?>
[/code]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.