Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String truncating on INPUT

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a flat file that i read in:
$fp = fopen("$homedir/user.txt","r");
flock($fp,2);

while($userinfo = fscanf($fp,"%[a-zA-Z0-9,. ]|%[a-zA-Z0-9@,. ]|%[a-zA-Z0-9,. ]|%[a-zA-Z0-9,. ]|%[a-zA-Z0-9,. ]|%[a-zA-Z0-9,. ]|%[a-zA-Z0-9,. ]|%[a-zA-Z0-9,. ]|%[a-zA-Z0-9,. ]|%[a-zA-Z0-9,. ]|%[a-zA-Z0-9,. ]|%[a-zA-Z0-9,. ]\n")){
list($id,$name,$pass,$email,$farmname,$address,$city,$state,$zip,$phone1,$phone2,$phone3)=$userinfo;
if($uid == $id){
$this_id=$id;
$this_name=$name;
$this_pass=$pass;
$this_email=$email;
$this_farmname=$farmname;
$this_address=$address;
$this_city=$city;
$this_state=$state;
$this_zip=$zip;
$this_phone1=$phone1;
$this_phone2=$phone2;
$this_phone3=$phone3;

}
}

All is good there. I can do a echo now and the string prints fine. But when I want to put it into an INPUT like:
<INPUT size=&quot;60&quot; type=&quot;text&quot; name=&quot;alterfarmname&quot; value=<?php echo $this_farmname ?>>

This is the problem. The data is Double Day Farm and only displays Double for input.

Help PLease.
 
enclose the php code in double-quotes
e.g.
value=&quot;<?php echo $this_farmname ?>&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top