Jump to content

Archived

This topic is now archived and is closed to further replies.

me1000

echo text field

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?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
you are aware that..

[code]
$x = "abc123";

print $x;
print "$x";
print " " . $x . " ";
[/code]

take note of the second example... there's no reason to escape the string if you're using print.

Share this post


Link to post
Share on other sites

×

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.