Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Secure Login in HTML/PHP
PostPosted: Sat Apr 04, 2015 5:04 am 
Offline
Senior Newbie

Joined: Mon Mar 30, 2015 9:45 am
Posts: 13
Hi,
in my website i have a login form, and i do this:

Code:
<form class="user-form" action="login.php" method="post">


to send information to server, and in the server i do this:

Code:
$username = $_POST['user'];
$password = $_POST['psw'];


to get the information, and then i store the information securely on my database with salt etc...
My question is how i can protect the information that will be send from the page to the server with the $_POST? there is something to encrypt and not send it clearly?

Thanks


Top
   
PostPosted: Sat Apr 04, 2015 5:08 am 
Offline
Senior Newbie

Joined: Tue Apr 01, 2014 3:35 pm
Posts: 15
I assume you're looking for https://, which you control at the httpd level, not PHP.

What httpd software are you using (Apache, nginx, lighttpd, etc)?

Also worth noting if you're storing passwords in a DB, don't deal with 'salting' and stuff on your own, assuming you're using even a slightly old PHP, you should have support for password_hash(), use that for your passwords.


Top
   
PostPosted: Sat Apr 04, 2015 5:09 am 
Offline
Senior Newbie

Joined: Mon Mar 30, 2015 9:45 am
Posts: 13
Yes i use also password hash, i have apache


Top
   
PostPosted: Sat Apr 04, 2015 5:46 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
I don't know what distribution you're using but assuming it's Ubuntu check here https://www.linode.com/docs/security/ss ... -on-ubuntu if not have a search through the Linode docs.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Sat Apr 04, 2015 5:54 am 
Offline
Senior Newbie

Joined: Mon Mar 30, 2015 9:45 am
Posts: 13
yes i have ubuntu, i already have found that guide, i have to read the Self-Signed SSL Certificate part? on the https page will be only my login page? or all website?


Top
   
PostPosted: Sat Apr 04, 2015 10:28 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
You should get a commercial certificate otherwise your users will get a warning from their browser. What you need to secure depends on your site, but if in doubt secure the whole thing.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group