View a text input in PHP echo

April 2018


I want to display a input type = "text" in a PHP echo.
  • echo "<input type=\"text\" readonly=\"readonly\" value=\"<?php echo $_SESSION[\'name\'];?> >"; 
  • Could you help me please?


Use this code:
  • echo "<input type=\"text\" readonly=\"readonly\" value=\"".$_SESSION['name']."\">"; 
Published by aakai1056. Latest update on November 15, 2011 at 10:11 AM by aakai1056.
This document, titled "View a text input in PHP echo," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (
PHP - List the files of a sub-directory
PHP script to test the validity of email addresses