Solved

How to I reference my variables

Posted on 2001-07-30
4
224 Views
Last Modified: 2006-11-17
I'm using gd functions to combine a map and a square which marks a grid reference on the map.  Here's the code (it's the entire file map3.php):

<?php
Header("Content-type: image/jpeg");
$image= ImageCreateFromJPEG("images/map2.jpg");
$icon = ImageCreateFromPNG("images/square.PNG");
$trans = ImageColorAt($icon, 30,30);
ImageColorTransparent($icon, $trans);
$width = ImageSX($icon);
$height = ImageSY($icon);

ImageCopyResized($image,$icon, $x_coord,$y_coord,0,0,$width,$height,$width,$height);
ImageJPEG($image);
ImageDestroy($image);
?>

I'm accessing it from a link as follows:

<A href='../map3.php?x_coord=760&y_coord=189'>V33</A>

The problem is that I have very little control over the result because it is just an image, no html.  I want, for instance, to be able to add a caption to the window title bar, add more html to the result, scroll to where the square appears, add a close button inside the window, remove the margins, but I can't do any of these things.  I've tried using an html file which includes the image tag <img src="map3.php border="0"> but it's not picking up the coordinates which position the square.  

I've also tried using window.open and window.showmodaldialog.  These give me greater control but I cannot, for instance, caption the window or add a close button or scroll to where the square appears.

If anybody can help I'd be very grateful.
0
Comment
Question by:maryelizabeth
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
rick2001 earned 200 total points
ID: 6334215
How about this :

link to the new window with :

<a onClick="w=window.open('imgload.php','imgload','scrollbars=no,width=760,height=189')">V33</a>


and have a php script that loads the image, provides a close button and removes margins called imgload.php :

<html>
<head>
<title>Your caption</title>
</head>
<body TOPMARGIN="0" LEFTMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">
<img src='../map3.php?x_coord=760&y_coord=189'>
<p>Click <a onClick='self.close()'>here</a> to close this window.</p>
</body>
</html>

Hope this helps,

Richard.
0
 
LVL 8

Expert Comment

by:us111
ID: 6336943
why not this ?
<body>
<img src="../map3.php?x_coord=760&y_coord=189">
</body>
0
 
LVL 8

Expert Comment

by:us111
ID: 6336944
oops  sorry rick2001, same as you
0
 

Author Comment

by:maryelizabeth
ID: 6343878
Brilliant rick2001 - that's done the trick!

Thanks
0

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses how to create an extensible mechanism for linked drop downs.
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…

707 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

17 Experts available now in Live!

Get 1:1 Help Now