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
https://forums.phpfreaks.com/topic/24870-my-usercp-page-wont-load-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.