too long

I have been working with php and mysql and I make some kind of data saving. In a <?PHP ?> sentence I insert a <FORM> And in the <INPUT type=text... I put that automatically insert the info taken from the data base as the value= <INPUT type=text name=lastname **value=$lasnam**> But the lastname has a space between the words, like this: Viera Petit-Jean... But the problem is that the value is given from the first word, the space breaks the lastname and the only thing that I get is "Viera" if there is one way to make that that space automatically changes into a &nbsp; so that the last name could be given correctly

 `<?PHP if($enter == 1)
            {
            if ($inable == 1)
            {
             echo "<FORM action=infoedit.php method=post target=_blank>
                                                                <table style=width:100%;>
                                                                    <div class=form_edit>
                                                                <INPUT type=text class=invisible1 name=nomb1 value=".$nomb1." />
                                                                <INPUT type=text class=invisible1 name=apat1 value=".$apat1." />
                                                                <INPUT type=text class=invisible1 name=amat1 value=".$amat1." />
                                                                <INPUT type=text class=invisible1 name=edad1 value=".$edad1." />
                                                                <INPUT type=text class=invisible1 name=esta1 value=".$esta1." />
                                                                <INPUT type=text class=invisible1 name=idu1 value=".$idus1." />
                                                                    </div>  
                                                                </table>
                                                                <div>
                                                                <p><span>&nbsp;</span><input class=perfil type=submit name=enviar value=Perfil /></p>
                                                                </div>
                                                                </FORM>";

?> `

You need to enclose your value in quotes so that your field looks like this:

<input type="text" name="lastname" value="Viera Petit-Jean">

You haven't posted your PHP code, so you'll have to work out the required changes yourself.

You really shouldn't echo a whole form out like that. It's easier to embed your php so you don't have to worry about escaping. Also in your html you should be using quotations around your attributes.

<?php if ($enter == 1) { if ($inable == 1) { ?>

  <FORM action="infoedit.php" method="post" target="_blank">
    <table style="width:100%;">
      <div class="form_edit">
        <INPUT type="text" class="invisible1" name="nomb1" value="<?php echo $nomb1; ?>" />
        <INPUT type="text" class="invisible1" name="apat1" value="<?php echo $apat1; ?>" />
        <INPUT type="text" class="invisible1" name="amat1" value="<?php echo $amat1; ?>" />
        <INPUT type="text" class="invisible1" name="edad1" value="<?php echo $edad1; ?>" />
        <INPUT type="text" class="invisible1" name="esta1" value="<?php echo $esta1; ?>" />
        <INPUT type="text" class="invisible1" name="idu1" value="<?php echo $idus1; ?>" />
      </div>  
    </table>
    <div>
      <p><span>&nbsp;</span><input class="perfil" type="submit" name="enviar" value="Perfil" /></p>
    </div>
  </FORM>

<?php }} ?>

I don't know if i got the question correct,

But it looks like you just need to enclose the variable to print last name with double quotes, like

 value="<?=$lastname?>"

or if every thing is echoed in php then some thing like

 echo "<input type=\"text\" name=\"lastname\" value=\"".$lastname."\">";

should do it.

There were multiple issues, two closing tags were extra

and in php file you can just write html as well, so it will output the html, i am posting it as new answer due to limitation in commenting.

<?php if(// your if clause){ ?>
    <FORM action="infoedit.php" method="post" target="_blank">
       <table style="width:100%;">
         <div class="form_edit">
           <INPUT type="text" class="invisible1" name="nomb1" value="<?=$nomb1?>" />
           <INPUT type="text" class="invisible1" name="apat1" value="<?=$apat1?>" />
           <INPUT type="text" class="invisible1" name="amat1" value="<?=$amat1?>" />
           <INPUT type="text" class="invisible1" name="edad1" value="<?=$edad1?>" />
           <INPUT type="text" class="invisible1" name="esta1" value="<?=$esta1?>" />
           <INPUT type="text" class="invisible1" name="idu1" value="<?=$idus1?>" />
        </div>
       </table>
       <p><span>&nbsp;</span><input class="peril" type="submit" name="envier" value="Perfil" /></p> 
       </FORM>
<?php } ?

I think there is a problem of quotes
do one thing View source of your render browser code and validate here http://validator.w3.org/ you will find the mistake surely :)