line. parse error. "userfile_size>..."

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
User avatar
WiZARD
Moderator
Moderator
Posts: 1256
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Re: line. parse error. "userfile_size>..."

Post by WiZARD » Thu Nov 14, 2002 5:46 am

Hi!
As I see you so new in PHP.
You have few sintax error in your code

Code: Select all

<?


// so if have a file we will save him, but we must test is this file a picture or not

$userfile_name=$HTTP_POST_FILES['picture']['name'];
$userfile_size=$HTTP_POST_FILES['picture']['size'];
$userfile_type=$HTTP_POST_FILES['picture']['type'];

if ($userfile_size > 524288000) { echo ("This file to big for saving at our server. Sorry!"); }
if ($userfile_type == "image/gif"  or  $userfile_type == "image/jpeg" or $userfile_type == "image/png")
{
// In this case file is image and we are go to the dir where are pictures situated

// create a dir
$destination="upload/$username/";
mkdir ($destination, 0700); // I hope you want save pic into the $user - directory ...

$fd  =$destination;
$fd .=$$userfile_name;

if (file_exists($fd))
{
move_uploaded_file ($userfile_name, $destination);
copy($userfile_name);
echo("<a href=http://www.fruir.org/fileform/simple_hotmail/showpic.php?link=$fd>link</a>");
}

}



In next time see carefully :wink:

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 4 guests