?
Solved

php img link

Posted on 2007-10-02
4
Medium Priority
?
266 Views
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 = "'http://homes.pacificscene.com/popup.php?type=maps&ID=" . $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="http://homes.pacificscene.com/images/browse/maps/' . $row[0] . '.jpg" onclick="MM_openBrWindow(' . $window . ')" />View Map</a></p>';
                        }

checking link out    http://homes.pacificscene.com/browse/community.php?ID=9
0
Comment
Question by:Jiggens
  • 3
4 Comments
 
LVL 10

Expert Comment

by:Phatzer
ID: 20002416
Not quite sure I understand your question
0
 
LVL 1

Author Comment

by:Jiggens
ID: 20002621
when i remove the img tag the link pops up with 404 error

http://homes.pacificscene.com/browse/javascript%20onclick=


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

0
 
LVL 10

Accepted Solution

by:
Phatzer earned 2000 total points
ID: 20002642
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.
0
 
LVL 10

Expert Comment

by:Phatzer
ID: 20002659
So, you'd need to change:

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

To:

print '<p><a href="#" onclick="MM_openBrWindow(' . $window . ')"><img border="0" src="http://homes.pacificscene.com/images/browse/maps/' . $row[0] . '.jpg"  />View Map</a></p>';
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This article discusses how to implement server side field validation and display customized error messages to the client.
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…
Suggested Courses
Course of the Month14 days, 8 hours left to enroll

840 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