Login Problem - Can't Login(login Is Done In Index.php)
This is origially PMsys, I have edited it, and here is what I have done with the original
replace all $_COOKIE into $_SESSION changed all setcookie() into session_start() and defined those $_SESSION now the problem is I can't login(login is done in index.php), does anyone here got an idea why? I uploaded the whole pakage, but I think you only need to look at index.php and include/global.php.
View Complete Forum Thread with Replies
Related Forum Messages:
Login Lgout And Login Without Closing Session Gives Redirection Error
I am stepping through a text book that sets up different websites. The one I am testing is user registration. I set up the scripts and this is what I observe: Login (verifying against a mysql db) - no problem. Logout - no problem. Close the browser and try again - no problem. Login > Logout > Login WITHOUT closing browser I get: An error occurred while loading http://login.php when it should redirect me to http://localhost/index.php. I read somewhere on the news group that the header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname ($_SERVER['PHP_SELF']) . "/index.php") (in my example code) is called once and so the error? The logout.php destroys the $_SESSION variables, session itself and any cookies so I thought it would be "like new" the second time around? It appears to be linked to sessions but don't know enough to know how to correct.
View Replies !
Login Script Doesn't Display If The Login Is Correct Or Incorrect.
Below is the script I am using for my login page. It doesn't display if the login is correct or incorrect. All it does is clear the username and password box when I hit submit. I want it to display an error message if the login is incorrect and if it is correct redirect them to their own web page. I am putting the MySQL connection script in the header of the login.html is this wrong? Can someone please give me some pointers on how to get this script working? <?php session_start(); $username = $_POST['username']; $userpass = md5($_POST['password']); $sql = "select * from usertable where username='$username' and password='$userpass'"; $result = mysql_query($sql); if (mysql_num_rows($result)!= 1) { $error = "Login failed"; } else { $row = mysql_fetch_array($result); $_SESSION['username'] = "$username"; $_SESSION['ip'] = $_SERVER['REMOTE_ADDR']; header("Location: h*tp://www.w-------.com/$row['USLP']"); } ?>
View Replies !
Session Based Login Script Re Login Problem
I have built this login script, it logs u in and shows the first page... i have built it to be require()'ed, when i have required it from a browser script i made it loads the front page, then when i ask for browser.php?edit=file.html It then asks me to re login and takes me back to the front page! PHP Code:
View Replies !
Create A Separate Page With One Login That Let's Me Login To All Of The Sripts At Once?
I'm building a website using various php scripts from I found on hotscripts. Because I'm not much of a programmer myself I'm using a separate script for the blog, another one for the links section and a different one for the gallery and so on. The downside to this is that I have to login on a separate page to update the gallery and another page to update the blog and so on. Is there a simple way to either remove the need for a login for all the scripts and just create a separate page with one login that let's me login to all of the sripts at once? Or if there's a script that can kinda save the passwords and logs in for me?
View Replies !
Secure Place To Store Login Info And How To Login With It
I had an idea to store my login code: ftp_login... in a separate file outside of the public_html dir and set full permission (777) to it. 1. Is that safe? 2. How do I call this function from inside another file? function Login() { $connection= ftp_connect('ftp.me.com'); return ftp_login($connection, "me", "pass"); } I was hoping to return connection but I don't know how to send pointers in php.
View Replies !
Authenticate The User With The Login.html, Login.php.
I am setting up a registration/login for my website with PHP and MYSQL. I have a register.html, register.php & a login.html, login.php. I can successfully register a user (using register.html, register.php) into my database. Now, I am trying to authenticate the user with the login.html, login.php. When I try to do so, however, I always recieve my error message "failed." It will not authenticate (despite several attempts of logging in with the same username and password of that which is in my database.) Code:
View Replies !
Hiding Login & Password Fields After Login
I am hoping to do the following, the homepage shows a username and password field. Once the user enters a scucessfull login, these fields are removed. In order to achieve this, must the page be based on one big IF ELSE statement? so... If user logged in hide username & password fields Else show page with username and password fields? OR is this acheived by redirecting the user to a page that is not the homepage after a successfull login? so... the user would login sucessfully and be redirected to a homepage identical to the one with the fields but will have the username & password fields removed?
View Replies !
Main Page Login = Forum Login
This is going to be a website for a club im in at University. Now, I only want members of that club to be able to register. The problem is that they pay a member fee. I want to know a way that when they pay me the fee (in person) I can give them a unique confirmation number from which they can register properly (sorta like a CD-Key). Code:
View Replies !
Undefined Index: Login
I have a form and am trying to get a login working by setting a session and then echoing out some information on the following page to test to see if it is working. I am getting an error though when I try to echo it out. I am not sure if the problem is in how I am setting the session or what. Here is my login and below that is how I am trying to echo it out. Code: <?php session_start(); require_once('../Connections/prbc.php'); if(isset($_POST['login'])){ $username = '' $password = '' if (isset ($_POST['username']) && $_POST['username'] != '') $username = $_POST['username']; if(isset ($_POST['password']) && $_POST['password'] != '') $password = $_POST['password']; $username = mysql_real_escape_string( $username ); $password = mysql_real_escape_string( $password );........
View Replies !
Index.php?inc=2 Messing Up My Auth Login ?
I am trying to use a drop down menu to dynamicly load a page include. The code I have for this has worked fine elsewhere but in this case I have phpauth running in the area where my menu is and everytime I try to select an option it is taking me back to my login page. Any ideas why ? Code:
View Replies !
Login Script Forcing Me To Login Twice?
I have built a login script and for some strange reason its forcing me to login twice. Not saying the user/pass is wrong first time, it moves the headers fine, it just show the old page with the login any ideas? Code:
View Replies !
Login Page Not Redirecting After Login
I've used this same snippet of code in other login forms without a problem (with some slight modifications from script to script) but this one seems to baffle me. Basically it takes the login and validates the entries (validation works, error messages display if left blank), then checks the database for a match. If there's a match then it is supposed to forward the person onto the proper page using the 'header' function. Problem is it's not. Basically it's reverting back to the 'index.php' page (login page) and the display is completely blank. Here's the code for index.php: Code:
View Replies !
Want My User To Have To Go Back To The Index Page As Soon As They Login.
I am having a little trouble intergrating a login/user management script with my html pages. I have used the div tag put in my php in there and put the rest of the php where it is originally placed in the script. Here is my problem. I would like my user to stay on the same main page while the login part changes(goes to the members area). I have tried using i-frames but if there is a link in one, the main page does not change the i-frame does. Can this be solved with more php. I do not want my user to have to go back to the index page as soon as they login.
View Replies !
Email An HTTPS Address With Encrypted Login For Users To "Click And Login"
I have developed a web site that monitors the state of the user's routers (UP/DOWN & WHY) it has the usual login web page, since the web site monitors the devices and sends emails when there is a problem, i wanted to send an email with an embedded https link, where the user could click and be directed straight onto the web site, without the need to login.
View Replies !
Mail Server - Use My Page Login For The Mail Login User Is Stored In $_SESSION
I have a problem and no time to google it and i hope someone will guide me. I have a linux server (slack10) php/mysql and a website where you can create accounts and login. i need to install a mail server with a web interface, i need to have a script that creates automaticly an email account when my page creates an account and a way to use my page login for the mail login user is stored in $_SESSION and the mail will be shown in iframe any sugestions?
View Replies !
Index.htm Going To Login Page And Sending Back To Index Page
1: A visitors visits a.html page. decides to login and post comment. goes to login page and logs in then I want to send him back to a.html page how do I do that? Here is my login page and login.php page. 2: Same as above but I want to send them back after some time... while I make them view the error, why they have not been able to login. Code:
View Replies !
Php Login And MySQL Login
can anyone tell me the advantages of a login created with mySQL over just using php and writing to text files(if this is posible)?is mySQL safer and more secure in any way or just easier?
View Replies !
Login Script That Checks Long Long It Has Been Since A Last Login
i need to make a login script that checks long long it has been since a last login. I have Mysql so i can use that to store the last login date. Can someone help me figure out how to find how many days ahve passed since a previous login. Like what format should the last loin date be stored in. Also how i get it to figure out how many days have passed since the last login.
View Replies !
Using "php Urls" I.e Index.php?option=login
How it is done? for example, i have following HTML code <a href="index.php?option=login">Log in[/url] ..and a PHP code to switch pages <?php switch($_GET['option']) { case "login": { include("login.php"); break; default: { echo "Error 404"; break; }}?> Do I just type a variable in the URL and switch it with php or what?
View Replies !
Redirect From The Login Page To The Login Page
I have been working on a cms, and I got the login and main admin page working, so what I am trying to do is make it so if your not logged it, it redirects you to the login page. But the problem is once it gets to the login page, it continues to redirect from the login page to the login page, so its nonstop. How can I fix this.. Code:
View Replies !
Help With Login
The problem is that the very last part of the code is not working the last if..else condition that has been set doesnt work, ie, when session remains and cookie expires...whenever there is such a condition a few notices are displayed and nothing else.. } else if (!isset($_COOKIE['user'])) { if (session_is_registered("password")) { echo "else if part"; } }?>
View Replies !
Login
how to login ... <form name="form1" method="post" action=""> <input type="text" name="user"> <input type="password" name="id"> <input type="submit" name="Submit" value="Submit"> </form> In the above form..i want to fetch data from database of mysql ..to the field of name and id .....when will enter to the name and id it will compare to mysql fields how to write to this form code in mysql queries through php..........
View Replies !
SSL Login
Recently, my company has decided that session-based login isnt secure enough (Layoffs are coming, they probably expect lots of angry people) and have decided that encrypted login is necessary, even on internal networks. Can someone please give me somewhere to start on implementing this? I have a pretty solid understanding of encryption in general, but the articles I have read are cryptic.
View Replies !
Login Box
I'm having a bit of trouble with a login box. My website has all the common stuff - news etc. and it has a login box up the top. What I want to do is have it linked to a database and you can login, and when you login it says something like: Welcome, *User*. Type thing. How would I go about doing this?
View Replies !
After Login In
I am trying to create a basic login page in PHP whitout using a database to reduce complexity at the moment ,but after I get the login successful, I have no idea on how to redirect the page to lets say a folder or page. Code:
View Replies !
Won't Login
I have created a login in page for my site but when i try to login in, even though the user name and password are correct, it tells me that they are invalid. Here is the code from the login.php page:
View Replies !
Login And Get Value
I want to let users log in, get their username and password verfied against my mysql-db, and each user are associated with one of five accessgroups, named by "A", "B" ... "E". My db have these fields: username password accessgroup Users with username and password matched from the db assosicated by for example "B" should then be redirected to a special page, a page which should not be accessible by any other goups of users. And so on. This might perhaps be solved with sessions?
View Replies !
Login.php
This is my login.php <html> <body> <?php if (isset($_COOKIE["uname"])) echo "Welcome " . $_COOKIE["uname"] . "!<br />"; else echo "You are not logged in!<br />"; ?> </body> </html> What im trying to do is if i have the right password and right username it lets me in, but if one or another is wrong i want it to say something like Invalid username or password.
View Replies !
Login Help
I am in the process of building a membership system. However, logging in is proving to be impossible, and even the correct password and username combo are denied. I think I have the problem narrowed down to a single 'if' statement, but cannot tell what is wrong with it. Here it is: PHP Code: $get_user = mysql_query("SELECT * FROM `pet_game` WHERE 'username' = '".$_POST['username']."' AND 'user_password' = '".md5($_POST['password'])."'"); $q = mysql_fetch_object($get_user); if($q==FALSE) {die("Login Failure: An error occured, please verify your username and password are correct.");} else { header("Location: http://staggy11.byethost3.com/home.php"); }
View Replies !
Login?
Is there anyway to make it so I can have members on my webpage. I would like to have it to where they have to go through all the steps od regestering and after they login, it will show their name in the top right or some where.
View Replies !
New Problem With Login...
Alright I have a new problem...i tried to print out the error but it wont print it out. It says the warning is on line 14....I will indicate what line 14 is....let me know what you think Thanks. body> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="91%" id="AutoNumber1"> <tr> <td width="100%"> ****LINE 14 ***** <img border="0" src="http://www.mountclubsports.com/dance/Images/bckgrnd_logo.jpg" width="900" height="110"></td> </tr> </table> </center> </div> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="91%" id="AutoNumber2"> <tr> <td width="100%"> <img border="0" src="http://www.mountclubsports.com/dance/Images/bckgrnd_green.JPG" width="900" height="350"> <DIV STYLE="position:absolute; top:180px; left:156px; width:655px; height:25px"> <center><FONT SIZE="+02" COLOR="000000">Admin Log In</FONT> <br> <FORM METHOD="POST" ACTION="login.php"> Username: <INPUT TYPE="TEXT" NAME="Username"><BR>  Password: <INPUT TYPE="PASSWORD" NAME="Password"><BR> <br> <INPUT type = "submit" name = "Login" value= "Log In!"> </FORM> <?php $hostname = "*****"; $username = "*****"; $password = "*****"; $Username = $_POST['Username']; $Password = $_POST['Password']; $URL = "*****"; // Check to see if the form has been posted if (isset($_POST['Login'])) { // It has, now lets check to make sure they filled in all fields if (isset($_POST['Username']) && isset($_POST['Password'])) { // Open a MySQL Connection & Select Database $dbh = mysql_connect ($hostname, $username, $password) or die ("I cannot connect to the database because: " . mysql_error()); $db = mysql_select_db("*****", $dbh); // Perform Query to see if the user exists $CheckUser="SELECT * FROM Admin_Users WHERE Username='".$Username."' AND Password='".$Password."'"; $CheckUser_Result=mysql_query($CheckUser) or die(mysql_error()); // Check the Result if (mysql_num_rows($CheckUser_Result)==1) { ***LINE 63*** header("$URL") or die(mysql_error()); }else { $Error="Sorry your Username & Password were not found, please try again."; } }else { $Error="Please enter both your Username & Password."; } } // Check to see if we need to display any error message if (isset($Error)) { echo "$Error<BR><BR>"; } ?> </DIV> </body> ERROR: Warning: Cannot modify header information - headers already sent by (output started at /home/mountclu/public_html/dance/login.php:14) in /login.php on line 63 I have gotten this on all the scripts I have tried...what does it mean? I tried putting "the domain name" instead of the $URL and that didn't work either
View Replies !
Login Questions
I have 2 books 1.) MySQL/PHP Database Applications and 2.) PHP4 Bible. My problem is that in both books the only way they show how to use a login form is to use the HTTP_AUTH. Which I don't want to use, I want my script to do the login and log out Like VB does. Where or how would I go about doing this? I can enter data into MySQL, but I know i am missing some steps, such as Md5ing the Password and sessions and such. Any info would be great.
View Replies !
Conditional Login..
I have a form with a username & password field along with 3 radio buttons. What I basically want to achieve is if radio button A is checked it will post the username & pass to a.php, If button B is checked it will post the username & pass to b.php and so on for button C.
View Replies !
Remote Login
I m working on a module where i want to write a script which when run should allow me to login to a perticular site, which i call remote login (dont know if its right or wrong). Can we do this in PHP? I heard something called CURL...can we do it using this? e.g. suppose i have www.yahoo.com and i want to login to yahoo from my program..may be passing some username and password in a string and then I want to retrieve inner page content. I have valid username and password of the site I want to work.
View Replies !
Login Script For Php
I'm a VERY basic webmeister for a non-profit group and need to password protect an area. How does that work? Is there some boilerplate script I can drop in?
View Replies !
Login Script
i need a basic script where users can login to certain pages which are not customeized for each user but uses mysql and php. i got one which is javascript but it sux.
View Replies !
Login Cookies
I am working on the administrative section of a website I run and I came upon a problem. I am not familiar with cookies and I want to create a cookie storing the users login names and password so that they dont need to constantly re-login. I have looked around and I don't understand how to read the cookies, only how to set them. I was wondering if someone could give me a hand. I don't have mySQL access either so I can't use that.
View Replies !
Login Problems
I have created login pages but am having problems when I test them for my site. When I type all the registration info in it accepts it no problem. When I try and sign in though and then try and access the restricted pages it takes me back to the login page. The local root folder for the site is: C:dw_dynapps ewland The remote folder and testing server for the site is: C: emote ewland The URL is: http://localhost/newland/ I am wondering whether it is something wrong with my .htaccess file? And whether it is in the right location? I get a tad confused testing locally because I never know where to put things and what the site root is? I have put the .htaccess file in the same folder as C:dw_dynapps ewland so it is also uploaded to the testing folder of C: emote ewland Is this the right place? If my site is upload to the remote folder would that then mean that the site root with just be the C drive, and that's where it should be located? In case it is already in the right place, and it might be something wrong in the actual file, this is what I have inside the file: php_flag register_globals off php_value session.save_path C:homeusersiterootsessusers php_value session.cookie_time 3600 php_value session.gc_maxlifetime 3600 php_value include_path .:C:homeusersiterootsess php_value auto_prepend C:homeusersiterootsesspath_file.php Again, I'm not sure if I have the paths correct because I'm not sure when testing locally.
View Replies !
Login/Logout
I am creating a website that has a signup and a login/logout system...i cant continue with my work becoz im stuck with the login/logout system. 1. how do i build that login/logout system? (Just give me an idea or a particular php topic that wud be efficient for this login/logout scheme of mine) 2. how do i make this login/logout system prevent non-members from accessing the members page(Just give me an idea where to start and im happy)
View Replies !
Trying To Force A Login
I have an include file that I use to secure pages with a login. When I check the password, Im also trying to check the login date While testing, Im setting the time difference to less than 10 seconds. So the idea is that when i login, then come back to a protected page more than 10 seconds later, I should be forced to login again. However, im not getting forced to login after a 10 second wait. Code: $sQuery = "Select iUser From Table Where sGUID = '$sGUID' and TIMEDIFF($login_date,LogInDate) < ༼:00:10'"; . . . //so if no returned records... header('Location: Login.php');
View Replies !
Login With Sessions...
Hey there I have made a script user to add reviews to a review site of mine, but I'm stuck on the most inportant part. the user system!!!! (that has multible users, and the user name shows up in the review, like "this review is by {insert_name_here}) Here is the code for the list.php, and off from that there is add, edit, delete.php PHP Code:
View Replies !
Login System
I have a site with a MySQL backend. It has a member-system. Members login with a small login-form that appears on every page (via include()) If members are logged in, the form disappears and a few extra links appear instead of the form. - If members log in, i want to redirect them, if succesful, back to the page they logged in from. Should i use an extra hidden form-field with the $_SERVER['request_uri'] or sould i use the $_SERVER['http_referer']? - In both cases, how can i check that the referer is from MY domain? if users login from http://domain.com/page.php i want to send them back to that page, and not to http://www.domain.com/page.php and vice versa. How do i make sure they come from 1 of my own pages, and it's accepted WITH and WITHOUT the
View Replies !
Multiple Login Without Db
Just wonder, after googling for several hours: is it impossible to make a login script for, say, three different users and, after successfull login with username and password, redirect them to their destination (totally three destinations, but only one for each user), without any MySql? And at the same time add som security (session or so).
View Replies !
|