Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Beginning PHP 5.3
|
BOOK: Beginning PHP 5.3
This is the forum to discuss the Wrox book Beginning PHP 5.3 by Matt Doyle; ISBN: 978-0-470-41396-8
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP 5.3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 19th, 2011, 09:12 AM
Authorized User
 
Join Date: Feb 2011
Posts: 25
Thanks: 2
Thanked 1 Time in 1 Post
Default Drawing lines and shapes

Hi, I'm having a problem with drawing lines in PHP. When I try it using this code:
PHP Code:
<?php
$myImage 
imagecreate200100 );
$myGray imagecolorallocate$myImage204204204 );
$myBlack imagecolorallocate$myImage00);
imagelinemyImage153512060$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??
 
Old December 19th, 2011, 09:25 AM
Authorized User
 
Join Date: Feb 2011
Posts: 25
Thanks: 2
Thanked 1 Time in 1 Post
Default

Got it stupid mistake!!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
drawing lines with a delay the_metro_man PHP How-To 0 December 22nd, 2009 04:59 AM
Drawing Shapes cbulutlar Javascript 2 March 6th, 2006 02:25 PM
drawing shapes (advanced) FFinn Javascript How-To 1 September 28th, 2005 10:19 AM
Dragging shapes rajanikrishna Pro VB 6 0 October 19th, 2004 08:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.