Jump to content

my usercp page won't load --php


fix3r

Recommended Posts

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?

[code]
<?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>
[/code]
Link to comment
Share on other sites

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.