Jump to content

echo text field


me1000

Recommended Posts

OK I have a non editable text field inside of a loop. I want the text field value to be the $link var...

[code]
$link = 'http://www.site.com/index.php?page_id='.$page_id;

echo "<TR><TD>$page_title</TD><TD>$page_id</TD></TR>";
echo '<TR><TD><input type="text" name=myText value="<?php echo $link; >?"  style="background-color: #CCCCCC" readonly></TD></TR>';
[/code]

can you please explain to me why this doesnt work?
Link to comment
https://forums.phpfreaks.com/topic/4731-echo-text-field/
Share on other sites

changed it and still no luck heres the whole loop...

[code]
<?

echo "<TABLE BORDER=0>";
while ($row = mysql_fetch_array($sql_result)) {


$page_id = $row["ID"];
$page_title = $row["PAGE_TITLE"];
$link = 'http://www.site.com/index.php?page_id='.$page_id;

echo "<TR><TD>$page_title</TD><TD>$page_id</TD></TR>";
echo '<TR><TD><input type="text" name=myText value="<?php echo $link; ?>"  style="color: #000000; background-color: #CCCCCC" readonly></TD></TR>';
echo '<TR><TD><hr></TD></TR>';
}
echo "</TABLE>";


?>

[/code]

never mind I figured it out

echo '<TR><TD><input type="text" name=link value="'.$link.'" style="color: #000000; background-color: #CCCCCC" readonly></TD></TR>';

simple enough! :P
Link to comment
https://forums.phpfreaks.com/topic/4731-echo-text-field/#findComment-16567
Share on other sites

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.