-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditprofile.php
777 lines (738 loc) · 28 KB
/
editprofile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
<?php
include_once("include/authentication.php");
function strip_Java($str)
{
$str = str_replace('javascript:', '', $str);
$str = str_replace('onclick', '', $str);
$str = str_replace('onmouseover', '', $str);
$str = str_replace('onmouseout', '', $str);
return $str;
}
//include the header after all the possibilities that the user could be redirected
//if there are any headers sent after this point, move this include_once();
ob_start();
if(isset($_POST['submitted']) && $_POST['submitted'] == 1)
{
$error = '';
$phone = 'null';
$aim = 'null';
$aboutme = 'null';
$likes = '';
$dislikes = '';
//check to see if privacy is set first//
if(isset($_POST['phone']))
{
$phone = $_POST['phone'];
}
if (isset($_POST['phone']) && (!eregi('^\(?[0-9]{0,3}\)?(-|.|\s)?[0-9]{3}(-|.|\s)?[0-9]{4}$', $phone)) && !($_POST['phone'] == ''))
{
$error = $error.'<div class="error">Phone number has invalid format. </div>';
}
else
{
if(isset($_POST['loginName']) && $_POST['loginName'] != '' && $_POST['loginName'] != '*NONE*')
{
$availTest = mysql_query("SELECT login from login WHERE login='".$_POST['loginName']."' AND id != ".$_COOKIE['userid'].";", $connection);
if (mysql_num_rows($availTest) > 0)
{
$error = $error.'<p class="error">Login Name is not available</p>';
$loginName = '';
}
else if(!(eregi('^([[:alnum:]]|-|_)+$', $_POST['loginName'])))
{
$error = $error.'<p class="error">Login Name has invalid characters only (A-Z, a-z, 0-9, -, _) allowed</p>';
$loginName = '';
}
else
{
$loginName = $_POST['loginName'];
}
}
else
{
$loginName = '*NONE*';
}
$aim = $_POST['aim'];
$aboutme = $_POST['aboutme'];
while(strpos($aboutme, '<?')> -1)
{
$pos = strpos($aboutme, '<?');
$aboutmefront = substr($aboutme, 0, $pos);
$aboutmeback = substr($aboutme, $pos + 2);
$aboutme = "$aboutmefront $aboutmeback";
}
while(strpos($aboutme, '?>')> -1)
{
$pos = strpos($aboutme, '?>');
$aboutmefront = substr($aboutme, 0, $pos);
$aboutmeback = substr($aboutme, $pos + 2);
$aboutme = "$aboutmefront $aboutmeback";
}
$aboutme = strip_tags($aboutme, '<font><a>');
$aboutme = strip_Java($aboutme);
$aim = strip_tags($aim);
$bgcolor = $_POST['bgcolor'];
$altEmail = strip_tags($_POST['altEmail']);
$sex = $_POST['sex'];
if(strlen($sex) > 1)
{
$sex = ' ';
}
$from_state = strip_tags($_POST['from_state']);
$hometown = strip_tags($_POST['hometown']);
if (strcmp($bgcolor, "NONE") == 1)
{
die('HMM');
$dataBgColor = mysql_query('SELECT bgcolor FROM users where id = '.$_COOKIE['userid'].';', $connection) or die("error occured, please report this");
$rowBgColor = mysql_fetch_array($dataBgColor, MYSQL_ASSOC);
$bgcolor = $rowBgColor['bgcolor']; //if the person didn't select a valid color change, keep their old color.
}
if($error == '')
{
mysql_query('UPDATE users SET from_state="'.$from_state.'", hometown="'.$hometown.'", phonenum = "'.$phone.'", sex="'.$sex.'", altEmail="'.$altEmail.'", aim = "'.$aim.'", aboutme = "'.$aboutme.'", bgcolor = "'.$bgcolor.'" WHERE id = '.$_COOKIE['userid'].';', $connection) or die("error submitting");
mysql_query('UPDATE login SET login = "'.$loginName.'" WHERE id = '.$_COOKIE['userid'].';', $connection) or die('error');
//print '<div class="success">Profile Updated<br><a href="profile.php?id='.$_COOKIE['userid'].'">Back to Profile</a></div>';
header('Location: profile.php?id='.$_COOKIE['userid']);
}
}
}
else if(isset($_POST['privacySubmitted']))
{
$privacy = '0';
if(isset($_POST['privacy']))
{
$privacy = $_POST['privacy'];
if(!is_numeric($privacy) || $privacy > 2 || $privacy < 0)
{
$privacy = 0;
}
}
$sendMailData = mysql_query('SELECT sendMail FROM users WHERE id = '.$_COOKIE['user'].';', $connection);
$sendMail = mysql_fetch_array($sendMailData, MYSQL_ASSOC);
$sendMailString = $sendMail['sendMail'];
if($_POST['mailFriend'] == 'on' && ((strpos($sendMail['sendMail'], '1') <= 0)))
{
$sendMailString = $sendMailString.' 1';
}
else if($_POST['mailFriend'] != 'on' && ((strpos($sendMail['sendMail'], '1') > -1)))
{
$sendMailString = substr($sendMailString, 0, strpos($sendMailString, '1')).substr($sendMailString, strpos($sendMailString, '1')+2);
}
if($_POST['mailMess'] == 'on' && ((strpos($sendMail['sendMail'], '2') <= 0)))
{
$sendMailString = $sendMailString.' 2';
}
else if($_POST['mailMess'] != 'on' && ((strpos($sendMail['sendMail'], '2') > -1)))
{
$sendMailString = substr($sendMailString, 0, strpos($sendMailString, '2')).substr($sendMailString, strpos($sendMailString, '2')+2);
}
if($_POST['mailUpdate'] == 'on' && ((strpos($sendMail['sendMail'], '3') <= 0)))
{
$sendMailString = $sendMailString.' 3';
}
else if($_POST['mailUpdate'] != 'on' && ((strpos($sendMail['sendMail'], '3') > -1)))
{
$sendMailString = substr($sendMailString, 0, strpos($sendMailString, '3')).substr($sendMailString, strpos($sendMailString, '3')+2);
}
if($_POST['mailComm'] == 'on' && ((strpos($sendMail['sendMail'], '4') <= 0)))
{
$sendMailString = $sendMailString.' 4';
}
else if($_POST['mailComm'] != 'on' && ((strpos($sendMail['sendMail'], '4') > -1)))
{
$sendMailString = substr($sendMailString, 0, strpos($sendMailString, '2')).substr($sendMailString, strpos($sendMailString, '2')+2);
}
mysql_query('UPDATE users SET sendMail ="'.$sendMailString.'" WHERE id = '.$_COOKIE['userid'].';', $connection) or die("error submitting");
mysql_query('UPDATE login SET privacy='.$privacy.' WHERE id = '.$_COOKIE['userid'].';', $connection) or die('error');
header('Location: profile.php?id='.$_COOKIE['userid']);
}
else if(isset($_POST['likesSubmitted']))
{
$likes = strip_tags($_POST['likes']);
$dislikes = strip_tags($_POST['dislikes']);
$likes = addslashes($likes);
$dislikes = addslashes($dislikes);
mysql_query('UPDATE users SET likes ="'.$likes.'", dislikes = "'.$dislikes.'" WHERE id='.$_COOKIE['userid'].';', $connection ) or die('error please report this to a system Admin');
header('Location: profile.php?id='.$_COOKIE['userid']);
}
else if(isset($_POST['picture']) && $_POST['picture'])
{
$uploaded = false;
$picture = $_FILES['file']['name'];
if($_POST['verify'] == 'on')
{
if(eregi('\.[gif|jpg|png|jpeg]*$', $picture))
{
if(is_uploaded_file($_FILES['file']['tmp_name']))
{
$data = mysql_query('SELECT email FROM login WHERE id = '.$_COOKIE['userid'].';', $connection);
$row = mysql_fetch_array($data, MYSQL_ASSOC);
$uploaddir = 'images/'.$_COOKIE['userid'].'_'.md5($row['email']).'/';
if(!file_exists($uploaddir))
{
mkdir($uploaddir);
chmod($uploaddir, 0777);
}
else
{
$userPictureData = mysql_query('SELECT image_url, thumb_url FROM users where id='.$_COOKIE['userid'].';', $connection);
$userPicture = mysql_fetch_array($userPictureData, MYSQL_ASSOC);
$handle = opendir($uploaddir);
unlink($userPicture['image_url']);
unlink($userPicture['thumb_url']);
}
switch($_FILES['file']['type'])
{
case 'image/gif':
$type = '.gif';
break;
case 'image/jpg':
$type = '.jpg';
break;
case 'image/png':
$type = '.png';
break;
case 'image/jpeg':
$type = '.jpeg';
break;
default:
$type = '.jpg';
break;
}
srand(time());
//start the session
$pictureName = md5(rand());
$thumbnailDir = $uploaddir.$pictureName.'Thumb.jpg';
$uploaddir = $uploaddir.$pictureName.$type;
mysql_query('update users set image_url = "'.$uploaddir.'", thumb_url="'.$thumbnailDir.'" where id = '.$_COOKIE['userid'].';', $connection) or die("error");
if (rename($_FILES['file']['tmp_name'], $uploaddir))
{
// The file you are resizing
$file = $uploaddir;
// Setting the resize parameters
list($width, $height) = getimagesize($file);
if($width > 60)
{
$sizeW = 60 / $width;
}
else
{
$sizeW = 1;
}
if($height > 90)
{
$sizeH = 90 / $height;
}
else
{
$sizeH = 1;
}
$size = min($sizeW, $sizeH);
$modwidth = $width * $size;
$modheight = $height * $size;
// Creating the Canvas
$tn= imagecreatetruecolor($modwidth, $modheight);
if($type=='.jpeg' || type=='.jpg')
{
$source = imagecreatefromjpeg($file);
}
else if($type =='.gif')
{
$source = imagecreatefromgif($file);
}
else if($type == '.png')
{
$source = imagecreatefrompng($file);
}
else
{
$source = imagecreatefromjpeg($file);
}
// Resizing our image to fit the canvas
imagecopyresampled($tn, $source, 0, 0, 0, 0, $modwidth, $modheight, $width, $height);
// Outputs a jpg image, you could change this to gif or png if needed
imagejpeg($tn, $thumbnailDir, 100);
// The file you are resizing
$file = $uploaddir;
// Setting the resize parameters
list($width, $height) = getimagesize($file);
if($width > 200)
{
$sizeW = 200 / $width;
}
else
{
$sizeW = 1;
}
if($height > 300)
{
$sizeH = 300 / $height;
}
else
{
$sizeH = 1;
}
$size = min($sizeW, $sizeH);
$modwidth = $width * $size;
$modheight = $height * $size;
// Creating the Canvas
$tn= imagecreatetruecolor($modwidth, $modheight);
if($type=='.jpeg' || type=='.jpg')
{
$source = imagecreatefromjpeg($file);
}
else if($type =='.gif')
{
$source = imagecreatefromgif($file);
}
else if($type == '.png')
{
$source = imagecreatefrompng($file);
}
else
{
$source = imagecreatefromjpeg($file);
}
// Resizing our image to fit the canvas
imagecopyresampled($tn, $source, 0, 0, 0, 0, $modwidth, $modheight, $width, $height);
// Outputs a jpg image, you could change this to gif or png if needed
if($type=='.jpeg' || type=='.jpg')
{
imagejpeg($tn, $uploaddir, 100);
}
else if($type =='.gif')
{
imagegif($tn, $uploaddir, 100);
}
else if($type == '.png')
{
imagepng($tn, $uploaddir, 100);
}
else if($type == '.bmp')
{
imagejpeg($tn, $uploaddir, 100);
}
else
{
imagejpeg($tn, $uploaddir, 100);
}
$uploaded = true;
chmod($uploaddir, 0777);
}
else
{
$error = $error.'<div class="error">error uploading '.$_FILES['file']['name'].'</div>';
}
}
else
{
$error = $error.'<div class="error">error uploading '.$_FILES['file']['name'].' file too big</div>';
}
}
else
{
$error = $error.'<div class ="error">File must be (.gif, .jpg, .bmp, .jpeg)</div>';
}
}
else
{
$error = $error.'<div class ="error">Photo Must be verified</div>';
}
}
else if (isset($_POST['password']))
{
$conPass = $_POST['conPass'];
$pass = $_POST['password'];
$newPass = $_POST['newPass'];
$wrongpass=false;
$badpass = false;
$passChanged = false;
$data = mysql_query("SELECT password from login WHERE password = '".$pass."';", $connection) or die('error');
if(mysql_num_rows($data) == 0)
{
$wrongpass= true;
}
else if($conPass != $newPass)
{
$badpass = true;
}
else
{
mysql_query('UPDATE login SET password = "'.$newPass.'" WHERE password="'.$pass.'" AND id='.$_COOKIE['userid'].' AND auth_key="'.$_COOKIE['AK'].'";', $connection) or die('error');
$passChanged=true;
}
}
if(isset($_COOKIE['userid']))
{
$data = mysql_query('SELECT phonenum, aim, likes, dislikes, aboutme, bgcolor, privacy, login, altEmail, sex, from_state, hometown FROM users, login WHERE login.id = users.id AND users.id = '.$_COOKIE['userid'].';', $connection) or die("error selecting");
$row = mysql_fetch_array($data, MYSQL_ASSOC);
if(!isset($_POST['phone']))
{
$phone = stripslashes($row['phonenum']);
}
$aim = stripslashes($row['aim']);
$aboutme = stripslashes($row['aboutme']);
$altEmail = stripslashes($row['altEmail']);
$bgcolor = stripslashes($row['bgcolor']);
$loginName = stripslashes($row['login']);
$privacy = stripslashes($row['privacy']);
$likes = stripslashes($row['likes']);
$dislikes = stripslashes($row['dislikes']);
$sex = stripslashes($row['sex']);
$from_state = stripslashes($row['from_state']);
$hometown = stripslashes($row['hometown']);
$aboutme = strip_tags($aboutme, '<a><font>');
$aim = strip_tags($aim);
}
print "<script type='text/javascript'>
(new Image()).src = 'images/box/title2.gif';
(new Image()).src = 'images/box/titleLeft2.gif';
(new Image()).src = 'images/box/titleRight2.gif';
(new Image()).src = 'images/box/title3.gif';
(new Image()).src = 'images/box/titleLeft3.gif';
(new Image()).src = 'images/box/titleRight3.gif';
(new Image()).src = 'images/box/title4.gif';
(new Image()).src = 'images/box/titleLeft4.gif';
(new Image()).src = 'images/box/titleRight4.gif';
(new Image()).src = 'images/box/title1.gif';
(new Image()).src = 'images/box/titleLeft1.gif';
(new Image()).src = 'images/box/titleRight1.gif';
</script>";
include_once("include/header.php");
?>
<html>
<head>
<title>Edit Profile</title>
<link rel="Stylesheet" type="text/css" href="/include/EditStyle.css">
</head>
<div id="mainContentPart">
<div class="schoolIndexCenterbox">
<div id="schoolIndexHeader"><img src="/images/editProfile.jpg"></img><div>-Edit your Profile-</div><br> <p>Update your profile to allow everyone to know more about you. From here you can: choose a login, write about yourself, list your contact infomation, list your likes and disklikes, change your password, choose a login and delete your account. If you have any suggestions about other things you would like to see on this page, or this site, please email us. We love feedback.</p></div>
<div id="editNavPage">
<ul>
<li><a id="AboutMeNav" href="javascript:editOpen('AboutMe')"><div class="EditButton">About Me</div></a></li>
<li><a id="LikesNav" href="javascript:editOpen('likes')"><div class="EditButton">Likes/Dislikes</div></a></li>
<li><a id="PassNav" href="javascript:editOpen('Pass')"><div class="EditButton">Password</div></a></li>
<li><a id="PriveNav" href="javascript:editOpen('Priv')"><div class="EditButton">Privacy</div></a></li>
<li><a id="PicNav" href="javascript:editOpen('Picture')"><div class="EditButton">Picture</div></a></li>
<li><a href="deleteAccount.php"><div class="EditButton">Delete Account</div></a></li>
</ul>
</div>
<?php
if (isset($error) && $error != '')
{
print $error;
}
if(isset($uploaded) && $uploaded)
{
print '<div class="success">uploaded '.$_FILES['file']['name'].'</div>';
}
if($wrongpass)
{
print '<p class="error">Wrong Password</p>';
print '<a href="login.php">Back</a>';
}
else if($badpass)
{
print '<p class="error">New Passwords do not match. Make sure you typed them correctly.</p>';
}
if(isset($passChanged) && $passChanged)
{
print '<p class="success">Password Changed!</p>';
}
?>
<div id="composebox">
<table id = "profileedit">
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="POST">
<tr class="white"><td>
<div class="box" style="width: 400px">
<table id="boxTable" cellspacing="0" cellpadding="0" border="0" style="background-color: #DDD">
<tr class="title2"><td class="titleLeft2"> </td><td class="boxTitle"><img src="/images/chooseLogin.gif"></img></td><td class="titleRight2"> </td></tr>
<tr><td class="bl2"></td><td>
<div style="background-color: #FFF; border: 1px #AAA solid; padding: 5px; margin: 2px;">
<label for="loginName">Choose Login:</label>
<input onKeyUp="var data = 'data=' + this.value; getData('logCheck.php', data, 'logCheck');" type="text" name="loginName" value="<?php print $loginName ?>">
</div>
<br>Availability:<span id="logCheck"></span>
<div class="note" style="background-color: #FFF !important">A login allows you and others to access your page simply by typing TheCollegeNotebook.com/*YourLogin*.</div>
</td><td class="br2"></td></tr>
<tr class = "bbm2"><td class="bbl2"></td><td></td><td class="bbr2"></td></tr>
</table>
</div>
</td>
<td>
<div class="box">
<table id="boxTable" cellspacing="0" cellpadding="0" border="0" style="background-color: #DDD; height: 135px;">
<tr class="title3"><td class="titleLeft3"> </td><td class="boxTitle"><img src="/images/contactInfo.gif"></img></td><td class="titleRight3"> </td></tr>
<tr><td class="bl"></td><td>
<table>
<tr>
<td>
<label for="phone">Phone:</label></td>
<td><input type="text" name="phone" value="<?php print $phone ?>"></td></tr>
<tr class="white"><td><label for="aim">AIM:</label>
</td>
</td>
<td>
<input type="text" name="aim" value="<?php print $aim ?>">
</td>
</tr>
<tr>
<td>
<label for="phone">Alternate Email:</label></td>
<td><input type="text" name="altEmail" value="<?php print $altEmail ?>"></td></tr>
</table>
<td class="br"></td></tr>
<tr class = "bbm"><td class="bbl"></td><td></td><td class="bbr"></td></tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<div class="box" style="width: 400px: margin: 0px auto;">
<table id="boxTable" cellspacing="0" cellpadding="0" border="0" style="background-color: #DDD;">
<tr class="title1"><td class="titleLeft1"> </td><td class="boxTitle"><img src="/images/aboutMe.gif"></img></td><td class="titleRight1"> </td></tr>
<tr><td class="bl"></td>
<td style="padding: 20px">
<textarea rows="15" cols="60" name="aboutme"><?php print $aboutme ?></textarea>
</td>
<td class="br"></td></tr>
<tr class = "bbm"><td class="bbl"></td><td></td><td class="bbr"></td></tr>
</table>
</div>
</td>
<td>
<div class="box" style="height: 100%">
<table id="boxTable" cellspacing="0" cellpadding="0" border="0" style="background-color: #DDD;">
<tr class="title4"><td class="titleLeft4"> </td><td class="boxTitle"><img src="/images/general.gif"></img></td><td class="titleRight4"> </td></tr>
<tr><td class="bl"></td>
<td style="padding: 20px">
<table>
<tr>
<td>
Home state:
</td>
<td>
<select name="from_state">
<?php
if($from_state != ' ' && $from_state != '')
{
print '<optgroup label="Currently">';
print '<option value="'.$from_state.'">'.$from_state.'</option>';
print '</optgroup>';
print '<optgroup label="------------">';
print '<option value=" ">**None**</option>';
}
else
{
print '<option value=" ">*Select State*</option>';
}
?>
<option value="Alabama">Alabama</option>
<option value="Alaska">Alaska</option>
<option value="Arizona">Arizona</option>
<option value="Arkansas">Arkansas</option>
<option value="California">California</option>
<option value="Colorado">Colorado</option>
<option value="Connecticut">Connecticut</option>
<option value="Delaware">Delaware</option>
<option value="Florida">Florida</option>
<option value="Georgia">Georgia</option>
<option value="Hawaii">Hawaii</option>
<option value="Idaho">Idaho</option>
<option value="Illinois">Illinois</option>
<option value="Indiana">Indiana</option>
<option value="Iowa">Iowa</option>
<option value="Kansas">Kansas</option>
<option value="Kentucky">Kentucky</option>
<option value="Louisianna">Louisianna</option>
<option value="Maine">Maine</option>
<option value="Maryland">Maryland</option>
<option value="Massachusetts">Massachusetts</option>
<option value="Michigan">Michigan</option>
<option value="Minnesota">Minnesota</option>
<option value="Mississippi">Mississippi</option>
<option value="Missouri">Missouri</option>
<option value="Montana">Montana</option>
<option value="Nebraska">Nebraska</option>
<option value="Nevada">Nevada</option>
<option value="New Hampshire">New Hampshire</option>
<option value="New Jersey">New Jersey</option>
<option value="New Mexico">New Mexico</option>
<option value="New York">New York</option>
<option value="North Carolina">North Carolina</option>
<option value="North Dakota">North Dakota</option>
<option value="Ohio">Ohio</option>
<option value="Oklohoma">Oklohoma</option>
<option value="Oregon">Oregon</option>
<option value="Pennsylvania">Pennsylvania</option>
<option value="Rhode Island">Rhode Island</option>
<option value="South Carolina">South Carolina</option>
<option value="South Dakota">South Dakota</option>
<option value="Tennessee">Tennessee</option>
<option value="Texas">Texas</option>
<option value="Utah">Utah</option>
<option value="Vermont">Vermont</option>
<option value="Virginia">Virginia</option>
<option value="Washington">Washington</option>
<option value="West Virginia">West Virginia</option>
<option value="Wisconsin">Wisconsin</option>
<option value="Wyoming">Wyoming</option>
</select>
</td>
</tr>
<tr>
<td>
Hometown:
</td>
<td>
<input type="text" name="hometown" value="<?php print $hometown; ?>">
</td>
</tr>
<tr>
<td>
<label for="sex">Gender:</label></td>
<td><select name="sex">
<option value=" ">Select Gender</option>
<option value="M" <?php if($sex =='M'){print 'selected="selected"';} ?>>Male</option>
<option value="F" <?php if($sex =='F'){print 'selected="selected"';} ?>>Female</option>
</td>
</tr>
</table>
</td>
<td class="br"></td></tr>
<tr class = "bbm"><td class="bbl"></td><td></td><td class="bbr"></td></tr>
</table>
</div>
</td>
</tr>
<tr class="white"><td colspan="100%" align="center"><input type="submit" value="Submit"></td></tr>
<input type="hidden" name="submitted" value="1">
</form>
</table>
<div id="privacyEdit">
<div class="box">
<table id="boxTable" cellspacing="0" cellpadding="0" border="0" style="background-color: #DDD; height: 135px;">
<tr class="title3"><td class="titleLeft3"> </td><td class="boxTitle"><img src="/images/privacySetting.gif"></img></td><td class="titleRight3"> </td></tr>
<tr><td class="bl"></td><td>
<table>
<tr>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="POST">
<td style="padding: 10px">
<div id="privacySquare">
<p style="font-size: 15px">-Profile Privacy-</p><br>
<div class="note">Privacy allows you to regulate who can see your profile.<br>Your privacy Setting is:
<select name="privacy">
<optgroup label="Currently">
<option selected="selected" value="<?php print $privacy ?>">Currently: <?php switch ($privacy){case 0: print 'Public'; break; case 1: print 'All TCN users'; break; case 2: print 'Just Friends'; break;} ?></option>
</optgroup>
<optgroup label="Options">
<option value ="0">Public</option>
<option value ="1">All TCN users</option>
<option value ="2">Just Friends</option>
</optgroup>
</select>
</div>
</div>
</td>
<td>
<div id="mailSquare">
<p style="font-size: 15px">-Alerts-</p><br>
Which alerts would you like to recieve via email.<br>
<?php
$sendMail = mysql_query('SELECT sendMail FROM users WHERE id = '.$_COOKIE['userid'].';', $connection) or die('error getting your mail preferences');
$sendMail = mysql_fetch_array($sendMail, MYSQL_ASSOC);
if(strpos($sendMail['sendMail'], '1') > -1)
{
$sendFriends = true;
}
if(strpos($sendMail['sendMail'], '2') > -1)
{
$sendMess = true;
}
if(strpos($sendMail['sendMail'], '3') > -1)
{
$sendUpdate = true;
}
if(strpos($sendMail['sendMail'], '4') > -1)
{
$sendComm = true;
}
?>
<input type="checkbox" name="mailFriend" <?php if(isset($sendFriends)){ print 'CHECKED'; } ?>>Friend Requests</input><br>
<input type="checkbox" name="mailMess" <?php if(isset($sendMess)){ print 'CHECKED'; } ?>>Messages</input><br>
<input type="checkbox" name="mailUpdate" <?php if(isset($sendUpdate)){ print 'CHECKED'; } ?>>Site Updates</input><br>
<input type="checkbox" name="mailComm" <?php if(isset($sendComm)){ print 'CHECKED'; } ?>>Comments</input>
</div>
</td>
</tr><tr><td colspan="100%" align="center"><input type="submit" value="Save"><input type="hidden" name="privacySubmitted" value="1"></td>
</form>
</tr>
</table>
</td>
<td class="br"></td></tr>
<tr class = "bbm"><td class="bbl"></td><td></td><td class="bbr"></td></tr>
</table>
</div>
</div>
<div id="likes">
<p class="pagetitle">Likes / Dislikes</p><br>
<p class="note">This is a place to edit what you like and dislike, this can be anything you like or dislike.</p>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="POST">
<table id = "likesEdit">
<tr><td class="cat"><label for="likes">Likes:</label></td>
<td><textarea id="Editlikes" rows="15" cols="60" name="likes"><?php print $likes ?></textarea></td></tr>
<tr class="gray"><td class="cat"><label for="dislikes">Dislikes:</label></td>
<td><textarea id="Editdislikes" rows="15" cols="60" name="dislikes"><?php print $dislikes ?></textarea></td></tr>
<tr class="white"><td colspace="100%" align="center"><input type="submit" value="Submit"></td></tr>
<input type="hidden" name="likesSubmitted" value="1">
</table>
</form>
</div>
<div id="editLeft">
<p class="note">Upload a picture for your main profile.</p><br><br>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="POST" enctype="multipart/form-data" onSubmit="document.getElementById('uploading').style.visibility = 'visible';">
<label for="picture" color="#004499">Upload a picture from your computer:<br></label>
<input type="hidden" name = "MAX_FILE_SIZE" value="500000">
<input type="file" name ="file">
<input type="submit" name = "Go" value="Go">
<input type="hidden" name="picture" value ="1">
<br><br>
<input name="verify" type="checkbox"><label>I verify that this picture contains no copyrighted nor inappropriate material.</label>
<label><div class="note">*By hitting submit you acknowledge that this picture does not contain any offensive material. You also acknowledge that you have the right to post this picture.</div></label>
</form>
<div id="uploading" style="visibility: hidden; color: #FFF; background-color: #454b65; border: 5px #FFF solid;"><img src="images/updating.gif"></img>Uploading....</div>
</div>
<div id="editRight">
<p class="pagetitle">Password Change</p>
<br>
<p class="note">Remember to never give out your password. Admins will never ask for it.</p>
<table>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method='post'>
<tr><td>
<label for="oldpassword"><font color="#454b65">Old password:</font></label></td><td>
<input type="password" name="password"></input>
</td></tr>
<tr><td>
<label for="newpassword"><font color="#454b65">New password:</font></label></td><td>
<input type="password" name="newPass"></input>
</td></tr>
<tr><td>
<label for="conpassword"><font color="#454b65">Retype new password:</font></label></td><td>
<input type="password" name="conPass"></input>
</td></tr>
<tr><td>
<input type="submit" value="Change Password"></input>
</td></tr>
</form>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<img id="bodyBottom" src="/images/bodybottom.gif"></img>
</body>
</html>