SteemTools - Change Current Recovery With PHP. Tutorial - Part 7

in utopian-io •  3 months ago 


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 change current recovery account
  • You will learn How to use API


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


  • Intermediate

Hello Steemians,

I am Nawab. Last week an accident happened to me. So I didn't write any tutorial one week. Now I want to continue my steemtools php tutorial series. In this ongoing series, I have taught you to make some useful tools based on steemit in php language.

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. Check recovery Request
  4. Request account Recovery
  5. Recover Account
    Yesterday I have taught you the first part. Today, I will teach you the second part.

Change Recovery Account

It is a tool which can change your recovery account using steemconnect. Follow the steps to make change recovery account

First, create a file changerecovery.php in the home directory. Then write down the below codes.

  • 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.

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

Username and recovery account input form:
For changing steem recovery account with steemconnect, You must input 2 data. These are-

  • Your steemit username.
  • New recovery account username.
    So, create a bootstrap form with two 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> 
              <input type="text" class="form-control" name="user" placeholder="Username">
(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>
                 <input type="text" class="form-control" name="to" placeholder="Recovery Account">

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

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.
$from = $_POST["user"];   // username
$to = $_POST["to"];     // recovery account

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 username.
  2. new_recovery_account : New recovery account username.
  3. extensions: I don't know what is it. But its default value is []

Write this code to make a steemconnect URL

$ext = "[]";  // extension
$api = "$from&new_recovery_account=$to&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

Include footer : Include your footer file

include ('include/footer.php');
  //include footer

Download The file from github

Test the tool

Open the file using a browser. You will see this.
Now input your username and new recovery account. Then click on submit.
The browser will redirect to steemconnect. Input your username & password. Then confirm.


Proof Of work done

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:

  • Using the first person in the tutorials makes it difficult to understand the tutorials. We suggest using the third person in your text.

  • 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.

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.



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

Congratulations @nawab69! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made more than 50 upvotes. Your next target is to reach 100 upvotes.

Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Do not miss the last post from @steemitboard:

Valentine challenge - Love is in the air!

Support SteemitBoard's project! Vote for its witness and get one more award!

Hey, @nawab69!

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

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

Want to chat? Join us on Discord

Vote for Utopian Witness!