Hello, I am new to PHP.

I have gone so far but need help on this issue.

I have the following statement:

<a href="http://www.facebook.com/pages/<?=$FACEBOOK_NAME?>/<?=$FACEBOOK_ID?>" Target = "blank">

What I would like to do is:

IF <?=$FACEBOOK_ID?> is empty THEN load the following link:

<a href="http://www.facebook.com/<?=$FACEBOOK_NAME?>" Target = "blank">

ELSE load

<a href="http://www.facebook.com/pages/<?=$FACEBOOK_NAME?>/<?=$FACEBOOK_ID?>" Target = "blank">

The reason is to give the option of loading a profile or a page in facebook.

This is probably real simple...thank you for you help.

Thank you again.

    I appreciate the link. ummm I am in the Newbie section for a reason. hehe

    I followed the link looked around...and well I still have no clue. haha

      the first user note has an if\else example.

        Yeah...still lost. I can't see how this relates to if..then..else and links.

          //fill in the blanks

          if(empty($FACEBOOK_ID)){
          //something
          }else{
          //something else
          }
          

            here is what I have:

            if(empty($FACEBOOK_ID)){
            <a href="http://www.facebook.com/<?=$FACEBOOK_NAME?>" Target = "blank">
            }else{
            <a href="http://www.facebook.com/pages/<?=$FACEBOOK_NAME?>/<?=$FACEBOOK_ID?>" Target = "blank">
            }

            <img src="<?=$SITE_PATH?>/images/facebook.jpg" alt="Find us on Facebook" border ="0"/></a>

            The else part works flawlessly....

            <a href="http://www.facebook.com/pages/<?=$FACEBOOK_NAME?> link works

            The first part:

            <a href="http://www.facebook.com/<?=$FACEBOOK_NAME?>" Target = "blank">

            Does not work...strange it creates a link that looks like this:

            http://www.facebook.com/pages/whatever

            also on the page above the link (image) it displays this:

            if(empty($FACEBOOK_ID)){ }else{ }

            I am sorry I am such a newbie...thank you for your help.

              Write a Reply...