Hi, I'm having a problem with drawing lines in PHP. When I try it using this code:
PHP Code:
<?php
$myImage = imagecreate( 200, 100 );
$myGray = imagecolorallocate( $myImage, 204, 204, 204 );
$myBlack = imagecolorallocate( $myImage, 0, 0, 0 );
imageline( myImage, 15, 35, 120, 60, $myBlack );
header( "Content-type: image/png" );
imagepng( $myImage );
imagedestroy( $myImage );
?>
What all I get is a blank screen with this on it:
HTML Code:
<br />
<font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Notice: Use of undefined constant myImage - assumed 'myImage' in C:\wamp\www\line.php on line <i>5</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0004</td><td bgcolor='#eeeeec' align='right'>673848</td><td bgcolor='#eeeeec'>{main}( )</td><td title='C:\wamp\www\line.php' bgcolor='#eeeeec'>..\line.php<b>:</b>0</td></tr>
</table></font>
<br />
<font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Warning: imageline() expects parameter 1 to be resource, string given in C:\wamp\www\line.php on line <i>5</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0004</td><td bgcolor='#eeeeec' align='right'>673848</td><td bgcolor='#eeeeec'>{main}( )</td><td title='C:\wamp\www\line.php' bgcolor='#eeeeec'>..\line.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0006</td><td bgcolor='#eeeeec' align='right'>727104</td><td bgcolor='#eeeeec'><a href='http://www.php.net/imageline' target='_new'>imageline</a>
( )</td><td title='C:\wamp\www\line.php' bgcolor='#eeeeec'>..\line.php<b>:</b>5</td></tr>
</table></font>
â°PNG
IHDRÃdùHÃHPLTEÃÃÃÃ33dIDATHâ°ÃÃÂà ùSÃ
UÃ
(~;IEND®B`â
I checked my ini file and everything is in order, there is semicolon before the GD2 extension. can anyone help??