Jump to content


Photo

What is wrong with this code?


  • Please log in to reply
3 replies to this topic

#1 Elusid

Elusid
  • Members
  • PipPipPip
  • Advanced Member
  • 38 posts

Posted 28 July 2006 - 10:19 PM

Ok so I have this code bellow and I am wondering what is wrong with it to cause this error


Parse error: parse error, unexpected '{' in /home/www/flamelicker.com/newsite/uploads/submit/appsubmission.php on line 20

<?php 
 $dir = 'pending/apps/' . date('l \\t\h\e jS \of F Y g:i:s a').'/'; 
mkdir($dir);


 $file1 = $dir.basename($_FILES['snapshot']['name']); 
 if (move_uploaded_file($_FILES['snapshot']['tmp_name'], $file1))

 $file2 = $dir.basename($_FILES['userfile']['name']); 
 if (move_uploaded_file($_FILES['userfile']['tmp_name'], $file2))

 $comments = $_POST['comments']; 
 $commentsfile = fopen($dir . 'comments.txt','a+'); 

  
      
           {if ((filesize($file1) <= 153600) && (filesize($file2) <= 26214400) && 

(fwrite($commentsfile,$comments)) 

{echo 'All your information has been uploaded successfully. One of our staff members will 

look it over and if it passes our inspection, it will be on as soon as possible. Thank 

you.';
}
} else 
{ 
echo 'Something went wrong during the upload please go to our contact page and tell us 

what happened.'; 
           unlink($file1); 
           unlink($file2);
}

 ?> 


#2 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 28 July 2006 - 10:20 PM

}
} else 
{

change that part to
}else {
// whatever

}

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 28 July 2006 - 10:21 PM

<?php 
 $dir = 'pending/apps/' . date('l \\t\h\e jS \of F Y g:i:s a').'/'; 
mkdir($dir);


 $file1 = $dir.basename($_FILES['snapshot']['name']); 
 if (move_uploaded_file($_FILES['snapshot']['tmp_name'], $file1))

 $file2 = $dir.basename($_FILES['userfile']['name']); 
 if (move_uploaded_file($_FILES['userfile']['tmp_name'], $file2))

 $comments = $_POST['comments']; 
 $commentsfile = fopen($dir . 'comments.txt','a+'); 

  
      
           {if ((filesize($file1) <= 153600) && (filesize($file2) <= 26214400) && 

(fwrite($commentsfile,$comments)) 

{echo 'All your information has been uploaded successfully. One of our staff members will 

look it over and if it passes our inspection, it will be on as soon as possible. Thank 

you.';
}
} else 
{ 
echo 'Something went wrong during the upload please go to our contact page and tell us 

what happened.'; 
           unlink($file1); 
           unlink($file2);
}

 ?>

Your really screwing yourself over, ALWAYS put the
if (whatever) {
} always put the brackets.  Your going to have to reformat the whole thing.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 Elusid

Elusid
  • Members
  • PipPipPip
  • Advanced Member
  • 38 posts

Posted 28 July 2006 - 11:14 PM

<body bgcolor='000000' text='ffffff' link='880000' vlink='880000' alink='880000'>
<?php 
 $dir = 'pending/apps/' . date('l \\t\h\e jS \of F Y g:i:s a').'/'; 
mkdir($dir);


 $file1 = $dir.basename($_FILES['snapshot']['name']); 
 $file2 = $dir.basename($_FILES['userfile']['name']); 

 $comments = $_POST['comments']; 
 $commentsfile = fopen($dir . 'comments.txt','a+'); 

 if ((move_uploaded_file($_FILES['snapshot']['tmp_name'], $file1)) && 

($_FILES['userfile']['tmp_name'], $file2)))
  
      {
           if ((filesize($file1) <= 153600) && (filesize($file2) <= 26214400) && 

(fwrite($commentsfile,$comments)) {echo 'All your information has been uploaded 

successfully. One of our staff members will look it over and if it passes our inspection, 

it will be on as soon as possible. Thank you.';}
} else {
echo 'Something went wrong during the upload please go to our contact page and tell us 

what happened.'; 
           unlink($file1); 
           unlink($file2);
}

 ?> 
</body>


is that any better? I really am a noob at php and tried to combine scripts into one. I guess it didn't work out so welll hugh :P




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users