Jump to content

Recommended Posts

i am using "jpowered garphs" to plot graph using values from database...

 

the following script (taken from site) is used calling the required files... but the syntax used s not familiar to us..

 

<img

src="http://www.domain.com/jpowered/graph/line-graph.php?

data=[urltoDATASOURCE]&

config=[urltoCONFIG]"

width="500"

height="400" />

 

this does not display the graph

 

what do the ? and & (in red) indicate??

 

i have interpreted this script as

 

<img src="http://www.icyourheart.webuda.com/jpowered/graph/line-graph.php"

dbinfo="public_html/graphtest/dbinfo.php"

config="http://icyourheart.webuda.com/graphtest/config.htm"

width=500

height=400 />

it displays the img of "http://www.icyourheart.webuda.com/jpowered/graph/line-graph.php" but next lines are not called (i.e

dbinfo="public_html/graphtest/dbinfo.php" and  config="http://icyourheart.webuda.com/graphtest/config.htm"

 

plz help

Link to comment
https://forums.phpfreaks.com/topic/240298-img-src-tag-syntax/
Share on other sites

the image tag is using a $_GET paramater to return the image. because web pages are stateless( the next page does not know the state of the last page) you have to pass variables from page to page to keep a constant state.

using $_GET in php is one method of doing this. It is basically concatenating the variables into the url so that it can be re interpreted by the target url. So basically your script is passing data to  linegraph.php. the ? tells it that you are passing $_GET paramaeters and the & is used to seperate each variable. i.e:

 

<?php  www.mysite.com/page.php?var1=something&var2=somethingelse ?>

and when the other page usese the get function they can re assign the variables:

 

<?php
$var1 = $_GET['var1'];
$var2 = $_GET['var2'];
?>

Link to comment
https://forums.phpfreaks.com/topic/240298-img-src-tag-syntax/#findComment-1234268
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.