Jump to content


Photo

my usercp page won't load --php


  • Please log in to reply
2 replies to this topic

#1 fix3r

fix3r
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 23 October 2006 - 07:51 PM

I've tryed to put this in without any php and the tables work but when I try to put in the update sql database part and some php the page doesn't load when I go to the usercp.. no errors..just doesn't load the included page. Does anyone know what could be the matter?

<?php
session_start();
ob_start();

if(!isset($_SESSION['login'])){
echo "You are not logged in";
}
else {
?>

<div id="include_container">
<div id="include">
<h1>UserCP</h1>
<p>


<?php if (isset($submitted)) {
//form submit code here
$realname = $_POST['realname'];

$aim = $_POST['aim'];
$msn = $_POST['msn'];
$yahoo = $_POST['yahoo'];
$profile = $_POST['profile'];
$current_password = $_POST['password'];
$password1 = $_POST['password1'];
$password2 = $_POST['password2'];

if($current_password < 0) {
mysql_query("UPDATE users SET realname='" . strip_tags($realname) . "', aim='" . strip_tags($aim) . "', msn='" . strip_tags($msn) . "', yahoo='" . strip_tags($yahoo) . "', profile='" . strip_tags($profile) . "' WHERE username='" . $rs['username'] . "'");
echo "Update Successful!";
}

elseif (sha1($current_password) == $rs['password'] && $password1 == $password2) {
mysql_query("UPDATE users SET realname='" . strip_tags($realname) . "', aim='" . strip_tags($aim) . "', msn='" . strip_tags($msn) . "', yahoo='" . strip_tags($yahoo) . "', profile='" . strip_tags($profile) . "', password='" . strip_tags(sha1($password1)) . "' WHERE username='" . $rs['username'] . "'");
echo "Update Successful!";
} 

else { ?>

<form method="POST" action="<?php echo $SCRIPT_NAME ?>">
<table>
<tr>
<td><th align="center" bgcolor="#4F4F4F">Personal Info</th></td>
</tr>
<tr>
<td><b>E-Mail Address</b></td>
<td><?php echo $rs['email']; ?></td>
</tr>
<tr>
<td><b>Real Name</b></td>
<td><input type="text" name="realname" size="16" maxlength="20" value="<?php echo $rs['realname']; ?>"></td>
</tr>
<tr>
<td><th align="center" bgcolor="#4F4F4F">Public Info</th></td>
</tr>
<tr>
<td><b>AOL Messenger</b></td>
<td><input type="text" name="aim" size="16" maxlength="16" value="<?php echo $rs['aim']; ?>"></td>
</tr>
<tr>
<td><b>MSN Messenger</b></td>
<td><input type="text" name="msn" size="16" maxlength="40" value="<?php echo $rs['msn']; ?>"></td>
</tr>
<tr>
<td><b>Yahoo! Messenger</td>
<td><input type="text" name="yahoo" size="16" maxlength="16" value="<?php echo $rs['yahoo']; ?>"></td>
</tr>
<tr>
<td><b>Personal Profile</b></td>
<td><textarea name="profile" cols="50" rows="7" id="profile"></textarea><?php echo $rs['profile']; ?></td>
</tr>
<tr>
<td><th align="center" bgcolor="#4F4F4F">Change Password</th></td>
</tr>
<tr>
<td><b>Current Password</b></td>
<td><input type="password" name="current_password" size="16" maxlength="16" value="">
</tr>
<tr>
<td><b>Password</b></td>
<td><input type="password" name="password1" size="16" maxlength="16" value="">
&nbsp;
    <input type="password" name="password2" size="16" maxlength="16" value=""> * enter twice to make sure</td>
</tr>
</table>
<br>
<center><input type="submit" name="submitted" value="Save Changes"></form></center>
<?php } } } ?>


</div>
</div>


#2 fix3r

fix3r
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 23 October 2006 - 08:10 PM

anyone please, i've been working on this for a day now trying figure out this error but I can't find it..it looks like its a long code to look through but there is only a few lines of code that really matter that displays the page ;\

thanks

#3 orgle12

orgle12
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 23 October 2006 - 09:00 PM

I'm not sure what your problem is, your if statemeants look to be well but maybe someone else might have something to say about this.

orgle




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users