me1000 Posted March 12, 2006 Share Posted March 12, 2006 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? Quote Link to comment Share on other sites More sharing options...
High_-_Tek Posted March 12, 2006 Share Posted March 12, 2006 You had the ?> backwards[code]value="<?php echo $link; ?>"[/code] Quote Link to comment Share on other sites More sharing options...
me1000 Posted March 12, 2006 Author Share Posted March 12, 2006 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 outecho '<TR><TD><input type="text" name=link value="'.$link.'" style="color: #000000; background-color: #CCCCCC" readonly></TD></TR>';simple enough! :P Quote Link to comment Share on other sites More sharing options...
keeB Posted March 12, 2006 Share Posted March 12, 2006 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.