PHP urlize

Posted on 2007-10-16
Last Modified: 2013-11-13
Is there a way to change this HTML statement into a PHP statement -

<a href="jinzora_12-17/index.php">Search the Database </a>

maybe aurlize statement or something ?
Question by:mhoggatt1
    LVL 24

    Expert Comment

    I am not sure what you mean. If you simply want to print that string via a PHP script, you can use:

     echo '<a href="jinzora_12-17/index.php">Search the Database </a>';

    If you mean something different, can you provide more details?
    LVL 17

    Expert Comment

    $url = "<a href=\"jinzora_12-17/index.php\">Search the Database </a>";

    echo  $url;

    Author Comment

    Thanks for the replies. Let me check it and see if it's what I'm looking for.

    LVL 1

    Expert Comment

    if you mean to show the same line of code of HTML into PHP THEN

    html code : <a href="jinzora_12-17/index.php">Search the Database </a>

    in PHP : print "<a href=\"jinzora_12-17/index.php\">Search the Database </a>";

    Is it your solution . Please let me inform otherwise we will tell you further . please explain it :)

    Try it and All the best


    Author Comment

    Ok I'm back at my desk now so Ill try these out this afternoon.


    Author Comment

    Is there a way to disable the View Source Code for the browser ? I don't want the href to show up in the source code. I believe the hacker is using it to break into my jinzora directory. That's why I'd like to find a way to hide the link or have some other way to use a hyperlink that doesn't show up. Any ideas ?

    LVL 24

    Accepted Solution

    If you want the hyperlink to be useful, it will eventually show up in the browser. You can encode it, but encoding can be reversed.

    However, if you are trying to redirect a user to a different site, and don't want the site to show up as a link on your page, you can do something like this:

    <a href="">Go to link 123</a>

    Then in your redirect.php script, you will have a way to match linkid #123 to an actual link, and use

     header("Location: xxx");

    to redirect the user to that location. If you will simply be linking to locations in your site, however, there will not be a way to mask the URL in such a way that it cannot be revealed or discovered eventually.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Suggested Solutions

    Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
    Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now