Hi I am new to using moodle and I am trying to display the value of a logged in user with a textbox. the end goal is to create a suggestion box to allow users to put forward ways of improvement, however I cannot get the text to display the username correctly. Instead the value I enter in my HTML code is displayed instead.
Within my php i have declared variables for the username
$_SESSION["firstname"] = $USER->firstname;
$_SESSION["lastname"] = $USER->lastname;
$_SESSION["username"] = $USER->username;
and withing my HTML file i am passing the username value this way.
<input name="firstname" style="height: 27px; width: 260px; margin: 10px 10px; color: #231f20;
border: 1px solid #dedede; -moz-border-radius: 5px; -webkit-border-radius: 5px;
border-radius: 5px;" type="text" value="<?php echo htmlentities($username) ?>" />
Can any offer some advice on what I am doing wrong?