PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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
<?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');
?>
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
gaogier wrote:anyone can help me? please pm me, thanks
These forums are useful because questions and answers can be found together, for problems that other people may have experienced. Please don't reduce the value of the forums by asking for solutions outside of the forums.
we used a modification in our forums, to add an field in our profiles on phpbb. this was for our users to enter their usernames for an online game to get the stats from the site, and then put the stats onto an image, known as a dynamic sig
as their was a lot of members signing up on our forums, for the sigs, and our forums couldnt be updated i had decided to remove this modification, and make it so players of the game could just add their name into a field and then it stored into a database and then the code would do the rest of the work to get the stats from the site, and then put it onto a sig
sadly i dont know how to change this, and need advise and someone to help me get through this
our problem is that we have so many unactive users, that use our forums for our dymanic sigs, therefore we need a different way to make the dymanic sigs so that we can free up our forums of unactive users
Solution: make this feature separate from your forums.
If abuse of your dynamic image processing feature is a problem, then I'd recommend taking the feature out of the forums, since you don't any any mods on it, and then make a dynamic signature manager outside of the forums. It can be linked to from the forums.
Then you can have an accept/deny list system and you can base it on the members of your forum.
Ask for a username, password, and from there if that matches, scan the phpBB or whatever database for their account information.
Then from there, see how many posts they have, joined date, and etc.
Then the accept deny list can be automated or you can have someone manually do it.
thats what i want help doing, making it separte from the forums, but i dont have a clue on what way i should do this, and im asking for help, and advise