Jump to content

Archived

This topic is now archived and is closed to further replies.

Mutley

Stop PHP Comments.... if($sponser == http://)

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Like this instead, perhaps:

[code]if($sponser != "http://") {
    echo '<a target="_blank" href="'. $sponser. '">Click to View Website</a>';
}[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.