I have a functional sign up page for a blog that updates a database with a users name, email, profile picture and a short bio. The General information page and the profile picture upload/bio page are two separate pages and I have a problem with users being able to go back into their profile pic page and re-entering their information again for their bio and user which then screws the entire database up. While incorporating php $_SESSION, I want to be able to track a users progress with the form and if attempting to update the same form page, have the user sent to their current page that has yet to be completed. I'm in search of an algorithm suitable for this and yet have not been able to implement one that works properly. The first page of my form looks to see if step01(general info form) has been completed.    session_start();if(!isset($_SESSION['step01'])){    if($_SESSION['step01']=='complete')    {        echo <script>window.location.assign('localhost:8888/knoxville_programmers/blog-signup-propic.php');</script>;    }    else    {        $_SESSION['step01'] ='incomplete';    }}Upon completion of the first form the second form for uploading a user picture and bio checks if 1.) the first form is completed and 2.) that the current form hasn't already been completed. If it has then the user is redirected to their user page.     session_start();if(!$_SESSION['step01']=='complete'){    echo <script>window.location.assign('localhost:8888/knoxville_programmers/blog-signup.php');</script>;    #echo <script>window.location.assign('localhost/knoxville_programmers/blog-signup.php');</script>;}elseif($_SESSION['step01']=='complete'){    if(!isset($_SESSION['step02']))    {        $_SESSION['step02']='incomplete';    }    elseif (isset($_SESSION['step02']))     {        if($_SESSION['step02']=='complete')        {            echo <script>window.location.assign('localhost:8888/knoxville_programmers/user-page.php');</script>;            #echo <script>window.location.assign('localhost/knoxville_programmers/user-page.php');</script>;        }        else        {            $_SESSION['step02']='incomplete';        }    }}My method of approach is error prone and i have not been able to have it work properly for a minute and am in need of a more suitable idea.
Algorithm to maintain a blog sign up page
php;database;security;mysql;tracking