Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6968277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:25:52+00:00 2026-05-27T16:25:52+00:00

I want to refresh the same page and display the entered value in text

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:25:53+00:00Added an answer on May 27, 2026 at 4:25 pm

    What you want is AJAX. I am just providing you an example of how you can proceed by using jQuery, but you can use any other library / framework or any other way also. You can check this article also for more usability details.

    In the main page:-

    <?php
    echo '<h3>Fee Payment</h3>';
    
    echo "<form id='myFormId' name='myFormName'>";
    echo "<input type='text' name='myTextField' id='myTextField' />";
    echo '<a href="javascript:void()" id="inline_submit_a">Search Student</a>';
    echo "</form>";
    ?>
    
    <script type="text/javascript">
    $('#inline_submit_a').click(function(evt){
        $.ajax({
           type: "GET",
           url: "handler.php",
           data: {text:$('#myTextField').val()}
        });
    
        evt.preventDefault();
        return false;
    });
    </script>
    

    In the “handler.php” page:-

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

    You can write all the logic related to the database in the “handler.php” page.

    Hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

want to have a Hyperlink-Button in a gridView in which I can display a
hi i want to refresh user page with different data but with same template
I have a Refresh button on my page that will perform an asp.net mvc
I have the following situation: 1) 1 X PhotoTableViewController to display a list of
When I refresh a page or redirect to the same one using the same
I have this piece of code: <asp:Button runat=server Text=Process Payment /> When I click
I have 3 thumbnails which i want to rotate each time a user refresh
Once the user is on my page, I do not want him to refresh
want to know why String behaves like value type while using ==. String s1
Want to send the text from my current vb application to the Active Window

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.