Fill Form Fields From Previous Page Form Data

I’ve a form on my WordPress home page with only one input filed (phone number) and a continue button. When user adds his phone number and presses the continue button, he redirects to the second page with a complete form. The next page form will also have a phone number field which I want to be filled with the previous page data. I don’t know how it possible but I think my question is clear so someone will be really here to help me.

I will look forward to have the soonest response.

Read More

My website is http://marle.junaidkhawaja.com/

Related posts

Leave a Reply

2 comments

  1. save your data in $_SESSION and store on second page render

    <?php
    session_start();
    // store session data
    $_SESSION['phone']=511111111;
    ?>
    

    OR in client side save variable in local storage

    localStorage.setItem("phone", 511111111);
    

    AND YOU WILL ACCESS TO VARIABLE FROM ANY (SAME) PAGE

    localstorafe.getItem("phone");
    
  2. Yes @Junaid Khawaja as MR. Anri answered you can store your data in $_SESSION retrieve data like

    <?php
    session_start();
    // store session data
    $_SESSION['phone']=511111111;
    
    // retrieve data
    echo $_SESSION['phone'];
    ?>