Jump to content

Nothing after a space


kreut

Recommended Posts

Hello,

 

I'm trying to create a sticky form using:

 

<input name="assignment_name" type = "text" id="assignment_name" 

<?php if ($_POST && $errors) {
echo "value =" . htmlentities($_POST['assignment_name'], ENT_COMPAT, 'UTF-8');
} else {echo "value = $assignment_name";} ?> 

/></text>

 

It works if my assignment name is one word; if it's multiple words, it only produces the first word.  Any thoughts would be appreciated.

 

Thank you...

Link to comment
https://forums.phpfreaks.com/topic/228490-nothing-after-a-space/
Share on other sites

Try the following

<?PHP
  if (isSet($_POST) && $errors) {
    $assignment_name = htmlentities($_POST['assignment_name'], ENT_COMPAT, 'UTF-8');
  } 
?>

<input name="assignment_name" type ="text" id="assignment_name" value="<?PHP echo $assignment_name;?>">

 

Regards, PaulRyan.

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.