phice wrote:Wow, that's a weird way of handling your brackets ({ and }).

so everyone keeps telling me, its so easy to understand for me, I dont understand other peoples scripts tbh...
volka @ Thanks for the input, I dont understand the fuss with superglobals, I wouldnt know how to impliment it into my code, plus my codes working so Im happy.
I also tried using exif_imagetype() but it seems my server doesnt support it
Fatal error: Call to undefined function: exif_imagetype() in /home/azz0r/public_html/pages/member/edit/editing.php on line 59
ANYWAY. Heres the current code.
Code: Select all
<?
$bday = $year.'-'.$month.'-'.$date;
if(!$username || !$email)
{$error = "You missed something out (username or email address).";
$forward = "yes";
error_box($error, $forward);}
else if (!eregi("^([a-z0-9]+)([._-]([a-z0-9]+))*[@]([a-z0-9]+)([._-]([a-z0-9]+))*[.]([a-z0-9]){2}([a-z0-9])?$", $email))
{$error = "Your email address seemed incorrect.";
$forward = "yes";
error_box($error, $forward);}
else if($site && !strstr($site, "http://"))
{$error = "Your site url is invalid (http:// remember).";
$forward = "yes";
error_box($error, $forward);}
else if ($msn && !eregi("^([a-z0-9]+)([._-]([a-z0-9]+))*[@]([a-z0-9]+)([._-]([a-z0-9]+))*[.]([a-z0-9]){2}([a-z0-9])?$", $msn))
{$error = "Your MSN email address seemed incorrect.";
$forward = "yes";
error_box($error, $forward);}
else if (!$sex)
{$error = "Please select a sex, if you do not wish to give such information please select N/A.";
$forward = "yes";
error_box($error, $forward);}
else if (strlen($tag) > 2000)
{$error = "You dont want to say to much, hence your FreeSpeech box is limited to 2000 letters.";
$forward = "yes";
error_box($error, $forward);}
else if (strlen($sig) > 500)
{$error = "Signatures are limited to 500 letters.";
$forward = "yes";
error_box($error, $forward);}
else
{//IF FORM SUBMITTED THE AVATAR THEN CONTINUE TO CHECK THE FILE
if($uploadsubmit)
{$avsize = getimagesize($avatar);
//IF USER IS UNLINKING THE FILE THEN WARN THEM (FAKE LOG THREAT)
if(!is_uploaded_file($avatar))
{$error = "Are you trying to hurt me? *logged*.";
$forward = "yes";
error_box($error, $forward);}
//IF AVATAR SIZE IS OVER 20KB WARN THE USER
elseif($avatar_size > 20480)
{$error = "Your file is too big. max size is 20 KB.";
$forward = "yes";
error_box($error, $forward);}
// IF THE FILE ISNT A JPG OR GIF THEN WARN THEM
elseif($avatar_type != "image/gif" && $avatar_type != "image/pjpeg")
{$error = "You can only upload a GIF or JPEG image.";
$forward = "yes";
error_box($error, $forward);}
//IF AVATAR IS BIGGER THAN 50 BY 50 WARN THE USER
elseif($avsize[0] > 50 || $avsize[1] > 50)
{$error = "Your avatar is too big, it must be under 50x50.";
$forward = "yes";
error_box($error, $forward);}
else
//EXPLODE THE AVATAR NAME
{$explode = explode(".", $avatar_name);
$extension = $explode[1];
//ADDS THE USERID TO THE EXTENSION AND COPYS IT TO THE SERVER AND UNLINKS THE AVATAR TO CLEAR THE CACHE
$uid = "".$user_properties['uid']."";
copy($avatar, "images/wuggyuploads/$uid.$extension");
unlink($avatar);
mysql_query("UPDATE unz_users SET email ='$email', email_hide ='$email_hide', avatar = '$extension', site = '$site', msn ='$msn', msn_hide ='$msn_hide', sex = '$sex', bday ='$bday', sig ='$sig', tag ='$tag', ip ='$ip', host = '$host' WHERE uid = ".$user_properties['uid']."");
$success = "Changes applied to your account.";
$forward = "index.php";
success_box($success, $forward);}}
else
{$error = "Some sort of problem...";
$forward = "yes";
error_box($error, $forward);}}
?>
The current problem Im having is an overwrite issue, Ive set the folder to 777 but I cant upload over the older image O_o even with my ftp folder, quite bizare.
Code: Select all
Warning: copy(images/wuggyuploads/1.gif): failed to open stream: Permission denied in /home/azz0r/public_html/pages/member/edit/editing.php on line 78
Success
Changes applied to your account.