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
Solved

How to I reference my variables

Posted on 2001-07-30
4
227 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cookie not unsetting 7 27
PHP Query return divisible by 3 3 26
TCPDF - Create PDF from Form Values and Link to PDF Download 7 26
AJAX Wordpress Not Reading Variable 2 28
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 …
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
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 …

860 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