| Server IP : 208.122.213.31 / Your IP : 216.73.216.185 Web Server : Apache System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64 User : WHMCS_MIA_382 ( 1001) PHP Version : 7.4.33 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/httpd/html/www.superporner.com/tube/ |
Upload File : |
<?
session_start();
include('admin/db.php');
if(!$_SESSION[userid]) {
header("Location: /login.php");
exit();
}
if($_POST) {
$uniq = uniqid();
$newpassword = mysql_real_escape_string($_POST[newpassword]);
$age = mysql_real_escape_string($_POST[age]);
$gender = mysql_real_escape_string(strip_tags($_POST[gender]));
$description = mysql_real_escape_string(strip_tags($_POST[description]));
$location = mysql_real_escape_string(strip_tags($_POST[location]));
$email = mysql_real_escape_string($_POST[email]);
mysql_query("UPDATE users SET email = '$email', location = '$location', age = '$age', gender = '$gender', description = '$description' WHERE record_num = '$_SESSION[userid]'");
$message = "Your information has been updated.";
if($_POST[newpassword]) {
$newpass = mysql_real_escape_string(md5($_POST[newpassword]));
mysql_query("UPDATE users SET password = '$newpass' WHERE record_num = '$_SESSION[userid]'");
}
if($_FILES[file][tmp_name]) {
if(filesize($_FILES[file][tmp_name]) > 51200) {
$message = "Your avatar is too big. It can be a maximum of 50kb in GIF,JPG, or PNG format.";
}
else {
$ext = explode(".",strtolower($_FILES[file][name]));
$ext = array_reverse($ext);
if($ext[0] != 'jpg' && $ext[0] != 'jpeg' && $ext[0] != 'png' && $ext[0] != 'gif') {
$message = "You may only upload image files.";
}
else {
$filename = $uniq.'.'.$ext[0];
$target = $misc_path."/".$filename;
move_uploaded_file($_FILES[file][tmp_name],$target);
list($width, $height, $type, $attr) = getimagesize($target);
//if($width > $thumbwidth || $height > $thumbheight) {
// $message = "Your image may be a maximum of $thumbwidth"."x".$thumbheight;
// @unlink($target);
//}
//else {
mysql_query("UPDATE users SET avatar = '$filename' WHERE record_num = '$_SESSION[userid]'");
$message = "Your information has been updated.";
//}
}
}
}
}
$result = mysql_query("SELECT * FROM users WHERE record_num = '$_SESSION[userid]'");
$row = mysql_fetch_array($result);
$title = 'Edit Profile';
$headertitle = 'Edit Profile';
include($basepath.'/templates/template.overall_header.php');
?>
<? if($message) { echo "<p>$message</p>"; } ?>
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
<table width="560" border="0" align="center">
<tr>
<td width="143">Your Password</td>
<td width="407"><input type="text" name="newpassword" id="textfield" value='' /></td>
</tr>
<tr>
<td width="143">Email Address</td>
<td width="407"><input type="text" name="email" id="textfield" value='<? echo $row[email]; ?>' /></td>
</tr>
<tr>
<td width="143">Location</td>
<td width="407"><input type="text" name="location" id="textfield" value='<? echo $row[location]; ?>' /></td>
</tr>
<tr>
<td>Age</td>
<td><select name="age" id="select" style='width: 50px;'>
<? for($i = 18; $i < 100; $i++) {
if($row[age] == $i) { $selected = 'selected'; } else { $selected = ''; }
echo "<option $selected value='$i'> $i </option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>Gender</td>
<td><select name="gender" id="select2">
<option <? if($row[gender] == 'Male') { echo 'selected'; } ?> value='Male'>Male</option>
<option <? if($row[gender] == 'Female') { echo 'selected'; } ?> value='Female'>Female</option>
</select>
</td>
</tr>
<tr>
<td valign="top">A Bit About Yourself...</td>
<td><textarea name="description" id="textarea" cols="45" rows="8"><? echo $row[description]; ?></textarea></td>
</tr>
<tr>
<td>Upload Avatar (<? echo $thumbwidth; ?>x<? echo $thumbheight; ?>, max 50kb)</td>
<td><input type="file" name="file" id="fileField" /></td>
</tr>
<? if($row[avatar] != '') { ?>
<tr>
<td>Current Avatar</td>
<td align='left'><img src='<? echo $misc_url; ?>/<? echo $row[avatar]; ?>' width=<? echo $thumbwidth; ?> height=<? echo $thumbheight; ?> /></td>
</tr>
<? } ?>
<tr>
<td colspan="2" align="center"><input type="submit" name="button" id="button" value="Save" /></td>
</tr>
</table>
</form>
<br class="clearfloat" />
<? include($basepath.'/templates/template.overall_footer.php'); ?>