Sign in to follow this  
satishssrc

Sending Strings Through Urlencode

Recommended Posts

Hey all,

I am using the data url method of fusion charts to drill down into my chart.

It has been working for the following:

$strlink =urlencode("javaScript:updateProductChart1(".$ors['year2007'].",".$daterange1.",".$date.",".$RegionNumber.",".$Category.");");

 

in this code all parameters I am sending are numerical values. But I want to send a string for eg:

$var = "this is test";

 

$strlink =urlencode("javaScript:updateProductChart1(".$ors['year2007'].",".$daterange1.",".$date.",".$RegionNumber.",".$Category.",".$var.");");

 

can you tell me how to this. My java script function updateProductChart1 is not invoked if I have a string being sent. I need your help guys!!!

 

thank you,

satish

Share this post


Link to post
Share on other sites

Hi Sudipto Choudhury,

 

Is this what you meant.

$strlink =urlencode("javaScript:updateProductChart1(".$ors['year2007'].",".$daterange1." ,".$date.",".$RegionNumber.",".$Category.","&"$var"&");" );

 

 

thanks,

satish

Share this post


Link to post
Share on other sites

Hi Satish,

 

A bit different:

 

$strlink =("javaScript:updateProductChart1(".$ors['year2007'].",".$daterange1." ,".$date.",".$RegionNumber.",".$Category.", '".$var."');" );

 

You do not need to URLEncode if you are using FusionCharts v3.2.

 

In case you are using version earlier to v3.2 and you are using dataXML method, you need to use URLEncode.

Share this post


Link to post
Share on other sites

Hi Satish,

 

A bit different:

 

$strlink =("javaScript:updateProductChart1(".$ors['year2007'].",".$daterange1." ,".$date.",".$RegionNumber.",".$Category.", '".$var."');" );

 

You do not need to URLEncode if you are using FusionCharts v3.2.

 

In case you are using version earlier to v3.2 and you are using dataXML method, you need to use URLEncode.

Share this post


Link to post
Share on other sites

Hey Sudipto ,

I am not sure what you mean by

$strlink =("javaScript:updateProductChart1(".$ors['year2007'].",".$daterange1." ,".$date.",".$RegionNumber.",".$Category.", '".$var."');" );

 

what is ''' and "&quot' you want me to directly key it in the link and call the $strlink in the addChartdata(array,$strlink) ?

It gives me an Invalid XML and my chart is not generated to drill down...:)

 

What should I do?

 

Thanks,

satish

Share this post


Link to post
Share on other sites

Hey Sudipto ,

I am not sure what you mean by

$strlink =("javaScript:updateProductChart1(".$ors['year2007'].",".$daterange1." ,".$date.",".$RegionNumber.",".$Category.", '".$var."');" );

 

what is ''' and "&quot' you want me to directly key it in the link and call the $strlink in the addChartdata(array,$strlink) ?

It gives me an Invalid XML and my chart is not generated to drill down...:)

 

What should I do?

 

Thanks,

satish

Share this post


Link to post
Share on other sites

Hey all,

K now how do i send a variable that has something like $var = C-24.

I tried to do the same as before but no luck..

 

Please let me know this.

 

thanks,

satish

Edited by satishssrc

Share this post


Link to post
Share on other sites

Hi Satish,

 

If you want to send C-24 as a string you have to put it inside quotation $var = "C-24"; and than send it to the function.

 

 

 

Hey all,

K now how do i send a variable that has something like $var = C-24.

I tried to do the same as before but no luck..

 

Please let me know this.

 

thanks,

satish

Share this post


Link to post
Share on other sites

Hey all,

Well I am not able to figure out where I am going wrong

 

$strlink =("javaScript:updateProductChart1(".$ors['year2007'].",".$daterange1." ,".$date.",".$RegionNumber.",".$Category.", '".$var."');" );

seems to be working $var ="this is test";

but wont work if my $var changes to $var = "C-24";

 

I don't know why? The value in $var keeps changing depending on the option selected by the user.

Please help...I need it real quick..

 

Thanks

satish

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