[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to I reference my variables

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
This article discusses how to implement server side field validation and display customized error messages to the client.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses
Course of the Month19 days, 23 hours left to enroll

873 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