[HELP] Galery for CO WebSite

09/30/2009 05:49 BALTA00#1
Hello everyone, I am searching a good php coder or any who know how do this, I want make in my web site, Galery section, where players can upload him Pictures, but I am not good in php, can help me? or give me any idea?

Thanks for read!
09/30/2009 05:56 raidenx123#2
Code:
//No credits go to me i got this from google :)
<?php 
$target = "upload/"; 
$target = $target . basename( $_FILES['uploaded']['name']) ; 
$ok=1; 
if ($uploaded_size > 350000) 
{ 
echo "Your file is too large.<br>"; 
$ok=0; 
} 
if ($uploaded_type =="text/php") 
{ 
echo "No PHP files<br>"; 
$ok=0; 
}
 if (!($uploaded_type=="image/jpeg")) {
echo "You may only upload JPEG images.<br>";
$ok=0;
}
if ($ok==0) 
{ 
Echo "Sorry your image was not uploaded"; 
} 
else 
{ 
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) 
{ 
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; 
} 
else 
{ 
echo "Sorry, there was a problem uploading your image."; 
} 
} 
?>

You might want to add a bit more to 'preview' the image w/o downloading
09/30/2009 06:05 BALTA00#3
Quote:
Originally Posted by raidenx123 View Post
Code:
//No credits go to me i got this from google :)
<?php 
$target = "upload/"; 
$target = $target . basename( $_FILES['uploaded']['name']) ; 
$ok=1; 
if ($uploaded_size > 350000) 
{ 
echo "Your file is too large.<br>"; 
$ok=0; 
} 
if ($uploaded_type =="text/php") 
{ 
echo "No PHP files<br>"; 
$ok=0; 
}
 if (!($uploaded_type=="image/jpeg")) {
echo "You may only upload JPEG images.<br>";
$ok=0;
}
if ($ok==0) 
{ 
Echo "Sorry your image was not uploaded"; 
} 
else 
{ 
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) 
{ 
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; 
} 
else 
{ 
echo "Sorry, there was a problem uploading your image."; 
} 
} 
?>

You might want to add a bit more to 'preview' the image w/o downloading
Thanks bro, I like this, I go to ask a stupid question, xD, how to use this? where put this codec? I need make a new .php file with this and call this?
09/30/2009 06:42 raidenx123#4
just name it upload.php