Steemtools tutorial part -8 | Request recovery account

Words
603
Reading
3 min
Listen
Play
8y

Repository

https://github.com/nawab69/steemtools

What Will I Learn?

  • You will learn About steem account recovery
  • You will learn How to make PHP web tool
  • You will learn How to make a PHP site which will request to recovery account for recover the account.
  • You will learn How to change owner authority.

Requirements

  • Knowledge on PHP, HTML, Bootstrap, API
  • Php server
  • Bootstrap CDN
  • SteemConnect

Difficulty

  • Intermediate

IMG_20190131_112733_439.JPG


Hello Steemians,

I am Nawab. I have started steemtools series again last week after a long break . In this ongoing series, I have taught you to make some useful tools based on steemit in php language.

I am sorry for my grammatical errors. I am trying to improve my previous fault.

Here is the previous series -

Now I will teach you creating steemit account recovery tools. This tool has five part.

  1. Check current recovery account ✅
  2. Change recovery Account ✅
  3. Request account Recovery 🔥
  4. Check Recovey Request
  5. Recover Account

Two days ago, I have taught you the 2nd part. Today, I will teach you the third part.

Request Account Recovery

It is a tool which can request your recovery account for recover your account using steemconnect. Follow the steps to make request account recovery…

First, create a file requestrecovery.php in the home directory. Then write down the below codes. It is simmilar like changerecovery.php tool.

  • Include header file : include() is a PHP function. The Include() function is used to put data of one PHP file into another PHP file. If errors occur then the include() function produces a warning but does not stop the execution of the script i.e. the script will continue to execute.

The header file is not so important. So use this function.

<?php
include ('include/header.php'); // Include header file
include ('include/nav.php'); //Include navigation bar file 
?>

Username and recovery account input form:
For request account recovery with steemconnect, You must input 4 data. These are-

  • Your steemit username.
  • Recovery account username.
  • New owner authority.
  • Extensions. ( Its default value is [] . So skip it in form.)

Create a bootstrap form with three input box and a submit button.


   <form action="" method="post" >


      <div class="form-group">
        <div class="input-group mb-2 mr-sm-2"> 
          <div class="input-group-prepend">
           <div class="input-group-text">@</div> 
           </div>         
      <input type="text" class="form-control" name="username" placeholder="username"> </div> </div>


 <div class="form-group">
      <div class="input-group mb-2 mr-sm-2"> 
      <div class="input-group-prepend"> <div class="input-group-text">@</div> </div> 
      <input type="text" class="form-control" name="recovery" placeholder="Recovery Account username"> </div> </div>


 <div class="form-group">
      <div class="input-group mb-2 mr-sm-2"> 
      <div class="input-group-prepend"> <div class="input-group-text">@</div> </div> 
      <input type="text" class="form-control" name="new" placeholder="New owner authority's username"> </div> </div>


<div class="form-group">
 <button align="center" name="submit" class="btn btn-primary mb-2">Submit</button> 
 </div>
 </form>


IMG_20190221_210122_352.JPG


Php functions :Now you have to write some php functions to run the tool. These are-

  • Get data from HTML form using the POST method. Then store them in different variables.
<?php
if($_POST)
{
$recovery = $_POST["recovery"];   // recovery account username
$username = $_POST["username"];     // account to recover username
$new = $_POST["new"];     // new owner authority

Here if($_POST){} means when someone post using HTML form, all the functions inside {} will run.

  • Generate steemconnect URL :
    For changing recovery account steemconnect need 3 input. These are -
  1. account_to_recover: Your steem account username.
  2. recovery_account: Your steem account's recovery account.
  3. new_owner_authority : New Owner username.
  4. extensions: I don't know what is it. But its default value is []

Write this code to generate a steemconnect URL

$ext = "[]";  // extension
$api = "https://app.steemconnect.com/sign/request_account_recovery?recovery_account=$recovery&account_to_recover=$username&new_owner_authority=$new&extensions=$ext";   // steemconnect Api
  • Redirect to steemconnect: Finally, you have to redirect to steemconnect URL for confirming the transaction.
header("Location: $api");   // redirect to steemconnect
}
?>


IMG_20190221_211624_061.JPG


Include footer : Include your footer file

<?php
include ('include/footer.php');
  //include footer
?>

Download The file from github

Test the tool

First, open your tool using any browser. Then you will see 3 input box.


IMG_20190221_210122_352.JPG


Input your username in first box. Then input your recovery account username in the second box. Then input new account authority in the last box.


IMG_20190221_210142_405.JPG


Finally click on "submit" button.

The tool will redirect to steemconnect and show all values. Then click on "continue".


IMG_20190221_210157_668.JPG


Finally input your username and wif and login.


IMG_20190221_210212_443.JPG


Curriculum

Proof Of work done

https://github.com/nawab69/steemtools
https://steemtools.cf/requestrecovery

Steemtools tutorial part -8 | Request recovery account | Ecency