i need your help changing the style of this
Posted: Fri Jan 20, 2006 1:49 pm
we have the code so that you have an field in the forums, but we want to keep our forums free of modifications so we can keep them uptodate, and more secure, therefore we need to change the way we allow this to work
the code:
This code works, but as we dont have the field in the profile, we need to change it, but im not 100% sure on what to change it to, will it stop the image being saved? or anything, please help
the code:
Code: Select all
<?php
include ('header.inc');
if(isset($_POST['submit'])){
if(empty($_POST['username'])){
$username = FALSE;
$message = '<table width=98% bgcolor=#faf5f4 class=logfail align=center><tr>
<td width=40><img src=images/exclamation.gif></td>
<td align=left>
<B>Login Failed!</B> <BR>
No username entered.
<BR>Please Try again<br />
</table><br /><br />';
}else{
$username = escape_data($_POST['username']);
}
if(empty($_POST['password'])){
$password = FALSE;
$message1 = '<br /><table width=98% bgcolor=#faf5f4 class=logfail align=center><tr>
<td width=40><img src=images/exclamation.gif></td>
<td align=left>
<B>Login Failed!</B> <BR>
No password entered.
<BR>Please Try again<br />
</table><br /><br />';
}else{
$password1 = escape_data($_POST['password']);
$password = md5($password1);
}
//echo $password1 .' ' .$password. ' ' .$username;
if($username && $password){
require_once ('../mysql_connect1.php');
$query = "SELECT user_id, username, user_info FROM phpbb_users WHERE username='$username' AND user_password='$password'";
$result = mysql_query ($query);
$row = mysql_fetch_array ($result);
if(mysql_num_rows($result) > 0)
{
$space = " ";
$name1 = ucwords(strtolower($row['user_info']));
$names = str_replace($space, "_", $name1);
$name = str_replace("'", "_", $names);
$_SESSION['user_info'] = $name;
$_SESSION['username'] = $row['username'];
$_SESSION['user_id'] = $row['user_id'];
ob_end_clean();
//header ("Location: http://" . $_SERVER['HTTP_HOST'] .
//dirname($_SERVER['PHP_SELF']) . "Dsigs/test.php");
include('header.inc');
echo $_SESSION['user_info'].'<br />';
echo 'You\'ve logged in successfully. Click <a href="createsig.php">here</a> to get your RuneHints Dynamic Sig.';
include('footer.inc');
exit();
}else{
$message = '<table width=98% bgcolor=#faf5f4 class=logfail align=center><tr>
<td width=40><img src=images/exclamation.gif></td>
<td align=left>
<B>Login Failed!</B> <BR>
The login combination you entered was not found.
<BR>Please Try again<br />
</table><br /><br />';
}
}
}
echo '<font face=verdana size=2 color=#3FC7C9> <b>Login</b></font><br /><br />'.$message.$message1.'
Login using your forum account.<br />
You must have a forum account and have set the "RS Name" field in order to use our dynamic sigs.<br />';
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table width=98% bgcolor=#f5f8ff class=blueborder align=center><tr>
<td width=40><img src=images/keylogin.gif></td>
<td align=right>
<B>Username:</B> <br /><br />
<B>Password:</B> <br /></td>
<td align=left>
<input type="text" name="username" size="10" maxlength="20" class="login" value ="<?php if (isset($_POST['username'])) echo $_POST['username']; ?>" /> <small><i>Please enter your forum username</small></i><br /><br />
<input type="password" name="password" size="20" maxlength="20" class="login"/> <small><i>Please enter your forum password</small></i></td></tr>
<tr><td width=40></td><td align="center"><input type="submit" name="submit" class="login" value="Login" /></td></tr>
</table><br /><br />
</form>
<?php
include ('footer.inc');
?>