Page 1 of 1

Parse Error

Posted: Sun Oct 22, 2006 10:53 pm
by kumarangopi
Burrito | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Code: Select all

<?php
	include('GrowthChart.class.php');

	$patientXData = array(2,  4,  6,  8, 10, 12);
	$patientYData = array(36, 40, 42.2, 44, 45, 45.;

	$xvals = join(',', $patientXData);
	$yvals = join(',', $patientYData);
	
?>
<html>
<head>
	<title>Growth Chart Example</title>
</head>
<body>

	<img src='chart.php'?style=<?= GrowthChart::STYLE_HEAD_AGE; ?>&sex=<?= GrowthChart::SEX_MALE; ?>&maxage=35&xvals=<?= $xvals ?>&yvals=<?= $yvals ?> />

</body>
</html>







Parse error: parse error, unexpected ';', expecting '(' in C:\PHP\php-growth-charts\php-growth-charts\example.php on line 17



Can anyone help me how to go through this error?


Burrito | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Mon Oct 23, 2006 2:32 am
by nickvd
Try changing

Code: Select all

<img src='chart.php'?style=<?= GrowthChart::STYLE_HEAD_AGE; ?>&sex=<?= GrowthChart::SEX_MALE; ?>&maxage=35&xvals=<?= $xvals ?>&yvals=<?= $yvals ?> />
Into

Code: Select all

<img src='chart.php'?style=<?php echo GrowthChart::STYLE_HEAD_AGE; ?>&sex=<?php echo GrowthChart::SEX_MALE; ?>&maxage=35&xvals=<?= $xvals ?>&yvals=<?= $yvals ?> />