Create a file under this directory with name of index by using create file function /user/username/index write the following code using read/write operations if ur using php. Sign up for Facebook and find your friends. Create an account to start sharing photos and updates with people you know. It's easy to register. Sep 05, 2018 How to Create a Secure Login Script in PHP and MySQL. Nowadays, with more and more stories of cracking in the news, developers are looking for the best ways of securing their sites. If your site has a member system, it could be at risk. Introduction It’s easy to use to create it. But for these kind of webpages we need to use form validation on our webpages, if anyone use JavaScript so it’s well and good because JavaScript is a very good technique to use and. But we will directly go to our work just create a simple Sign-in page to make you understand the concept of Sign-in webpage in this article. Requirements for Sign-In webpage: • HTML • CSS • PHP • MySQL • Xampp/Wamp server Using HTML to design the Sign-In webpage: First of all we need to design the Sign-In webpage. Commonly what we see on a Sign-In webpage. There is username and password form boxes and a button to sign in to the profile page of user. And also sometimes we saw CAPTCHA which is used to identify the user on the webpage during the wrong entries of the Sign-In webpage. There is also an easy method to put CAPTCHA on a webpage. But now in this article we will just learn how to design a Sign-In webpage. Let’s start Listing 1: Sign-In.html. Sign-In LOG-IN HERE User Password Figure 1: Output of the Sign-in Webpage In Figure 1 you can see the output of the Listing 1. But there is a problem, as we used the fieldset tag and the fieldset tag size is being a problem on this page. So we should change the width of the fieldset tag size. I have a simple way to use the Inline Style of CSS to get rid from this problem. Let’s see the inline CSS style code. Listing 2: Inline CSS Style. LOG-IN HERE So let’s we check the output of the sign-in.html webpage after writing the inline CSS style in the fieldset tag as you can see it in the Listing 2. As I told you that it’s an easy way to use Inline Style. We can use it from the external file by giving an ID name for the fieldset tag. But the easiest way is to use Inline Style in this kind of situations to handle them. And we should commonly find easiest ways to get rid from the problems. Figure 2: Output of the Sign-in Webpage with updated size of fieldset tag Description of sign-in webpage: As you can see in the Listing 1 and 2 we used such a good Html tags to design a simple log-in form. We used legend tag with fieldset tag to use texts on the upper side of the form. And in the form we used method POST. And action to send data to another webpage. Which will be PHP Programmed webpage, I named it connectivity.php. And there is one new thing as type that is password. The functionality of type password is to don’t show the text what we will enter in the password box. Instead of password texts or characters it will show bold dots like? Why we are using POST not GET method: We are using POST method because it is secure. If we use GET method our data will not private. POST is commonly being used for these kind of webpages, due to its security. And when we are dealing with our ID and Password, so we should be alert from the hackers. Because the GET is being used in Phishing webpages, by which people are making fool the internet users to get their personal ID and Password. Using CSS on Sign-in.html webpage: Now it’s time to use CSS style on the webpage to create some attraction. We can use many kind of styles. But the good thing is that which matches to this page. For this we will use many CSS Styles, so I think the better way is use an external file and link it to the sing-in.html webpage. Let’s start Listing 3: style.css. Alex schrimpf Just something to note. This code is vulnerable to sql injection. Type and apostrophe after username and leave password blank. It will show you the user's password. How To Create A Review Page In PhpI recommend escaping the input strings before querying mysql. Something like this should work. How To Create A Business Facebook PagePut these lines directly above query; $user = mysql_real_escape_string($_POST['user']); $pass = mysql_real_escape_string($_POST['pass']); Then just replace this line $query = mysql_query('SELECT * FROM UserName where userName = '$_POST[user]' AND pass = '$_POST[pass]') or die(mysql_error()); with $query = mysql_query('SELECT * FROM UserName where userName = '$user' AND pass = '$pass') or die(mysql_error()); [+1 year ago]. Adern Nerk I am helpful for the piece of code The login form is designed by me i just wanted the php code for checking the entries entered in the form are correct and if correct the log-in the person else gives an error about wrong id or password. I tried your code, just the php one set up the variables and databse to mine, currently using xampp in windows 10 recieving and error while execution Parse error: syntax error, unexpected 'session_start' (T_STRING), expecting '{' in C: xampp htdocs DHSC database login.php on line 9 Plz help [+1 year ago].
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2018
Categories |