Hello your help is very appreciated in my process of learning stuff. Yes im gonna experiment putting the mysql connecter in another file. Anyways. When i press submit im getting
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
that error comes up. i dont really see why. I know that im making a big beginner fail, but thats how you learn huh? code look like this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Login</title>
</head>
<?php
mysql_connect("localhost", "root", "******") or die(mysql_error());
mysql_select_db("coinsdb") or die(mysql_error());
//Connect to database
if(isset($_POST['submit'])){
$name = mysql_escape_real_string($_GET['coins']);
$sql = "SELECT `coins` FROM users WHERE `name`=$name";
$query = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($query)) {
$amount = $row['coins'];
}
echo $amount;
}
?>
<form method="post" action="<?php echo $PHP_SELF;?>">
Ingame name:<input type="text" size="12" maxlength="12" name="coins"><br />
<input type="submit" value="Check Balance" name="submit"><br />
</form><br />
</body>
</html>