Jump to content

INeedAGig

Members
  • Posts

    112
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

INeedAGig's Achievements

Member

Member (2/5)

0

Reputation

  1. Still cant seem to figure this out...any ideas? Thanks!
  2. Alrighty, tested a bit more, it only occurs when it is within its containing div, if it is outside of it's div, it works just fine.... What could be causing this? Thanks!!
  3. The username being echoed does contain an underscore.
  4. Hmm...Odd.... That's the thing...it WAS working for me, but all of a sudden doesn't....
  5. Hey there guys, small problem here that I can't seem to figure out. I am in the process of programming a database with user-access control. I have the log-in system working great, but the logout link, which is located next to the logged-in username seems to not be echoing correctly. It is loading the 'Logout' text in text-form only, not link-form.... Any ideas on what may be causing this small glitch?? Thanks!! I have attached relevant code for said part for reference. <img src="images/username.png" height="20" width="20"> <b>Welcome</b> <?php echo ("<font color=#9e0219>$username</font>");?>, <?php echo '<a href="logout.php">Logout</a>';?>
  6. Well, I have appeared to solve my problem. I feel like a dummy, but it was a very simple issue. The conflict was the fact that the database name and the database username were exactly the same.
  7. Now, upon successful login, the page that is loaded, being 'main_interface.php'. This file BEGINS with the session control, that code being: <?php session_start(); if (!isset($_SESSION['username']) || (trim($_SESSION['username'])=='')) { header("location: login.html"); exit(); }
  8. The password is stored in the database under it's MD5 value.
  9. Could it be that I have the password as a VARCHAR?
  10. No, still doing the same thing.
  11. HTML for the form: <form id="login" name="login" method="post" action="login.php"> <p><img src="images/locked.png" height="20" width="20"> Restricted Access - Authentication Required</p> <label>Username <img src="images/username.png" height="20" width="20"> <span class="small"><i>Enter a valid username</i></span> </label> <input type="text" name="username" id="username"> <label>Password <img src="images/password.png" height="20" width="20"> <span class="small"><i>Password is case sensitive</i></span> </label> <input type="password" name="password" id="password"> <button type="submit">Login</button> <div class="spacer"></div> </form>
  12. Hey there guys, I have been trying to resolve this myself the past hour or so and I can't seem to figure it out. I am in the middle of programming a contacts database, with a login system. Now, the register.php file I created to create users for the database works, but the following code is from my login.php file. When I am on the page in my browser and I type in a registered username and password combination it simply just reloads the login.php file, with blank form fields, as if you had just loaded the page. I am not quite sure what is causing this. Here is the code from my login.php file: <?php //Database Information $dbhost = "removed_for_this_post"; //Host Name $dbname = "removed_for_this_post"; //Database Name $dbuser = "removed_for_this_post"; //Database Username $dbpass = "removed_for_this_post"; //Database Password //Connect To Database mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error()); mysql_select_db($dbname) or die(mysql_error()); session_start(); $username = $_POST['username']; $password = md5($_POST['password']); $query = "SELECT * FROM users WHERE username='$username' AND password='$password'"; $result = mysql_query($query); if (mysql_num_rows($result) != 1) { $error = "Bad Login"; include "login.html"; } else { $_SESSION['username'] = "$username"; include "main_interface.php"; } ?> Thanks for your help in advance!!
  13. Thanks for your reply, but, is there anything I can add to my current script to get it working properly?
×
×
  • 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.