Essay Writing WebSite without Registration

Allows to browse WebSite without login/registration, removing the offending modal popup

Author
Daisy Rowley
Daily installs
0
Total installs
28
Ratings
0 0 0
Version
2.3
Created
Updated
License
GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
Applies to
  • website.com
  • https://*.WebSite.*/*

This tutorial will help you in building your own working registration section on your site. First of all, Create a table with name "login" in database (That you've created for your site on the your host), then add three fields in it with names "id, username, password" and "id" should be set to integer and auto-increment mode (Primary Key) while creating. Now, We need to create two pages on our essay writer site,

  1. First for the HTML Form,
  2. And Second one for php script (PHP code) which will process the details submitted by user via HTML form to store it in database.

Let we start through registration form (You can add as many input fields according to need but do not forget to make necessary changes in php script on another page).

See the code below:

<form method="post" action="link of the page having sign-up script">
<table border="0">
 
<tr><td>username: </td><td><input type="text" name="username" /></td></tr>
 
<tr><td>Password: </td><td><input type="password" name="password" /></td></tr>
 
<tr><td>Confirm Password: </td><td><input type="password" name="confirm_password" /></td></tr>
 
<tr><td></td><td><input type="submit" value="submit" /></td></tr>
 
</table>
</form>

Now, We are going to see the script that will do all the processing and insertion work of the details submitted via registration form into the database. Note that we are first storing the values of form in php variables to check some education requirements.

Notice:

  1. You should Create a separate page for this php script below and then change the action="" attribute in form to action="php script page link".
  2. You can also try your own ideas to add more juices in this code if you have write my essay website.
  3. I recommend You to use the encryption method MD5 to encrypt the password, so that password remain safe in database without getting known to anyone (means encrypted password will get store in database instead of that used during registration).
  4. If you are encrypting password here then you also need to change your 'log in' script so that user entered password via login form is first converted into encrypted password then checks the database for user-name and password match, see the 'log in' script written here by me.

See the code below:

<?php
/* This code will make a connection with database */
$con=mysql_connect("Hostname","username","password");
 
/* Now, we select the database */
mysql_select_db("Database Name");
 
/* Now we will store the values submitted by form in variable */
$username=$_POST['username'];
$pass=$_POST['password'];
/* we are now encrypting password while using md5() function */
$password=md5($pass);
$confirm_password=$_POST['confirm_password'];
 
/* Now we will check if username is already in use or not */
$queryuser=mysql_query("SELECT * FROM login WHERE username='$username' ");
$checkuser=mysql_num_rows($queryuser);
if($checkuser != 0)
{ echo "Sorry, ".$username." is already been taken."; }
else {
 
/* now we will check if password and confirm password matched */
if($pass != $confirm_password)
{ echo "Password and confirm password fields were not matched"; }
else {
 
/* Now we will write a query to insert user details into database */
$insert_user=mysql_query("INSERT INTO login (username, password) VALUES ('$username', '$password')");
 
if($insert_user)
{ echo "Registration Succesfull"; }
else
{ echo "error in registration".mysql_error(); }
 
/* closing the if else statements */
}}
 
mysql_close($con);
?>

Hope, you will find this code simple and easy to understand as well as executable on your site. If you find any difficulties you can ask me here at comments section or can contact via contact form on hubpages after joining here.