If statement, not working correctly.

I am using the following statement:

[php]
if ($url == “”) {
echo “No URL”;
} else {

echo “show an actual link here.”;

}

[/php]

Now when leaving out the URL, it does what its suppose to do “No URL” . But when actually entering in a URL, it is still showing as “No URL” instead of adding the URL to the a href tag and linking URL to the URL that was entered.

What am I not doing correctly for it to show a URL when one was actually entered ?

Am I messing it up at the beginning there with if ($url == “”) { or am I missing something else?

Any help would be appreciated.

(PS: I had to remove the else statement from the script above there, because it thinks I was trying to add a link, and I wasnt and gave me the following message:
[We’re sorry, but you need > 10 posts in order to post links. However, please feel free to include your PHP/HTML/CSS/Javascript code in your post, if you think this will help to describe your problem. ] )

I wasnt posting an actual link, just the script.

You didn’t provide us enough of the script to be able to determine whats happening. If you can show us the rest of the code, we might be able to help. I’ll like to see where you are assigning $url a value.

Thanks for the reply, I got the problem figure out. It was where I thought it was.

this part here:

if ($u..r..l == "") {

Needed to be

if ($rows[u...r...l...] == "") {

after I did that, it worked exactly as I needed it to.

Thats minus the dots there, it wouldnt let me post it because it says “url”, so the forum again thought I was posting links. Such is life.

Sponsor our Newsletter | Privacy Policy | Terms of Service