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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.