473,394 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Mixing HTML PHP and sharing Data between Scripts

I tried searching first, but couldn't find an answer

My first shot at PHP (what a cool language!)

Wrote a quick script to query a server for xml data and plot it as
points on a map

Easy......, but then I wanted to take that same data set and create an
IMAGE MAP in HTML via PHP so I could click on each data point

It seems that imagepng won't work surrounded by HTML in the same code

my work-around was to basically query the server once to create the
plotted image, and then query the server again in a separate script to
create the image map

while this works, I am querying the server twice for the same data
since I can't figure out how to share thte data with the script that
creates the actual image and the script that creates the html image
map

here is sort of kind of what I would like to do....

$URL = 'http://blahblahblah';
$RawData = @file_get_contents("$URL");
<HTML>
<BODY>
<img src="myscript.php?mode=MakeGraphic&data=$RawData"
<map name="mymap">
<?php myscript.php?mode=MakeImageMap ?>
<map>
<BODY>
</HTML>
Jul 17 '05 #1
1 1624
If the number of points is small you can pass them to the image generating
script through the URL. You can also use a session variable to hold the
data, which is somewhat tricky because there're race hazards to consider.
Unless the performance is unacceptable, I would stick with the solution you
have now. The first query would probably be cached by your db server, so the
second query isn't as expensive as you think.

Uzytkownik "Steve W" <za*****@comcast.net> napisal w wiadomosci
news:d5**************************@posting.google.c om...
I tried searching first, but couldn't find an answer

My first shot at PHP (what a cool language!)

Wrote a quick script to query a server for xml data and plot it as
points on a map

Easy......, but then I wanted to take that same data set and create an
IMAGE MAP in HTML via PHP so I could click on each data point

It seems that imagepng won't work surrounded by HTML in the same code

my work-around was to basically query the server once to create the
plotted image, and then query the server again in a separate script to
create the image map

while this works, I am querying the server twice for the same data
since I can't figure out how to share thte data with the script that
creates the actual image and the script that creates the html image
map

here is sort of kind of what I would like to do....

$URL = 'http://blahblahblah';
$RawData = @file_get_contents("$URL");
<HTML>
<BODY>
<img src="myscript.php?mode=MakeGraphic&data=$RawData"
<map name="mymap">
<?php myscript.php?mode=MakeImageMap ?>
<map>
<BODY>
</HTML>

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: wolf | last post by:
i would like to briefly share my experiences with installing mod_python on a w2000 box. i must say that i believe the installation process to be unnecessarily complicated by the simple fact that...
2
by: Leonardo C | last post by:
Hi: I'm trying to setup a MS Cluster but I don't know if it is feasible to configure it in the way I think. I have two machines with win2k server and MSSQL-2000 one of them is currently...
2
by: meburke | last post by:
I've written quite a bit of early php code, but nothing really web and database-specific (more like administrative and maintenance stuff for LINUX), but now I need to develop some serious web...
6
by: varlagas | last post by:
We disabled the antivirus software but the problem persists. Any clues? Many thanks in advance! Panagiotis Varlagas ======================================================================= ...
0
by: gabriel.becedillas | last post by:
Hi, At the company I work for we've embedded Python 2.4.1 in a C++ application. We execute multiple scripts concurrenlty, each one in its own interpreter (created using Py_NewInterpreter()). We...
7
by: Ubantu Rococo | last post by:
Hi all, Sorry for this stupid question, but I am having trouble mixing imagecopy etc. with HTML. What I am trying to do is copy an image, and then obtain co-ordinates from a database which will...
8
by: brasilino | last post by:
Hi Folks: I'm trying to make a function from a inline script, which is called by <body'onload' event, calling an function in a external script, with no success. I'm using XHTML. I've tried many...
8
by: antonyliu2002 | last post by:
We are extending a web application written in classic ASP long time ago. We will add more components to this web application in ASP.NET 2.0. To use the web application, our web users will have...
19
Atli
by: Atli | last post by:
Introduction At some point, all web developers will need to collect data from their users. In a dynamic web page, everything revolves around the users input, so knowing how to ask for and collect...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.