0

I created a login system using php.And it can handle member profiles.But i was unable to upload profile picture.how can i do that???????

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by yapaarachchi
0

Dear Friend ,

i dont know what script u r using to store pictures.

i have a script, it can store pictures in a folder.

Script is :

<?php
$name=$_post;
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 200000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";

if (file_exists("$name/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"$name/" . $_FILES["file"]["name"]);
echo "Stored in: " . "$name/" . $_FILES["file"]["name"];
}
}
}
else
{
echo "Invalid file";
}
?>

0

thanx.I mean that in my system the members should be able to upload pictures.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.