mariam Posted June 24, 2011 Share Posted June 24, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/240298-img-src-tag-syntax/ Share on other sites More sharing options...
gristoi Posted June 24, 2011 Share Posted June 24, 2011 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']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/240298-img-src-tag-syntax/#findComment-1234268 Share on other sites More sharing options...
mariam Posted June 24, 2011 Author Share Posted June 24, 2011 the ? and & when encorprated does not plot the graph but display an outline of 400 x 500.. Quote Link to comment https://forums.phpfreaks.com/topic/240298-img-src-tag-syntax/#findComment-1234310 Share on other sites More sharing options...
gristoi Posted June 24, 2011 Share Posted June 24, 2011 paste the http://www.domain.com/jpowered/graph/line-graph.php?data=[urltoDATASOURCE]&config=[urltoCONFIG" directly into your browsers address bar. If you graphs are working correctly then you will see a blank page with a graph on it. what happens when you do this? Quote Link to comment https://forums.phpfreaks.com/topic/240298-img-src-tag-syntax/#findComment-1234315 Share on other sites More sharing options...
mariam Posted June 25, 2011 Author Share Posted June 25, 2011 it opens the page www.domain.com Quote Link to comment https://forums.phpfreaks.com/topic/240298-img-src-tag-syntax/#findComment-1234620 Share on other sites More sharing options...
gristoi Posted June 25, 2011 Share Posted June 25, 2011 By the sound of it your line-graph.php is not returning any data Quote Link to comment https://forums.phpfreaks.com/topic/240298-img-src-tag-syntax/#findComment-1234623 Share on other sites More sharing options...
mariam Posted June 25, 2011 Author Share Posted June 25, 2011 i hav etried re-loading the files... now it only displays the background image fr the graph but no plotting Quote Link to comment https://forums.phpfreaks.com/topic/240298-img-src-tag-syntax/#findComment-1234625 Share on other sites More sharing options...
gristoi Posted June 25, 2011 Share Posted June 25, 2011 as i explained in my last post, you need to look at what data line-graph.php is returning Quote Link to comment https://forums.phpfreaks.com/topic/240298-img-src-tag-syntax/#findComment-1234633 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.