niche Posted September 6, 2009 Share Posted September 6, 2009 I want to show w3schools.com as a link from a PHP variable. This is what I wrote: How should I have written it?<html><head><body><?php$var ="http://www.w3schools.com/" ;?><a href= <?php $var ?> target="_blank" >w3schools Home</a></body></head></html> Link to comment Share on other sites More sharing options...
Ingolme Posted September 6, 2009 Share Posted September 6, 2009 <a href="<?php echo $var ?>" target="_blank" >w3schools Home</a> Link to comment Share on other sites More sharing options...
Synook Posted September 7, 2009 Share Posted September 7, 2009 You don't need the ;. Link to comment Share on other sites More sharing options...
PravinBhat Posted October 12, 2009 Share Posted October 12, 2009 Like This<html><head><body><?php$var ="http://www.w3schools.com/" ;<?php echo"<a href=";echo $var;echo"/">w3schools Home</a>";</body></head></html> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.