1
happierr
PHP in a block, not working...
  • 2005/3/23 20:32

  • happierr

  • Just popping in

  • Posts: 26

  • Since: 2004/8/26


I have a php app that displays a bar chart from the a database.

Here is the code for it...

require_once('/var/www/html/qap/testapp/Connections/TestDirector.php'); ?>
include_once('/var/www/html/qap/testapp/includes/MXCharts/mx_charts.inc.php'); ?>
mysql_select_db
($database_TestDirector$TestDirector);
$query_Recordset1 "SELECT TEST.TS_STATUS, Count(TEST.TS_SUBJECT) AS CountOfTS_SUBJECT, TEST.TS_RESPONSIBLE FROM TEST GROUP BY TEST.TS_STATUS, TEST.TS_RESPONSIBLE";
$Recordset1 mysql_query($query_Recordset1$TestDirector) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);

$Chart_1 = new MX_Chart();
     
$Chart_1->setRelativePath("../../testapp/");
     
$Chart_1->setChartType("Bar"500300);
     
$Chart_1->setDataRange($Recordset1"TS_RESPONSIBLE""CountOfTS_SUBJECT""Normal""");
     
$Chart_1->setSort("None""ASC");
     
$Chart_1->setChartTitle("Test Case Writing");
?>

echo $Chart_1->getImage();
?>

mysql_free_result($Recordset1);
?>


Now, the chart shows up if you just load the php page alone, but it will not show up if you take the code and place it in a block..

All the blocj has in it (When I do a source on the preview) is

<html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><meta http-equiv="content-language" content="en" /><title>e-Secureity ::: QA Portal :::title><link rel="stylesheet" type="text/css" media="all" href="http://172.16.0.101/qap/themes/GrayMeetsPurple/style.css" />head><body><table><tr><th>1234th>tr><tr><td>td>tr>table>body>html>


Anyone have a tought on a solution for this... thanks..

2
m0nty
Re: PHP in a block, not working...
  • 2005/3/23 20:54

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


make sure php is selected in the block type selection box..

also there's no need to include the tags >

3
happierr
Re: PHP in a block, not working...
  • 2005/3/23 20:56

  • happierr

  • Just popping in

  • Posts: 26

  • Since: 2004/8/26


Okay, php is set for the block, i will give the

4
happierr
Re: PHP in a block, not working...
  • 2005/3/23 21:09

  • happierr

  • Just popping in

  • Posts: 26

  • Since: 2004/8/26


Worked! Thanks!

Login

Who's Online

279 user(s) are online (218 user(s) are browsing Support Forums)


Members: 0


Guests: 279


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits