Id like to learn how to change GET to POST.
My login system is sending the username / password as get , id like it to use post , can someone help me change this?
LOGIN
<?
require_once('header.php');
if ($user) {
echo "<font face='verdana' size='2'> <b>Your Already Logged in Genious. </font><br><br> ";
include('footer.php');
exit();
}
?>
<p> </p>
<table width="767" border="0" align="center">
<tr>
<td><font face ="verdana" size ="2" color=#000000> <span class="maintextbold">Account Login</span><br>
<br>
<form action="login.php">
<input type="text" name="name">
<strong>U</strong>sername<br>
<input type="password" name="pass">
<strong>P</strong>assword<br>
<input name="submit" type="submit" value="Login">
</form>
</font></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<br>
<?
echo"<br><br>";
require_once('footer.php');
?>
The php page that actually processes the login.
<?
// This is the login part, login.php
// includes the constants
include("cons.php");
$name = $_GET['name']; // sets the username
$pass = $_GET['pass']; // sets the password
$r = mysql_query("SELECT * FROM user WHERE user='$name'");
// logout section
$logout = $_GET['out']; // makes sure their logging out
$user = $_GET['user']; // gets the username
if ($logout == "yes") {
mysql_query("DELETE FROM active_users WHERE name='$user'"); // Logs them out
header("Location: start.php");
}
// Main Login part
while ($ro = mysql_fetch_array($r)) {
$pass2 = $ro['pass']; // sets $pass2 as the actual password
if (md5($pass) == $pass2) { // makes sure password entered is the same as $pass2
$user = $_SESSION['username'] = $name; // starts the session
$ip = $_SERVER['REMOTE_ADDR']; // Users ip address
$brow = $_SERVER['HTTP_USER_AGENT'];
$time = time(); // gets the time
// Makes the user an active user!
mysql_query("DELETE FROM active_users WHERE name='$user'");
mysql_query("INSERT INTO active_users (name,timestamp,ip,browser) VALUES ('$user','$time','$ip','$brow')");
}
}
// Returns the user after logging in.
header("Location: start.php");
?>
How can i change these so that it submit's the info using POST and not GET?