?
Solved

How to I reference my variables

Posted on 2001-07-30
4
Medium Priority
?
231 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 800 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

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

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

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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 …
Suggested Courses

752 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