Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// Login.php
- <?
- include('config.php');
- if ( $_POST["username"] != "" && $_POST["password"] != "" && $_POST["world"] != "" ) {
- login($_POST["username"],$_POST["password"],$_POST["world"]);
- }
- else
- {
- echo "Error: Not all feilds entered";
- }
- function login($username,$password,$world) {
- $query = "SELECT * FROM ogw_users WHERE username='$username' and password='$password' and world='$world'";
- $result = mysql_query($query);
- while($row = mysql_fetch_assoc($result)) {
- $username = $row["username"];
- $email = $row["email"];
- $world = $row["world"];
- }
- ?>
- <script>
- document.cookie = "username=<? echo $username; ?>; password=<? echo $password; ?>;world=<? echo $world ?>;";
- window.location.href = "user.php";
- <script>
- <?
- }
- //////////////////////////////////
- THE ERoor I got is:
- PHP Error Message
- Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/a4986921/public_html/login.php on line 16
- Free Web Hosting
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement