Discussion in 'PHP & Perl' started by hirephp, Apr 25, 2012.
How can i create login form in PHP?
With notepad++ obviously...
This must be one of the PHP subjects with the most tutorials out there. If you want someone to do your work, then open up a WTB thread and pay. Otherwise, learn to use Google.
There's lots of open source login scripts available for php. Search Google and look for something that has been tested and secured. Much safer if you've never done this before. And then study the scripts to see what they're doing.
I use zeta if it's not an oauth consumer: http://incubator.apache.org/zetacomponents/documentation/trunk/Authentication/tutorial.html
Get an SSL certificate. Once you have HTTPS working on your server (work with your hosting company to get it working), you can use code similar to the following to force an HTTPS connection in PHP. .htaccess is another option, mentioned elsewhere.
You can't make form directly in PHP but it provides dynamic features in web pages. Form is made on HTML language and PHP basically meant for server side working.
Create database table in mysql with username and password held
create login form
post to a processing page (on that page access database and compare login variables)
if variables don't match redirect to log out page and destroy session
if login variables match create session and add variables to session
run security at the top of each page to check if the user is good if not send to session destroy page
use session to keep people out of pages with security script
thats just what I do in a nut shell but I add a few other things here and there
Brenig at Univelocity
What does https have to do worth logging in?
The first file we need to create is "main_login.php" which is a login form.
Separate names with a comma.