Jump to content

ajax and php


kman

Recommended Posts

Hi folks a bit of a puzzler here.

I want to create a web page that will allow me to dynamically update two different graphs.

I can do it with one graph no problems.

I have a basic html page with the graphs that are placed within divs and  within each div an image tag is given an id. On clicking the update button a call is made to an ajax function in a js file and this in turn calls a php file that has an include line that calls an another php file. The second file(the include files creates the graph. I then create a new random name for the graph created and then create a small xml section that passes back the name of the new graph to the js file which in turn passes it back to the img tag. However for 2 or more graphs to work i need to be able to send the new name back to the div that created it.

Ive included the files required and i am using jpgraph. Would gladly appreciate any help

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/150501-ajax-and-php/
Share on other sites

Sorry i was experimenting with sessions to see if i coudl get it woring

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>jpgraph ajax</title>
    <script type="text/javascript" src="quickstart.js"></script>
  </head>
  <body>
    <div id="pic1">
    <img src="x01148567.jpg" id="<pic1" />
    </div>
<input type="button" value="Chart 1" onclick="update_jpgraph();" />
<div>
  </body>
</html>

there is the proper code for the htm file the others are right,

Link to comment
https://forums.phpfreaks.com/topic/150501-ajax-and-php/#findComment-790797
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.