MDanz Posted February 18, 2010 Share Posted February 18, 2010 Parse error: syntax error, unexpected '}' , on the line with the first for loop. if($screen_resolution =="1024x768"){ for($col = 0; $col < 9; $col++) } elseif($screen_resolution =="1440x900"){ for($col = 0; $col < 14; $col++) } Quote Link to comment Share on other sites More sharing options...
schilly Posted February 18, 2010 Share Posted February 18, 2010 is there a reason you're doing nothing with those for loops? i'm pretty sure for loops require {} Quote Link to comment Share on other sites More sharing options...
MDanz Posted February 18, 2010 Author Share Posted February 18, 2010 this would be easy.. but i don't know where the brackets end, so i put the if statement just around the start of the for loop and the for loop brackets outside the if statements. Is there a program that can contract brackets in php code? Quote Link to comment Share on other sites More sharing options...
GKWelding Posted February 18, 2010 Share Posted February 18, 2010 Random code, the sane way of doing what your code does above is the following. if($screen_resolution =="1024x768") { $col = 8; }else if($screen_resolution =="1440x900") { $col = 13; } Quote Link to comment Share on other sites More sharing options...
GKWelding Posted February 18, 2010 Share Posted February 18, 2010 ok, have just read your reply. I get what you're trying to do, but this is the completely wrong way to go about it. You should do the following. if($screen_resolution =="1024x768") { $max = 9; }else if($screen_resolution =="1440x900") { $max = 14; } for($col = 0; $col < $max; $col++) { // code in your for loop... } Quote Link to comment Share on other sites More sharing options...
MDanz Posted February 18, 2010 Author Share Posted February 18, 2010 thx, this should do it.. Quote Link to comment Share on other sites More sharing options...
MDanz Posted February 18, 2010 Author Share Posted February 18, 2010 nvm Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.