Need help to write a URL link

Discussion in 'PHP' started by eddiemoth, Oct 21, 2008.

  1. #1
    I like to add a text link:

    Click here to add video

    to a php block. Can someone help me to convert this into a simple php script please?

    Thanks in advance.
     
    eddiemoth, Oct 21, 2008 IP
  2. Kyosys

    Kyosys Peon

    Messages:
    226
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    uh... what?
     
    Kyosys, Oct 22, 2008 IP
  3. Limotek

    Limotek Peon

    Messages:
    165
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Two ways to do it:

    Best way it to just add it to the HTML part between the PHP code. So if you wanted to add it as part of an IF statement, you could do something like:

    <?php if(condition) { ?>
    <a href="http://www.angkorthom.us/index.php?name=DF_Multimedia&page=vidadd">Click here to add video</a>
    <?php } ?>
    PHP:
    The alternative is the echo the link in PHP (not recommended as it is slower and harder to read the code but would look something like:

    <?php if(condition) {
    echo '<a href="http://www.angkorthom.us/index.php?name=DF_Multimedia&page=vidadd">Click here to add video</a>';
    } ?>
    PHP:
     
    Limotek, Oct 22, 2008 IP