Sign in to follow this  
rmortensen

How to pass query string variables to PHP using setDataURL

Recommended Posts

I have an HTML page that calls a PHP script that reads from MySQL, formats the XML and uses echo to return the XML. All works fine if I hard code the URL but I want to pass variables to the PHP script from the Query String

 

 

 

My Code:

 

 

 

var client = qsParm['client'];

 

var site = qsParm['site'];

 

var region = qsParm['region'];

 

var calc = qsParm['calc'];

 

var URL = "http://www.marvelit.com/securitas/turnover/turnover.php?client=" + client + "&region=" + region + "&site=" + site + "&calc=" + calc;

 

 

 

 

 

var myChart = new FusionCharts("http://www.marvelit.com/fusion/charts/AngularGauge.swf", "myChartId", "300", "200", "1", "0");

 

myChart.setDataURL(URL);

 

myChart.render("chartdiv");

 

 

 

The URL gets built properly - but I can not get it to successfully pass to the PHP script. I used the First Chart as an example.

 

 

 

This seems like a basic process - but I can not get it to work. I have tried escape(URL) to encode - but the myChart.setDataURL(URL) does not pass the URL.

 

If I use myChart.setDataURL("http://www.marvelit.com/securitas/turnover/turnover.php?client=") it works but if myChart.setDataURL("http://www.marvelit.com/securitas/turnover/turnover.php?client="+client) does not work

 

 

 

I have gone over all the documentation and these forums and have not had any success finding an answer

Edited by Guest

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this