php img link

Posted on 2007-10-02
Last Modified: 2013-12-13
I am getting this to show up as a  image, where i want it to be a link than click on it pop in another window. I keep trying but no matter what i do its shows the image.

$window = "'" . $row[0] . "','popUp','width=825,height=625,scrollbars=yes'";
                        if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/images/browse/maps/" . $ID . ".jpg")) {
                            print '<p><a href="javascript:;"><img border="0" src="' . $row[0] . '.jpg" onclick="MM_openBrWindow(' . $window . ')" />View Map</a></p>';

checking link out
Question by:Jiggens
    LVL 10

    Expert Comment

    Not quite sure I understand your question
    LVL 1

    Author Comment

    when i remove the img tag the link pops up with 404 error

    I cant get it to pop the file but the location is there and file is there.

    LVL 10

    Accepted Solution

    Have you tried placing the    onclick="MM_openBrWindow(' . $window . ')"     inside the <a... tag? At the moment, the image is given the popup link, not the actual hyperlink.
    LVL 10

    Expert Comment

    So, you'd need to change:

    print '<p><a href="javascript:;"><img border="0" src="' . $row[0] . '.jpg" onclick="MM_openBrWindow(' . $window . ')" />View Map</a></p>';


    print '<p><a href="#" onclick="MM_openBrWindow(' . $window . ')"><img border="0" src="' . $row[0] . '.jpg"  />View Map</a></p>';

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    A colleague recently asked me about how to give his client a small part of the web site that could be completely under the client's control.  Since I have done this sort of thing before to add emergency banners to a web site, I decided I would creat…
    Part of the Global Positioning System A geocode ( is the major subset of a GPS coordinate (, the other parts being the altitude and t…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    745 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

    16 Experts available now in Live!

    Get 1:1 Help Now