This is a discussion on "Username & Password" within the PHP Forum section. This forum, and the thread "Username & Password are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Username & Password
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Username & Password
Hi I am having problems creating a user login feature. I have created a form to allow users to create a username and password which then adds this information to mysql.
When i try to login it says: no such login in the system. please try again. The login name and password is correct so it has to be my process code which is:
Thanks Robert Last edited by karinne; Mar 28th, 2007 at 14:53. Reason: Please use [php]...[/php] tags when displaying PHP code! |
|
|
|
|||
|
Re: Username & Password
This is my signin Form:
<FORM ACTION="authenticate.php" METHOD="get"> USERNAME: <INPUT NAME="Username" TYPE="text" ID="Username"><BR><BR> PASSWORD: <INPUT NAME="Password" TYPE="text" ID="Password"><BR><BR> <INPUT NAME="Login" TYPE="submit"> </FORM> so how would i declare those two variables in php script, like this? $Username =$_POST['Username']; $Password =$_POST['Password']; Thanks Robert |
|
||||
|
Re: Username & Password
So ... authenticate is the code you posted previously?
Then yes ... by using
I'll move this to the php forum since your problem lies with the coding and not the database |
|
|||
|
Re: Username & Password
hmmm still not working when i tried that and authenticate is the code i posted previously.
The username and password are correct i have checked the entries in the database i entered on other form. What else could be wrong? Thanks Robert Last edited by robukni; Mar 28th, 2007 at 16:13. |
|
||||
|
Re: Username & Password
add $r to
|
|
|||
|
Re: Username & Password
Hmm tried that brought up an error. I cant figure it out at all.
Have to look some more at it Thanks Robert |
|
||||
|
Re: Username & Password
You're not using any type of encryption are you? Perhaps the password is encrypted and you're not encrypting the submitted password before checking it against the database?
|
|
||||
|
Re: Username & Password
Ok ... try changing this
|
|
|||
|
Re: Username & Password
Hi ok that worked thanks.
One more question how do i load a certain page when they successfully login? At the minute if they just type the url in of the page it will still bring it up without logging in. Difficult to explain hope you know what i mean. Thanks Robert |
|
|||
|
Re: Username & Password
Ok for the above question i have came accross the following code
Thanks Robert Last edited by karinne; Mar 30th, 2007 at 15:00. Reason: Please use [php]...[/php] tags when displaying code! |
|
||||
|
Re: Username & Password
If you are checking for a unique user name, do that as a distinct module and forget the password. Then check the password once you have validated the unique user name.
Security issues: 1) The change to POST is a good one. 2) You very badly need to take the database connection out of this file and put it into a separate file stored in your root directory, where it cannot be accessed directly over the internet. Then include it at the top of your php (require_once). Like this:
|
|
||||
|
Re: Username & Password
Ah ... thanks for the tip Mason!
|
|
|||
|
Re: Username & Password
Hi thanks for your reply. I have got my login system working and made those two changes which are POST and put the DB login to separate page.
What other measures can i take to improve security? I was thinkin about password encryption maybe. my code to create account is s follows
Another problem if anyone can help me with. The service i am creating this for will have to be bought. but at the minute when i submit this the user will have full access to the website. The process is register - buy - finished. How do i prevent the user from having access after regsitering until they pay through paypal?? I am using payapl at the moment as i am not experienced with E-Commerce. Any suggestions welcome. Thanks Robert Last edited by JacobHaug; Apr 5th, 2007 at 02:25. Reason: Added [code]...[/code] tags around code! |
![]() |
| Tags |
| login feature |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Forgot password and Change password PHP script | Chono | PHP Forum | 4 | May 16th, 2008 09:13 |
| input $_SESSION['username'] = $username; on login page help | Aaron1988 | PHP Forum | 2 | Jan 28th, 2008 14:14 |
| Need help with Username and Password database.!asap | tcpodg | PHP Forum | 8 | Sep 26th, 2007 14:12 |
| urgent advise needed please, username and password | marie2007 | Databases | 7 | Jun 7th, 2007 12:51 |
| what is default sqlserver username & password ? | clickme_not | Databases | 1 | Aug 27th, 2006 17:57 |