Amerika Posted April 21, 2012 Share Posted April 21, 2012 I am unsure where is the problem. Could anyone check it over? Parse error: syntax error, unexpected $end in C:\AppServ\www\jaunumi\config.php on line 584 18156_.php Quote Link to comment https://forums.phpfreaks.com/topic/261381-parse-error-syntax-error/ Share on other sites More sharing options...
MMDE Posted April 21, 2012 Share Posted April 21, 2012 I found the error, but I'm not sure I should share it with you. This is kind of a very good example of what you get when you don't format your code properly. It doesn't seem like the code was written by a person who is very new to programming either. Quote Link to comment https://forums.phpfreaks.com/topic/261381-parse-error-syntax-error/#findComment-1339394 Share on other sites More sharing options...
creata.physics Posted April 21, 2012 Share Posted April 21, 2012 hint: it's between line 555-560. Quote Link to comment https://forums.phpfreaks.com/topic/261381-parse-error-syntax-error/#findComment-1339399 Share on other sites More sharing options...
MMDE Posted April 21, 2012 Share Posted April 21, 2012 I've decided to help you. Here's what you have to do to solve your problem: 1. stop using just <?, use <?php instead. 2. stop using <?php and ?> all the time, but if you do use it, at least keep the indent, so the code is properly formatted. 3. while first step fix one problem, and it will probably point out the second real problem, then the second step would have helped you avoid the first and second problem! If your code is easier to read, it will make your code easier to work with. hint: it's between line 555-560. Are you sure? =P Because I found two other problems, maybe even three. The third doesn't really give any errors though, so I guess it's okay (extra comma at the end of some of the arrays), other programming languages would have complained. If you still can't find the error, I suggest you format your code properly and post it again! Quote Link to comment https://forums.phpfreaks.com/topic/261381-parse-error-syntax-error/#findComment-1339401 Share on other sites More sharing options...
creata.physics Posted April 21, 2012 Share Posted April 21, 2012 ugh, yeah i'm definitely wrong. i'm going to go spot it out now so i can stop feeling like an idiot. edit: took me 3 seconds to establish that the issue is within function textarea() Quote Link to comment https://forums.phpfreaks.com/topic/261381-parse-error-syntax-error/#findComment-1339404 Share on other sites More sharing options...
MMDE Posted April 21, 2012 Share Posted April 21, 2012 ugh, yeah i'm definitely wrong. i'm going to go spot it out now so i can stop feeling like an idiot. edit: took me 3 seconds to establish that the issue is within function textarea() I too thought it was that extra } at first. There are plenty of stuff that is weird in this code. The fact that it says error on line 584, which it did for me as well when I used his code, and it disappeared once I started using <?php instead of just <?, makes me wonder if he is trying to use this on some server that doesn't like it when he just use <?. Yes, indeed the two of these: <?=$name?> doesn't make much sense, but for some weird reason I don't get any error messages on those. What are they supposed to do? o.O If I fix the <? to <?php and comment away line 2-7. It only outputs this: } <style> #quote2 { margin-top:5px; margin-bottom:5px; border:1px solid #81BEF7; background: #f5f5f5; color: #777; -moz-border-radius-bottomleft: 3px; -moz-border-radius-bottomright: 3px; } #quote2 .head { padding:5px; background: #81BEF7; margin:1px; } #quote2 .quote { margin-top:1px; border-top:1px solid #81BEF7; padding:6px; } </style> In firefox I only saw: } Had to look in the source for the rest, as it's styling, but that's the extra } you pointed out! EDIT: Sorry Amerika if we seem mean, but when you give us a code like that to debug, it's not really very pleasant. Quote Link to comment https://forums.phpfreaks.com/topic/261381-parse-error-syntax-error/#findComment-1339409 Share on other sites More sharing options...
kicken Posted April 21, 2012 Share Posted April 21, 2012 Yes, indeed the two of these: <?=$name?> doesn't make much sense, but for some weird reason I don't get any error messages on those. What are they supposed to do? o.O <?= is shorthand for <?php echo, so that statement is essentially: <?php echo $name; ?> The shorthand only works if short tags are enabled though (prior to 5.4 at least) Quote Link to comment https://forums.phpfreaks.com/topic/261381-parse-error-syntax-error/#findComment-1339410 Share on other sites More sharing options...
MMDE Posted April 21, 2012 Share Posted April 21, 2012 Yes, indeed the two of these: <?=$name?> doesn't make much sense, but for some weird reason I don't get any error messages on those. What are they supposed to do? o.O <?= is shorthand for <?php echo, so that statement is essentially: <?php echo $name; ?> The shorthand only works if short tags are enabled though (prior to 5.4 at least) Okay, because they didn't give me any error messages, just thought it was weird, so I didn't think those were the errors. I think the biggest problem was that <? didn't really seem to work as <?php. But I still don't think this is a code that is very easy to read or work with. Quote Link to comment https://forums.phpfreaks.com/topic/261381-parse-error-syntax-error/#findComment-1339415 Share on other sites More sharing options...
Amerika Posted April 21, 2012 Author Share Posted April 21, 2012 my thougts exactly. The code is hard to work with. I got this code from an external source and i was trying to reedit it a bit in order for it to function properly, but yeah it is kinda hard. Im not an very experienced php coder, but im just here to get some tips and help. Quote Link to comment https://forums.phpfreaks.com/topic/261381-parse-error-syntax-error/#findComment-1339421 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.