PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > The PowWeb Platform > PHP
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Closed Thread
 
Thread Tools
Old 6-15-08, 01:48 AM   #1
rfrank5356
Registered
 
Join Date: Jan 2008
Location: Califoria, USA
Posts: 2
Reputation: 0
PHP syntax - please help !!

Hi

The following script retiurns an error -

PHP Parse error: syntax error, unexpected $end in /hermes/web##/b##/pow.username/htdocs/AerialPoolSurvey/phptest/RotateOnServerScript.php on line 60

here is the script - I cannot see the error !
PHP Code:
<?php 


// open this directory 
'$myDirectory = opendir("/htdocs/AerialPoolSurvey/phptest/");
$row = 1;
$handle = fopen (”picture.csv”,”r”);
//$Logfile = fopen (”ErrorLog.txt”,”a”);


// get the position of the flight direction and the file name



$label = fgetcsv ($handle, 2000, ",");
$numberoffields = count ($label);

for ($c=0; $c < $numberoffields; $c++){
                                 $labelField = $label($c);
                                if ($labelfield  = "Heading") {
                                     $Heading = $c;
                                }
                                if ($labelfield = "Original") {
                                $Original = $c;
                                }
}
 
//now read each line and determine if the image needs to be rotated

while ($dataline = fgetcsv ($handle, 2000, “,”)) {

            If ($dataline($heading) < 180){
                 // rotate the image 
                 // degrees to rotate the image (counter clockwise)
                 // if the resulting image is not rectangular..
                 // .. what colour will the uncovered bits be?

                 $angle = 180.0;
                 $bgColour = 0xFFFFFF; // red

                 // load the original image from the file
                 $filename = $dataline($Original) ;
                 $orriginalimage = imagecreatefromjpeg($fileName);

                 // rotate the image by $angle degrees

                 $rotatedimage = imagerotate($originalimage, $angle, $bgColour);

                 // Save the image back to disk
                 imagejpeg ($rotatedimage , $filename,$quality = 100);
                 Imagedestroy ($rotatedImage);
                 Imagedestroy ($originalImage);
                 fclose ($handle);
                
            }
}
?>

Last edited by IanS; 6-15-08 at 02:56 AM.. Reason: Added php tags and removed sensitive info
rfrank5356 is offline  
Old 6-15-08, 08:46 AM   #2
entrecon
Custom User Title
 
entrecon's Avatar
 
Join Date: Aug 2006
Location: Michigan
Posts: 2,669
Reputation: 337
The single quote on this line:
PHP Code:
'$myDirectory = opendir("/htdocs/AerialPoolSurvey/phptest/"); 
doesn't look right.
__________________
________________________________
Find me on twitter: @entrecon
entrecon is offline  
Old 6-15-08, 06:14 PM   #3
satis
 
satis's Avatar
 
Join Date: Oct 2002
Location: Dallas
Posts: 2,914
Reputation: 311
yea, that's definitely a problem. Nothing else really jumped out at me.

What do you use to write your scripts in? I use notepad++ which supports context highlighting. When you forget to close (or open) a quote or something, the highlighting makes it a lot easier to find. Linkage: http://notepad-plus.sourceforge.net/uk/site.htm
__________________
Satis Clankiller
Clankiller.com Forums
Clankiller.com
PlasmaSky.com
satis is offline  
Closed Thread

Thread Tools

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

Forum Jump


All times are GMT -4. The time now is 11:57 PM.


Contents ©PowWeb, Inc. ~ vBulletin, Copyright © 2000-2007 Jelsoft Enterprises Limited.