• Hello,

    I have a small question

    if I have a text that I added on a page using php, I would like to add a link to it. How can i do it using PHP ?

    <h6>TEST</h6>
    what code should be added ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You want to plant a tag or anchor around the heading, then you can jump to it within the page or from another page with a # in the link name.

    Lets say the page URL place an anchor called “tstplace” around the h6 you would place
    <a id="tstplace" name="tstplace"><h6>TEST</h6></a>
    The id is for HTML5, the name is in case HTML5 is not being used.

    Then when you want to jump about the page, use this:
    <a href="#tstplace">Go to other place</a>

    If you waqnt to load from another page to this location:
    <a href="PageURL#tstplace">Go to other place</a>

    Here is another example:
    https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_a_href_anchor

    If you still need help, paste the php code you’re using that you want to link.

    Thread Starter OsamaNuman

    (@osamanuman)

    thanks for the replies !!

    i managed that by :

    < a href=” destination url “>Test (removing the space before (a))

    and thanks for the anchor code provided! matbe I will use it !! ??

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘add link to a text using php’ is closed to new replies.