niche Posted September 6, 2009 Report 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 Report Share Posted September 6, 2009 (edited) <a href="<?php echo $var ?>" target="_blank" >w3schools Home</a> Edited September 6, 2009 by Ingolme Link to comment Share on other sites More sharing options...
Synook Posted September 7, 2009 Report 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 Report 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
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now