Jump to content

GameYin

Members
  • Posts

    389
  • Joined

  • Last visited

Everything posted by GameYin

  1. Tried that code instead. Didn't work. Just "displayed" teh query. Noticed you forgot mysql_query so I added it. The error now is.. Resource id #3You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Resource id #3' at line 1 Current code <?php session_start(); include 'config.php'; $user = mysql_real_escape_string($_POST['username']); $pass = mysql_real_escape_string($_POST['password']); if (strlen($user) > 0 && strlen($pass) >0){ $sql=mysql_query("SELECT * FROM Users WHERE Username = '$user' AND Password = '$pass' LIMIT 1"); echo $sql; $query = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($query); if (mysql_num_rows($query) > 0 && $row['Activated'] > 0) { $_SESSION["status"] = "Logged"; $_SESSION['username'] = $user; $_SESSION['password'] = $pass; header("Location: http://www.gameyin.com/index.php"); exit; } } else { $_SESSION["status"] = "Not logged"; $_SESSION['username'] = Guest; echo "Something went wrong"; } ?>
  2. Opera, Also I noticed something. When I enter details to signin, it still stays at loginaction.php, but if I hit back button once, it has logout and usercp links at the top. If I go to index.php from there, (do some highlighting) and you will see "Guest" Just as my code wanted. So apparently my details aren't going good at the database portion.
  3. Sorry. Hectic day over at another forum and I'm taking it out over here lol. I assume you mean with the header location? Edit: Didn't work. Any other ideas?
  4. http://www.phpfreaks.com/forums/index.php/topic,195195.0.html Please CONTINUE THAT THREAD . Noone wants to post there since it has many replies...?
  5. Wow, why does noone respond to my topics. What is up with this?
  6. It is staying on loginaction.php. It's not redirecting and I know I typed in the right information. What's up?
  7. GameYin

    table expand

    Try using conditional if statements. For IE
  8. GameYin

    table expand

    Don't use inline CSS styles. Do <style type="text/css"> table { min-height:; max-height:; } </style>
  9. GameYin

    table expand

    Try setting a min-height:; (CSS)
  10. Why did I haveto read the post again? What did I miss ???
  11. or window.location.href
  12. Ok I'll try that version when I get home. I'm in English 11 right now.
  13. www.gameyin.com/login.php <?php session_start(); include 'config.php'; $user = $_POST['username']; $pass = $_POST['password']; $query = mysql_query("SELECT * FROM Users WHERE Username = '$user' AND Password = '$pass' LIMIT 1") or die(mysql_error()); $row = mysql_fetch_array($query); if($user != "" && $pass != "" || mysql_num_rows($query) > 0 || $row['Activated'] > 0) { $_SESSION["status"] = "Logged"; $_SESSION['username'] = $user; $_SESSION['password'] = $pass; header("Location: index.php"); exit; } else { $_SESSION["status"] = "Not logged"; $_SESSION['username'] = Guest; echo "Something went wrong"; } ?> Go to that website and type in ANYTHING for the username and password. It is just accepting anything. The HTML form is on that link I gave you. HELP! Why isn't it selecting the DB Username?
  14. Add that to tr's and td's as well. I used to have that problem www.gameyin.com The left nav table. Look at the CSS and HTML for it.
  15. Lol, I misspelled session_start();. I did sesion_start(); Woops. Yea that fixed it.
  16. I actually had that, I just didn't copy and paste high enough. Sorry!
  17. I have the code in my index.php. I login but nothing is echoed. www.gameyin.com (Register, login then goto index.php) Something is wrong with my loginaction.php I guess? OR... loginaction.php <?php session_start(); include 'config.php'; $user = $_POST['username']; $pass = $_POST['password']; $query = mysql_query("SELECT * FROM Users WHERE Username = '$user' AND Password = '$pass' LIMIT 1") or die(mysql_error()); $row = mysql_fetch_array($query); if($user != "" && $pass != "" || mysql_num_rows($query) > 0 || $row['Activated'] > 0) { $_SESSION["status"] = "Logged"; $_SESSION['username'] = $user; $_SESSION['password'] = $pass; header("Location: index.php"); exit; } else { $_SESSION["status"] = "Not logged"; $_SESSION['username'] = Guest; echo "Something went wrong"; } ?> index.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DevPlooth.com | Forums | Arcade | Tutorials | Web Hosting</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="Find webmasters, web designers, SEO techs, web developers, designers PHP experts, html experts, javascript experts, css experts, SEO advice, marketing tips and resources. Our forum provides a way for people to find web help and support!" /> <meta name="keywords" content="webmaster forum, web design, web developers, developer forum, web forum, php experts, web marketing, seo experts, database experts, support forum, programming, html, css, javascript, mysql, sql, web" /> <link rel="stylesheet" href="style.css" type="text/css" /> </head> <body> <div class="body-container"> <div class="body-outer" id="body-outer"> <div class="body-header"> <div class="logo"> <a href="#">DevPlooth.com</a><br /> <small>Forums | Arcade | Tutorials | Web Hosting |</small> </div> <div class="tmenu"> <b><a class="add" href="index.php">Home</a></b> <a href="register.php">Register</a> <a href="login.php">Login</a> <a href="logout.php">Logout</a> <a href="usercp/index.php">UserCP</a> <a href="arcade/index.php">Arcade</a> <a href="tutorials/index.php">Tutorials</a> <a href="forums/index.php">Forums</a> <a href="webhosting/index.php">Web Hosting</a> </div> <div class="search"> <form action="search.php" method="get" style="display:inline;"> <div> <input type="text" name="search" class="input-search" value="Enter your Search Query" onblur="if(this.value=='') this.value='Enter your Search Query';" onfocus="if(this.value=='Enter your Search Query') this.value='';" /> <input type="image" src="images/search.gif" /></div> </form> </div> </div> </div> </div> <div class="navbar"> <small>Please browse our tutorials in many languages!</small> <br /> <table id="navbar"><tr><td>�<a href="tutorials/xhtml/index.html">(X)HTML</a></td></tr> <tr><td>�<a href="tutorials/css/index.html">CSS</a></td></tr> <tr><td>�<a href="tutorials/javascript/index.html">JavaScript</a></td></tr> <tr><td>�<a href="tutorials/php/index.html">PHP</a></td></tr> <tr><td>�<a href="tutorials/asp/index.html">ASP</a></td></tr> <tr><td>�<a href="tutorials/aspnet/index.html">ASP.NET</a></td></tr> <tr><td>�<a href="tutorials/coldfusion/index.html">ColdFusion</a></td></tr> <tr><td>�<a href="tutorials/mysql/index.html">MySQL</a></td></tr> <tr><td>�<a href="tutorials/apache/index.html">Apache</a></td></tr> <tr><td>�<a href="tutorials/dhtml/index.html">DHTML</a></td></tr> <tr><td>�<a href="tutorials/ajax/index.html">AJAX</a></td></tr> <tr><td>�<a href="tutorials/xml/index.html">XML</a></td></tr> <tr><td>�<a href="tutorials/xslt/index.html">XSLT</a></td></tr> <tr><td>�<a href="tutorials/actionscript/index.html">ActionScript</a></td></tr> <tr><td>�<a href="tutorials/vbscript/index.html">VBScript</a></td></tr> <tr><td>�<a href="tutorials/vb/index.html">VB</a></td></tr> <tr><td>�<a href="tutorials/python/index.html">Python</a></td></tr> <tr><td>�<a href="tutorials/rubyonrails/index.html">Ruby On Rails</a></td></tr> </table> </div> <?php echo $_SESSION['username']; ?> <div class="advertisement"> <p>Have A Look At Some Of Our Sponsors</p> <img src="images/ad1.gif" alt="Ads" /> <img src="images/ad2.gif" alt="Ads" /> <img src="images/ad3.gif" alt="Ads" /> <img src="images/ad4.gif" alt="Ads" /> <img src="images/ad5.jpg" alt="Ads" /> <img src="images/ad6.gif" alt="Ads" /><br /> <a href="advertise.php">Put Ad here</a> <a href="advertise.php">Put Ad here</a> <a href="advertise.php">Put Ad here</a> <a href="advertise.php">Put Ad here</a> <a href="advertise.php">Put Ad here</a> <a href="advertise.php">Put Ad here</a> </div> <div id="footer"> <p> <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Strict" height="25" width="70" /></a> © 2008-2009 DevPlooth.com. All rights reserved <a href="http://jigsaw.w3.org/css-validator/"> <img style="border:0;width:70px;height:25px" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!" /> </a> </p> </div> </body> </html>
  18. Why would I have session_destroy in my code?
  19. Hello Dunno if sessions are working for me. I have session_start(); on both. Can someone help? I don't know if sessions are setting since my next code following this won't work. http://www.phpfreaks.com/forums/index.php/topic,194777.0.html Noone would respond there :-\ ??? <?php session_start(); include 'config.php'; $user = $_POST['username']; $pass = $_POST['password']; $query = mysql_query("SELECT * FROM Users WHERE Username = '$user' AND Password = '$pass' LIMIT 1") or die(mysql_error()); $row = mysql_fetch_array($query); if($user != "" && $pass != "" || mysql_num_rows($query) > 0 || $row['Activated'] > 0) { $_SESSION["status"] = "Logged"; $_SESSION['username'] = $user; $_SESSION['password'] = $pass; header("Location: index.php"); exit; } else { $_SESSION["status"] = "Not logged"; $_SESSION['username'] = Guest; echo "Something went wrong"; } ?> I have this on index.php to see if session is working. How would I go about echoing the session username? <? if (empty($_SESSION['username'])) { ?> blah ez <? }else{ ?> blah kewl <? } ?>
  20. Erm, anyone? Simple question. How can I echo my session var.
  21. div.left_bar { position:absolute; left:200px; width:auto; } <table class="logged_in"><tr><td> <p>Welcome, <?php echo $_SESSION['id_username']; ?> <br><a href="<?php echo "$home_page"; ?>/user_profile.php?id=<?php echo $_SESSION['user_id']; ?>">User Profile</a><br> <a href="<?php echo "$home_page"; ?>/user_setting.php">Settings</a><br> <a href="<?php print $_SERVER["PHP_SELF"]; ?>?logout=true">Logout</a><br /> </td></tr><tr><td>Logged In</td></tr></table></p> You probably have a div up there. Also, for this table, you don't have any cells. Your CSS isn't applying to the other thing because it has cells, and your CSS doesn't specify that. And PLEASE, post the parsed HTML code: go to your website and hit view source and copy and paste the part here.
  22. Do you have a website for us to look at? What browser(s) are you testing this in. More information please ??? :'(
  23. You shouldn't use pixels. Use %'s
×
×
  • 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.