Jump to content

gaston9x19

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by gaston9x19

  1. Afraid not, session_start() is actually called in check_login.php, which is included in db_connect.php, which is required in login.php. It got kinda complicated lol. But yeah it works on the same site hosted on another server, rockstar.gastonglock.net. I think my boss just really wants the site on the TCH server so he can make the domain name stuff easier and have more control over things. Can't really use the site to it's ful potential though, if we can't login to the site admin part of it after the move. The whole system is based on this tutorial I found: Creating a Login with PHP Sessions Perhaps you might see if you think this simplified version would work on these servers? I hate to be such a bother, but I'm positively stumped. I don't know any other way to create a login either, it'd take me a while to get a PERL version working. Thanks very much for your help on this
  2. Really appreciate any help on this, and thanks Raul, for your interest. I'd really like to figure this one out,... I need to actually lol.
  3. lol wow, thanks guys I don't know, the slight version difference seems the first thing you'd try looking at. I figured out how sessions work from the PHP website though, and they have stuff for 5.0. Basically, there are two scripts: The login script itself, and a check_login script that seems to failing to pass the session data along. Login is fairly straight forward, gather a username and password, then start a PHP session with session_start(), use PEAR::DB to connect to a SQL database, and check that the password supplied is the one for that username in the database. If it is, it sets $_SESSION['username'] and $_SESSION['password'] and then redirects the user to the home page. This is where I get problems. The check_login script is contained in the header of the home page, and it has a check to let the user know something's wrong when you are "logged in", but there's no session data, or it doesn't match the database info. I keep losing ALL session array data when check_login checks the user's credentials while loading the home page. The check_login script initiates (or continues) a session, then uses PEAR::DB to connect to a SQL database, and grab the encrypted password that corelates to the current $_SESSION['username'], if a session has already been established. Assuming the db_pass matches the $_SESSION['password'], it sets the $logged_in variable to 1, otherwise it's set to 0. Is there another way to set session variables for the new PHP version besides: session_start(); $_SESSION['name']="data"; Anybody have any idea what changed so radically between 4.3.10 and 4.3.11?]] Also, here's the check_login script, if anyone's interested. I call it from db_connect.php, which actually has all the database and PEAR stuff in it. Hey, it works on 5 or 6 sites I have on 4.3.10 lol maybe you can use it. check_login.php db_connect.php
  4. I recently created a login script using PHP sessions to keep track of a user if they provide the correct username and login, and it worked beautifully on another server with PHP 4.3.10. I moved it to totalchoicehosting and it stopped working all of a sudden. Seems to check the database and verify the user fine, but when it moves to the next page it loses the session variable data. Can anyone please help me figure this out? Not gonna be able to use total choice if I can't login and admin the sites. Thanks very much. login.php
×
×
  • Create New...