Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Beginning PHP 5.3
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 19th, 2011, 08:12 AM
Authorized User
Points: 128, Level: 2
Points: 128, Level: 2 Points: 128, Level: 2 Points: 128, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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


IHDRdHHPLTE33dIDATH S
U
(~;IENDB`
I checked my ini file and everything is in order, there is semicolon before the GD2 extension. can anyone help??
Reply With Quote
  #2 (permalink)  
Old December 19th, 2011, 08:25 AM
Authorized User
Points: 128, Level: 2
Points: 128, Level: 2 Points: 128, Level: 2 Points: 128, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2011
Posts: 25
Thanks: 2
Thanked 1 Time in 1 Post
Default

Got it stupid mistake!!!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
drawing lines with a delay the_metro_man PHP How-To 0 December 22nd, 2009 03:59 AM
Drawing Shapes cbulutlar Javascript 2 March 6th, 2006 01: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



All times are GMT -4. The time now is 06:17 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.