Opening new link

Discussion in 'PHP' started by bytestor, Aug 27, 2007.

  1. #1
    Hi,
    I am new to PHP programming,
    I would like to know how to do this,

    <?php echo $custom_7; ?> ------- function accepts a new external weblink and I want that link to be opened when it is posted in the website.

    If get like www.yahoo.com for the function <?php echo $custom_7; ?> and give the function like,

    <a href="<?php echo $custom_7; ?>">Visit external Website</a>

    I get like www.mydomain.com/www.yahoo.com saying page cannot be displayed.

    I would like to know how to just open only www.yahoo.com in a new page.

    How can I do it.
    Can you please help me guy!!
     
    bytestor, Aug 27, 2007 IP
  2. crazyryan

    crazyryan Well-Known Member

    Messages:
    3,087
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    175
    #2
    I'm guessing your link excludes the http:// part, you could either do:
    <a href="http://<?php echo $custom_7; ?>">Visit external Website</a>

    Or if you have $custom_1, $custom_2 and so on, you could check if http:// exists, and if not add it to $custom_*
     
    crazyryan, Aug 27, 2007 IP
  3. bytestor

    bytestor Peon

    Messages:
    409
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi thanks for that, its working fine now with the
    <a href="http://<?php echo $custom_7; ?>">Visit external Website</a>

    Thanks you.
     
    bytestor, Aug 27, 2007 IP