Steemtools tutorial part -8 | Request recovery account

in utopian-io •  3 months ago  (edited)

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.

(html comment removed:  Form start Here )
   <form action="" method="post" >

(html comment removed:  Username Input box )
      <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>

(html comment removed:  Recovery Account Input Box)
 <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>

(html comment removed:  New Owner Authority Input Box)
 <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>

(html comment removed:  Submit Button )
<div class="form-group">
 <button align="center" name="submit" class="btn btn-primary mb-2">Submit</button> 
 </div>
 </form>
(html comment removed:  End 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

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thank you for your contribution @nawab69.
After analyzing your tutorial we suggest the following points listed below:

  • You need to explain more the steps you take in your tutorial. The tutorial is meant to explain, so the ideal is to explain as much as possible for the readers to realize well what you are teaching.

  • Your tutorial is quite short for a good tutorial. We recommend you aim for capturing at least 2-3 concepts.

Looking forward to your upcoming tutorials.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

·

Thank you for your review, @portugalcoin! Keep up the good work!

Hi @nawab69!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Thanks for participating in "Pimp Your Post Thursday," one of the first "live" curation shows on Discord, in The Ramble! 🙂

Hey, @nawab69!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Magic Dice has rewarded your post with a 73% upvote. Thanks for playing Magic Dice.