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. Quote Link to comment 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] 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.