d_goodgame Report post Posted July 12, 2015 <?php include("/fusioncharts.php"); ?> <HTML> <HEAD> <?php echo "in head"; ?> <TITLE>Simple Chart Example</TITLE> <?php echo " in head2"; ?> </HEAD> <BODY> <?php echo " in body"; ?> <?php echo " create string"; //Create an XML data document in a string variable $strXML = ""; $strXML .= "<graph caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' decimalPrecision='0' formatNumberScale='0'>"; $strXML .= "<set name='Jan' value='462' color='AFD8F8' />"; $strXML .= "<set name='Feb' value='857' color='F6BD0F' />"; $strXML .= "<set name='Mar' value='671' color='8BBA00' />"; $strXML .= "<set name='Apr' value='494' color='FF8E46' />"; $strXML .= "<set name='May' value='761' color='008E8E' />"; $strXML .= "<set name='Jun' value='960' color='D64646' />"; $strXML .= "<set name='Jul' value='629' color='8E468E' />"; $strXML .= "<set name='Aug' value='622' color='588526' />"; $strXML .= "<set name='Sep' value='376' color='B3AA00' />"; $strXML .= "<set name='Oct' value='494' color='008ED6' />"; $strXML .= "<set name='Nov' value='761' color='9D080D' />"; $strXML .= "<set name='Dec' value='960' color='A186BE' />"; $strXML .= "</graph>"; echo "string done"; //Create the chart - Column 3D Chart with data from strXML variable using dataXML method echo renderChartHTML("/FusionCharts/Column3D.swf", "", $strXML, "myNext", 600, 300); ?> </BODY> </HTML> I'm new to Wordpress, and I'm trying to get FusionCharts to work on it. I've followed lots of examples in this forum, but can't seem to get anything to show up. I just don't feel like the Include ("fusioncharts.php"); is really loading. The code I have is above, it is for the following site: http://discounthuntgear.com/tryme.php I also have an image of the "File Manager"...the fusioncharts.php file is in the same folder as the tryme.php that is trying to call it. Any advise would be much appreciated!!! Share this post Link to post Share on other sites
Vishalika Report post Posted July 20, 2015 Hi, Welcome to FusionCharts Forum. It seems that you are using older version of FusionCharts and its PHP wrapper. Please check and confirm with the latest version. Please refer the latest documentation for implementation: http://www.fusioncharts.com/dev/usage-guide/using-with-server-side-languages/php/introduction.html You can refer the following sample using XML: 1. Using Single series data: https://www.dropbox.com/s/4g2gur3f3vdeb67/php_samplewith_%20XML.rar?dl=0 2. Using Multiple series data: https://www.dropbox.com/s/s7hq6bjqxk5x6ar/php_multiseries_%20XML.rar?dl=0 Hope this helps. Share this post Link to post Share on other sites
d_goodgame Report post Posted July 21, 2015 Thanks Vishalika, I did have some out of date files. I updated to the ones in the link you provided. I have the php wrapper file that I downloaded in the fusioncharts folder I created. However, as soon as the code hits the "include("fusioncharts/fusioncharts.php"); statement..it dies. If I comment it out, it runs all the way through till it gets to the render portion (and then doesn't know what to do with it, as we'd expect with the wrapper file in there). Do you know of something that would cause it to just stop as soon as it tries to include that file? http://discounthuntgear.com/tryme.php Thanks again. Share this post Link to post Share on other sites
Swarnam Report post Posted July 21, 2015 Hi, Can you please try using require() to include the *.php file or try uploading the *.php within the server through FTP? For more information, please refer the following link:http://wp.tutsplus.com/tutorials/creative-coding/how-to-include-and-require-files-and-templates-in-wordpress/ http://wordpress.org/support/topic/how-to-upload-php-file Hope this helps. Share this post Link to post Share on other sites
d_goodgame Report post Posted July 21, 2015 Hi, I went into the fusioncharts.php file and enabled some error reporting. Here's what it's spitting out. "PHP Parse error: syntax error, unexpected '[' in /home6/discowo3/public_html/fusioncharts/fusioncharts.php on line 5 Share this post Link to post Share on other sites
d_goodgame Report post Posted July 22, 2015 Corrected. The Parse error was due to the platform I'm on running PHP 5.2, and the wrapper was for 5.4. I was able to find a compatible version of the wrapper, and now it works just fine. The other piece that helped it was changing the include statement to --> include($_SERVER['DOCUMENT_ROOT']."/fusioncharts/fusioncharts.php"); I'm not sure if it was just a CPanel problem...but the document root function was needed to get it to the correct file. Thanks again for ya'lls help, and getting me pointed in the right direction. I've been using FusionCharts for years now (with ASP.NET)...this is my first venture in doing it in PHP...so it took me a while to get it going. Couldn't have done it without ya'lls help...Thanks again. Share this post Link to post Share on other sites
Swarnam Report post Posted July 23, 2015 Hi, Glad to know your issues has been resolved. You can get back to us, if you require nay further information. Share this post Link to post Share on other sites