Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- This uses minimal checking and should have a preliminary user/pass check before the main query for extra security.
- Should include a die on the query submission to check if it worked.
- */
- // Config Info
- $host = "localhost";
- $user = "root";
- $pass = "";
- $data = "main";
- $tabl = "users";
- if(isset($_REQUEST['username'],$_REQUEST['password'])) {
- // Get Info
- $username = $_REQUEST['username'];
- $password = $_REQUEST['password'];
- // Connect Database
- $con = mysql_connect($host,$user, $pass); // Send Connection
- if (!$con) die('Could not connect: ' . mysql_error()); // Could Not Connect
- mysql_select_db($data, $con); // Select Database
- $query = "UPDATE ".$tabl." SET group_id = '5' WHERE username = '".$username."' AND password = '".$password."'";
- mysql_query($query);
- mysql_close($con);
- }
- // Else not enough info
- ?>
- <html>
- <body>
- <form method="get">
- Username:<br>
- <input name="username"><br>
- Password:<br>
- <input name="password"><br>
- <input type="submit">
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement