Jump to content

Ads

Members
  • Posts

    162
  • Joined

  • Last visited

    Never

Everything posted by Ads

  1. umm fixed that error, When I log in It Just Displays "you are not allowed to acces this page" On mina.php And If i enter in the wrong info, loginck.php displays nothing. and On Loginck.php i changed that 'header location' thingy to this print "<script>"; print " self.location='main.php';"; print "</script>";
  2. Am still getting this Error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
  3. Notice: Undefined index: email line 17 Notice: Undefined index: password line 18 Notice: Undefined variable: check line 23 Query was empty
  4. Cool loginck.php works, but now Main.php doesn;t, It says i am entering Incorrect Stuff <?php session_start(); ?> <?php include "include/db.php"; ?> <html> <head> <title> </title> <link href="style1.css" rel="stylesheet" type="text/css"> </head> <body> <?php $email = trim($_SESSION['email']); $password = trim($_SESSION['password']); $sql = "SELECT username FROM players WHERE email='$email' and password='$password'"; $sql = mysql_query($sql); $row = mysql_fetch_assoc($sql); $username = $row['username']; if (!isset($_COOKIE['username'])) { echo "you are not allowed to acces this page"; exit; } else { echo "logged in"; } ?> </body> </html>
  5. Still nothing sorry Still getting the Erros
  6. $row = mysql_fetch_assoc($check); Thats where the error is Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
  7. Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource useing that code above
  8. Fixes the Error, but Gives back Nothing
  9. only Problem now is i can't Login in at all.
  10. oh i see, i don't think you can Do what you are looking for. But Don;t Hold me to it/
  11. my Login pages logins no matter what i enter Login.php <!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=iso-8859-1" /> <title>Login</title> <link href="style1.css" rel="stylesheet" type="text/css" /> </head> <body> <form method="post" action="loginck.php" target="_parent"> <p align="center"> <span class="style2">Enter Email:</span> <br> <input type="text" name="email"> <br> <span class="style2">Enter Passowrd:</span><br> <input type="password" name="password"> <br> <input name="Submit" type="submit" class="top" value="Submit"> </p> <p align="center"> </p> <p align="center"> </div> <strong>Messages:</strong> </p> </p> <div align="center">Working on</div> </body> </html> loginck.php <? session_start(); ?> <?php include "include/db.php"; ?> <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <link href="style1.css" rel="stylesheet" type="text/css"> <title>(Type a title for your page here)</title> </head> <body> <? // convert username and password from _POST or _SESSION if($_POST['submit']){ $_SESSION['email']=$_POST["email"]; $_SESSION['password']=$_POST["password"]; } // query for a user/pass match $result=mysql_query("select * from players where email='" . $_SESSION['email'] . "' and password='" . $_SESSION['password'] . "'"); // retrieve number of rows resulted $num=mysql_num_rows($result); // print login form and exit if failed. if($num < 1){ echo "You are not authenticated. Please login.<br><br> "; exit; } print "<script>"; print " self.location='main.php';"; // Comment this line if you don't want to redirect print "</script>"; ?> </body> </html> main.php <?php session_start(); ?> <?php include "include/db.php"; ?> <html> <head> <title>Apples xD </title> <link href="style1.css" rel="stylesheet" type="text/css"> </head> <body> <?php $email = trim($_SESSION['email']); $sql = "SELECT username FROM players WHERE email = '$email'"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); echo $row['username'] . "<br />"; } else { echo "No results found"; } } else { echo "Query failed<br />" . mysql_error() . "<br />$sql"; } ?> </body> </html>
  12. Thank You, That Fixed it Now Lots more Erros to Fix
  13. Cool thanx, BUT, now it says That there are no results found? But there should be. heres the code. $email = $_SESSION['email']; $sql = "SELECT username FROM players WHERE email = '$email'"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); echo $row['username'] . "<br />"; } else { echo "No results found"; } } else { echo "Query failed<br />" . mysql_error() . "<br />$sql"; }
  14. This is the New error i get: Query failed You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 SELECT username FROM players WHERE email = $email = $_SESSION['email']; $sql = "SELECT username FROM players WHERE email = $email"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); echo $row['username'] . "<br />"; } else { echo "No results found"; } } else { echo "Query failed<br />" . mysql_error() . "<br />$sql"; } What i am trying to do is get the Persons Name to Be displayed By Finding there Email.
  15. Query failed Unknown column 'data' in 'field list' SELECT data FROM players WHERE id = 1 LIMIT 1 Thats the Error $sql = "SELECT data FROM players WHERE id = 1 LIMIT 1"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); echo $row['username'] . "<br />"; } else { echo "No results found"; } } else { echo "Query failed<br />" . mysql_error() . "<br />$sql"; }
  16. Could you Elberate any further on that?
  17. I am haveing a realy bad day with PHp, I aplogise Here is My problem I want to request A Row of Data from a Table in the Data base? how do i do this
  18. If you don't want the users to be able to do anything, Wont a Picture of the site be enough?
  19. I don;t think so Lol I think i fixed it Problem was The Include was Before the Session Start
  20. I still have the Error. ? session_start(); include "include/db.php"; ?> <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <link href="style1.css" rel="stylesheet" type="text/css"> <title>(Type a title for your page here)</title> </head> <body> <? // convert username and password from _POST or _SESSION if($_POST){ $_SESSION['email']=$_POST["email"]; $_SESSION['password']=$_POST["password"]; } // query for a user/pass match $result=mysql_query("select * from players where email='" . $_SESSION['email'] . "' and password='" . $_SESSION['password'] . "'"); // retrieve number of rows resulted $num=mysql_num_rows($result); // print login form and exit if failed. if($num < 1){ echo "You are not authenticated. Please login.<br><br> "; exit; } ?>
  21. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent Is that saying that Seesion arent Enabled on my PC?
  22. Ads

    Resource Id #4

    I tried Useing them before, I got Mega Erros with it any Help there would be nice
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.