Well now create a new page salaryselect.html which allows the user to enter the salary to search on, instead of embedding it into the SQL code. This is straight forward HTML.
<!--- salaryselect.htm --->
<html><body>
<FORM action="salaryselect.php" method="post">
Select employees whose salary exceeds
<input type="text" size="4" name="salary">
<input type="submit" value="Send">
</FORM>
</body></html>
Now create the page to process the user input, well call it salaryselect.php
You can use the earlier example, it just needs a couple of new lines.
$sal = $_POST[salary];
$query = "select empno, ename, sal from emp where sal>$sal";
The posted value from the form is picked up and placed in a variable $sal.
This variable is now used in the SELECT statement in place of the embedded number.