![]() |
#1 |
![]() Join Date: Sep 2007
Posts: 9
|
![]() David,
Your video tutorials are EXCELLENT. I would like the password to be case sensitive like traditional passwords. I saw something about Collate but I tried adding it to the login page but it didn't work. I have viewed all of your tutorials and I would love more. Thanks Art |
![]() |
![]() |
![]() |
#2 |
![]() Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
|
![]() use this...
PHP Code:
PHP Code:
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk |
![]() |
![]() |
![]() |
#3 |
![]() Join Date: Sep 2007
Posts: 9
|
![]() David,
I tried your 2 suggestions but I am very new and I did something wrong because they didn't work. Your help is greatly appreciated. Here is my code (really your code): <?php require_once("connection.php"); //The above was connection.php session_start (); $userid = $_POST['userid']; $upassword= $_POST['upassword']; $submitted = $_POST['submitted']; //////////////////////////////////// if ($userid && $upassword ){ $query = sprintf("Select * From users where user_name = '$userid' and user_password ='$upassword'"); $result = @mysql_query($query); $rowAccount = @mysql_fetch_array($result); ///////////////////////////////// } if ($rowAccount){ $_SESSION ['id'] = $rowAccount ['user_id']; header ("location: welcome.php"); exit; }elseif($submitted){ echo "Sorry but we can't find you in our database"; } ?> Thanks |
![]() |
![]() |
![]() |
#4 |
![]() Join Date: Sep 2007
Posts: 64
|
![]() What error code do you get when you run the script?
Also, try to use the CODE tags next time please ![]() Last edited by owner; 09-08-2007 at 10:55 PM.. |
![]() |
![]() |
![]() |
#5 |
![]() Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
|
![]() owner
i hand you the baton on this one
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk |
![]() |
![]() |
![]() |
#6 |
![]() Join Date: Sep 2007
Posts: 64
|
![]() |
![]() |
![]() |
![]() |
#7 |
![]() Join Date: Sep 2007
Posts: 9
|
![]() Sorry Gentlemen,
I posted David's code that works but I tried to implement his suggested code for case sensitive passwords and below was my failed attempt. I am very new at php code so thanks for any help. <?php require_once("connection.php"); //The above was connection.php session_start (); $userid = $_POST['userid']; $upassword= $_POST['upassword']; $submitted = $_POST['submitted']; //////////////////////////////////// if ($userid && $upassword ){ $query = sprintf("Select * From users where user_name = '$userid' and user_password ='$upassword'"); $result = @mysql_query($query); $rowAccount = @mysql_fetch_array($result); ///////////////////////////////// } if ($rowAccount){ $no1 = $rowAccount ['$user_password']; $no2 = $upassword; if($no1 == $no2){ $_SESSION ['id'] = $rowAccount ['user_id']; header ("location: welcome.php"); exit; }}elseif($submitted){ echo "Sorry but we can't find you in our database"; } ?> |
![]() |
![]() |
![]() |
#8 | |
![]() Join Date: Sep 2007
Posts: 64
|
![]() Quote:
PHP Code:
PHP Code:
Give that ago, try to learn what you did wrong by comparing both sources and see what happens. Feel free to post back ![]() -Owner Last edited by owner; 09-09-2007 at 01:18 AM.. |
|
![]() |
![]() |
![]() |
#9 |
![]() Join Date: Sep 2007
Posts: 9
|
![]() I followed all of David's video tutorials and entered the code and tested and everything worked until he added "sessions". When I pressed F12 things wouldn't run on my local server but when I uploaded to my website they worked. So all of his code worked on my website but not on my xp local server. When I tried to add the code for case sensitive password the page will not load. I tried your suggestion and it didn't help. You mentioned error tags and I don't know how to give these to you. When I go to my website with Firefox I get this message:
The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. * This problem can sometimes be caused by disabling or refusing to accept cookies. |
![]() |
![]() |
![]() |
#10 |
![]() Join Date: Sep 2007
Posts: 64
|
![]() It sounds like the security that you have on firefox is maxed and isn't allowing session cookies. Try lowering your security for a second, test the page, then if it works, you know it is your security level. If not, then put your security back up.
Note: if your security levels turn out to be high, slowly adjust your security level back up till it keeps working so that you still browse securely. |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|