Jump to content

Print on the same page


mirah

Recommended Posts

Hi

 

I'm really new to php, please bear with me on this simple question...

 

I'd like to print the variable in the textbox on the same page - underneath the form.

 

Thanks in advanced.

 

 

 

Right now the code is in the body section of an html page:

 

 

<body>

 

<form action="<? echo $_SERVER['PHP_SELF']; ?>" method="get">

Student:  <input type="text" name="name">

 

<input type="submit" name="submit">

 

 

</form>

 

<?

 

echo $_GET['username'];

 

?>

 

</body>

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/95338-print-on-the-same-page/
Share on other sites

I believe your looking for this:

 


<body>

<form action="<? echo $_SERVER['PHP_SELF']; ?>" method="get">
Student:  <input type="text" name="name">

<input type="submit" name="submit">


</form>

<input type='text' value='<? echo $_GET['name']; ?>'>

</body>

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.