View a text input in PHP echo

July 2017




Issue


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?

Solution


Use this code:
  • echo "<input type=\"text\" readonly=\"readonly\" value=\"".$_SESSION['name']."\">"; 

Related


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 (ccm.net).