在提交文本框中更新值? PHP

I have a PHP web page. Initially, the values in the text box are retrieved from a LDAP directory based on the user login information. The user makes any required changes in the values and on clicking submit the values in the text box get updated and also the values in the Directory get updated as well( I have got this part done). I am new to PHP and I am trying to figure out how to update the values in the text box on submit.

With PHP you can only do changes on submit when you do a AJAX call to the server. However, you can do changes using only PHP after submitting it on the server side.

Updating in the browser directly "onsubmit" is not possible without the help of JavaScript.

You want to take the values the user has submitted and redisplay them in your text field.

Something like

<input type="text" name="phone_num" id="phone_num" value="<?php (isset($_POST['phone_num']) ? $_POST['phone_num'] : $valueFromLDAPDir) ?>" />