Mutley Posted September 2, 2006 Share Posted September 2, 2006 I have an address I want to add into an if statement, which will be:[code] if($sponser == http://) {echo " "}else {<a target="_blank" href="<?=$sponser?>">Click to View Website</a>}[/code]So if there is no website it won't show "Click to view website" but the problem is http:// creates a PHP comment which stops it from working.Thanks. Link to comment https://forums.phpfreaks.com/topic/19468-stop-php-comments-ifsponser-http/ Share on other sites More sharing options...
AndyB Posted September 2, 2006 Share Posted September 2, 2006 Like this instead, perhaps:[code]if($sponser != "http://") { echo '<a target="_blank" href="'. $sponser. '">Click to View Website</a>';}[/code] Link to comment https://forums.phpfreaks.com/topic/19468-stop-php-comments-ifsponser-http/#findComment-84543 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.