i need your help changing the style of this

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!

Moderator: General Moderators

gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

i need your help changing the style of this

Post by gaogier »

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:

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']; ?>" />&nbsp;&nbsp;<small><i>Please enter your forum username</small></i><br /><br />							
							<input type="password" name="password" size="20" maxlength="20" class="login"/>&nbsp;&nbsp;<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
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

anyone can help me? please pm me, thanks
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

the problem is not clear...I think you should spend more time explaining it with examples if possible...thanks
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

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.
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

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

thanks
gaogier
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

dose anyone know?
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

sorry agian, but i need help on this
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Unfortunantly I'm still unclear as to what to what your problem is.

You could always try posting in the Volunteer Board too..
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Why not prune inactive users? Are you using phpbb?
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

because they use the dynaimc sigs, therefore if we prune them they will just sign back up

this is the reason why im trying to make it a different way
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

make a cron job to prune the users every day?
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

you dont understand, the users are using a feature of our forums, therefore we need to change it so we can prune inactive members
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

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.
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

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
Post Reply