Jump to content


New Members
  • Posts

  • Joined

  • Last visited


Profile Information

  • Gender
    Not Telling

Roboff's Achievements


Newbie (1/5)



  1. Okay, I have worked on this for 5 days straight and still cant make it work. I am out of time and have to have this working asap. I have tried to learn it myself and I read 100's of different tutorials, but cant make it work, and now I am out of time. So...... Where is the best place online to pay someone to fix this for me quickly. I need it done by tomorrow. Also thank you to all who answered and tried to help.
  2. The $username session variable is set in the login.php. When it redirects to the userarea.php the username session is still set. What i need to know is how to query the $username session and then have it redirect to different pages depending what the $username session is? Any direction on how to do this would be great. Please teach... or tell me what im doing wrong.
  3. Thanks for the reply, but I tried that already. But when it redirects it goes back to the main index page instead of the database clientpage. No errors at all, it just doesnt redirect to what is in the database. Still not working....
  4. I am still learning PHP and have read and tried many different things but can't get any of them to work. I need help with this one, PLEASE! I have a working login script that uses PHP and a database for my login. My database has a table name clientpage with fields id, username, password, clientpage. When the user logs in they are redirected to userarea.php. header("Location: userarea.php") What I need to know is how I can redirect each one of my clients to their own page depending on the username they enter. The clients pages are very unique so I can't redirect to the same page and just change the data. Example: id - 1 username - cologicsystems password - secret1 clientpage - client1.php id - 2 username - nocore password - secret2 clientpage - client2.php and so on...... PLEASE HELP. I need this to work in 2 days. Thank you MY PAGES login.php <?php include 'functions.php'; if (loggedin()) { header("Location: userarea.php"); exit(); } if($_POST['login']) { $username = $_POST['username']; $password = $_POST['password']; $rememberme = $_POST['rememberme']; if ($username&&$password) { $login = mysql_query("SELECT * FROM users WHERE username='$username'"); while ($row = mysql_fetch_assoc($login)) { $db_password = $row['password']; if ($password==$db_password) $loginok = TRUE; else $loginok = FALSE; } if ($loginok==TRUE) { if ($rememberme=="on") setcookie("username", $username, time()+7200); else if ($rememberme=="") $_SESSION['username']=$username; header("Location: userarea.php"); exit(); } else echo "Username/password combination incorrect.<p />"; } else die("Hit back and enter a username and password."); } ?> <form action="login.php" method="POST"> Username:<br/> <input type="text" name="username"><p /> Password:<br/> <input type="password" name="password"><p /> <input type="checkbox" name="rememberme"> Authorized user<br /><br /> <input type="submit" name="login" value="Log in"> </form> functions.php <?php //session session_start(); // connect to database $connect = mysql_connect("localhost","arc_robert","arc") or die("Could not connect"); mysql_select_db("arc_rememberme") or die("Could not find db"); //login check function function loggedin() { if (isset($_SESSION['username'])||isset($_COOKIE['username'])) { $loggedin = TRUE; return $loggedin; } } ?> userarea.php <?php include 'functions.php'; if (!loggedin()) { header("Location: login.php"); exit(); } ?> You are logged in!<p /> <a href="logout.php">Log out</a> logout.php <?php session_start(); //destroy session session_destroy(); //unset cookies setcookie("username","",time()-7200); header("Location: login.php"); ?> [attachment deleted by admin]
  • 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.