Parse Error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kumarangopi
Forum Newbie
Posts: 10
Joined: Wed Oct 18, 2006 7:43 am

Parse Error

Post 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]
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post 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 ?> />
Post Reply