Solved

How to I reference my variables

Posted on 2001-07-30
4
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…

749 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