• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Request][PHP] Display acc number and pass

Kavvson

Gdy boli cie glowa wez
Joined
Jun 25, 2008
Messages
1,177
Reaction score
72
Location
Poland
I want a script when you write into a <form> the Players name you will see his account and password from the database :))

regards if anyone have time to do it.. It isnt hard
 
like this? is one example, another you make it :P
PHP:
<?php
$name = $_POST['name'];
if ($name) {
<<<FormReg
<form method="post" action="">
Name   <input type="Text" name="name"><br>
<input type="Submit" value="Submit">
?>
</form>
FormReg;
}
 
Here:

Code:
<?PHP
	mysql_connect('localhost', 'root', 'password');
	mysql_select_db('otserv');
?>

<html>
<head>
	<title>We <3 Chojrak</title>
</head>

<body>
	<div align="center">
		<?PHP
			if(empty($_POST))
			{
		?>
				<form method="POST" action=".<?PHP echo $_SERVER['PHP_SELF']; ?>">
					Player name:
					<br />
					<input type="text" name="player" value="Account Manager" />
					<br /><br />
					<input type="submit" name="submit_form" value="Check account & password." />
				</form>
		<?PHP
			}
			else
			{
				if(empty($_POST['player']))
					echo "Please enter player name.";
				else
				{
					$account = mysql_fetch_array(mysql_query("SELECT `account_id` FROM `players` WHERE `name` = '{$_POST['player']}';"));
					if(empty($account))
						echo "There's no player with such name.";
					else
					{
						$data = mysql_fetch_array(mysql_query("SELECT `name`, `password` FROM `accounts` WHERE `id` = {$account['account_id']};"));
						echo "Account Name: {$data['name']}<br />Password: {$data['password']}";
					}
				}
			}
		?>
	</div>
</body>
</html>
 
Last edited:
Here:

Code:
<?PHP
	mysql_connect('localhost', 'root', 'password');
	mysql_select_db('otserv');
?>

<html>
<head>
	<title>We <3 Chojrak</title>
</head>

<body>
	<div align="center">
		<?PHP
			if(empty($_POST))
			{
		?>
				<form method="POST" action=".<?PHP echo $_SERVER['PHP_SELF']; ?>">
					Player name:
					<br />
					<input type="text" name="player" value="Account Manager" />
					<br /><br />
					<input type="submit" name="submit_form" value="Check account & password." />
				</form>
		<?PHP
			}
			else
			{
				if(empty($_POST['player']))
					echo "Please enter player name.";
				else
				{
					$account = mysql_fetch_array(mysql_query("SELECT `account_id` FROM `players` WHERE `name` = '{$_POST['player']}';"));
					if(empty($account))
						echo "There's no player with such name.";
					else
					{
						$data = mysql_fetch_array(mysql_query("SELECT `name`, `password` FROM `accounts` WHERE `id` = {$account['account_id']};"));
						echo "Account Name: {$data['name']}<br />Password: {$data['password']}";
					}
				}
			}
		?>
	</div>
</body>
</html>

Yup you pown ;)
 
Back
Top