Question: I want to refresh the same page and display the entered value in text box on the same page after clicking the link or button.

I have the following code:

```
 <?php 
 echo '<h3>Fee Payment</h3>';

 echo "<form id='myFormId' name='myFormName'>";
 echo " <input type='text' name='myTextField'>";
 echo "<a href='{$_SERVER['PHP_SELF']}?student_no=myTextField'> Search Student</a>";

 if (!(isset($_GET[student_no])))
 { 
    echo "No Student is available.";
 } 
 else
 {
    $student_no = $_GET['student_no'];
    echo "Student NO:".$studen_no;
 }
 ?>

```

Please guide me how to achieve the goal and whats the error my code.

Answer: 
```
<?php 
echo '<h3>Fee Payment</h3>';

if(isset($_POST['myTextField']))
 $value=$_POST['myTextField'];
else
 $value='';

echo "<form id='myFormId' name='myFormName' method='post'>";
echo " <input type='text' name='myTextField' value='$value'>";
echo "<a href='{$_SERVER['PHP_SELF']}?student_no=myTextField'> Search Student</a>";

```

You also need a submit button in the form, and a form close tag.
1. You're using a link to submit the form, but you should be using a submit button.
`<input type="submit" value="Search student" />`
2. You didn't close the `<form>` tag.
3. You're using `$_GET[student_no]` which will make PHP look for a definition of `student_no`. Since it's a string, express it as one. `$_GET['student_no']` is better.