putting link on php page

Discussion in 'PHP' started by greentree, Jun 20, 2008.

  1. #1
    What is the <?php code to put in a php page so that when anyone click on that url, the person would get to that page. I had tried
    <?php $url="index2.php"; ?> but that only showed a dot, not anything to click on or the name of url on the page. I know the <a href=, but I want the <?php language code to list the url on my site. Thanks ahead of time for any help you can offer me.
     
    greentree, Jun 20, 2008 IP
  2. Pradipta saha

    Pradipta saha Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    this code is very easy.you know href is one of way to do this
    <?php
    echo "<a href='pop.php'>click here</a>";
    ?>
     
    Pradipta saha, Jun 20, 2008 IP
  3. greentree

    greentree Active Member

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    86
    #3
    Thank you. I was thinking of something more as if if I am putting in a url to a file in a subfolder, the person would not know the file is in the subfolder when they view the source.
     
    greentree, Jun 20, 2008 IP
  4. sandstorm140

    sandstorm140 Peon

    Messages:
    80
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think you're talking about the include/require function. Which would be:

    <?php
    include('dir/filename.php');
    ?>

    you can also replace "include" with "require".
     
    sandstorm140, Jun 21, 2008 IP