473,698 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_conte nts("$URL");
<HTML>
<BODY>
<img src="myscript.p hp?mode=MakeGra phic&data=$RawD ata"
<map name="mymap">
<?php myscript.php?mo de=MakeImageMap ?>
<map>
<BODY>
</HTML>
Jul 17 '05 #1
1 1645
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*****@comcas t.net> napisal w wiadomosci
news:d5******** *************** ***@posting.goo gle.com...
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_conte nts("$URL");
<HTML>
<BODY>
<img src="myscript.p hp?mode=MakeGra phic&data=$RawD ata"
<map name="mymap">
<?php myscript.php?mo de=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
2287
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 the installer itself seems to be buggy -- in my case, no combination of mod_python 3.0.4, 3.1.2b and python 2.2.3, 2.3.3 ever came to completion. rather, the installer would exit -- after an initial declaration of having successfully found python...
2
1628
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 performing as the production database and the other one is the backup. The secondary one is keeping updated via the "Log Shipping" technic.
2
3771
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 applications. Since I wanted to be portable, I installed Apache, MySQL and PHP5 on one of my Windows XP laptops. I'm having problems: First, I can't find a REALLY good editor for php on Windows. If anyone out here knows of a really good editor I would be...
6
5902
by: varlagas | last post by:
We disabled the antivirus software but the problem persists. Any clues? Many thanks in advance! Panagiotis Varlagas ======================================================================= 2005-07-28-10.39.02.015001 Instance:DB2 Node:000 PID:1568(db2syscs.exe) TID:2440 Appid:0A00153A.C90B.050728083720
0
1093
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 are sharing a certain instance between interpreters because its to expensive to instantiate that class every time an interpreter is created. The class is instantiated in the main interpreter (that is always alive) and every time a new interpreter...
7
2669
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 then be drawn on the image (to create a clickable imagemap). The image will then be displayed as part of a webpage. I've included my code snippet below. It doesn't work, and I think I know why - the output on my screen
8
1849
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 ways.... Here comes the snippet (without XML prolog and DOCTYPE declaration): <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt-br" lang="pt-br">
8
2422
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 to log in with their user name and password. Well, instead of adding components to the existing classic ASP web application, we could have just put the extended components into a new web application. But then this would require them to log...
19
248204
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 this data is essential to any developer. This article is a basic tutorial on how to user HTML Forms, the most common method of data collection. Assumptions - Basic HTML knowledge. - Basic PHP knowledge. HTML Forms A common and simple way of...
0
8609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8871
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7738
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.