Register | Login | |||||
Main
| Memberlist
| Active users
| ACS
| Commons
| Calendar
| Online users Ranks | FAQ | Color Chart | Photo album | IRC Chat |
| |
0 user currently in Programming. | 3 guests |
Acmlm's Board - I2 Archive - Programming - Wierdest PHP error I've seen @_@ | | | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
User | Post | ||
windwaker Ball and Chain Trooper WHY ALL THE MAYONNAISE HATE Level: 61 Posts: 581/1797 EXP: 1860597 For next: 15999 Since: 03-15-04 Since last post: 4 days Last activity: 6 days |
| ||
require "layout.php"; echo "$top"; if (!$action) $login = "You are not logged in. Username: < < < Password:< < < < if ($action == "login") { $password = md5($password); mysql_connect("localhost", "root", ""); mysql_select_db("news_posts"); $sql = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `password` = '$password' AND `username` = '$username'"),0); if ($sql != 1) echo "Sorry, your username and password couldn't be found in our database"; if ($sql == 1) { setcookie("username", $username, time()+259200); setcookie("password", $password, time()+259200); $login = "Cookie set successfully!"; } echo "$login"; echo "$end"; This has the oddest error I've seen. Parse error : syntax error, unexpected $end in C:\apachefriends\xampp\htdocs\login.php on line 26 , is there anything wrong with my code? (edited by windwaker on 12-10-04 10:55 PM) (edited by windwaker on 12-10-04 10:57 PM) |
|||
SyntaxLegend Double metal axe Level: 25 Posts: 121/222 EXP: 78264 For next: 11356 Since: 04-21-04 From: Australia Since last post: 20 days Last activity: 10 hours |
| ||
first off echo top shouldnt be up there you can echo variables without the quotes eg echo $top."Hello".$bottom; |
|||
windwaker Ball and Chain Trooper WHY ALL THE MAYONNAISE HATE Level: 61 Posts: 589/1797 EXP: 1860597 For next: 15999 Since: 03-15-04 Since last post: 4 days Last activity: 6 days |
| ||
Well, here's what I have now: -- all of the previous code -- echo $top ."< It still echoes the same error . (edited by windwaker on 12-11-04 12:57 AM) |
|||
neotransotaku Baby Mario 戻れたら、 誰も気が付く Level: 87 Posts: 1854/4016 EXP: 6220548 For next: 172226 Since: 03-15-04 From: Outside of Time/Space Since last post: 11 hours Last activity: 1 hour |
| ||
it's because you are missing one more close brace...i suggest in the future to indent your code appropriately... | |||
Gavin Fuzzy Rhinoceruses don't play games. They fucking charge your ass. Level: 43 Posts: 337/799 EXP: 551711 For next: 13335 Since: 03-15-04 From: IL, USA Since last post: 13 hours Last activity: 13 hours |
| ||
Originally posted by windwaker syntax errors i can understand... but using a < font > tag is just disgustingly reprehensible :_;. take, for instance, all of the disgusting Acmlmboard code. chalk full of terrible non-standardized code that makes you want to vomit. don't go down that alleyway WW. alleyways lead to rape. rape isn't good |
|||
Black Lord Level: 34 Posts: 107/453 EXP: 235639 For next: 18012 Since: 03-15-04 From: Nebraska, what's a Nebraska Since last post: 8 days Last activity: 1 day |
| ||
Originally posted by GavinOriginally posted by windwaker But you can't rape the willing Gavin... As neotransotaku said you have two open braces to your one close brace... |
|||
neotransotaku Baby Mario 戻れたら、 誰も気が付く Level: 87 Posts: 1855/4016 EXP: 6220548 For next: 172226 Since: 03-15-04 From: Outside of Time/Space Since last post: 11 hours Last activity: 1 hour |
| ||
Originally posted by Gavin How is using <font> non-standardized? Just because it is depreciated doesn't make it non-standard... not unless you are pushing for CSS to be used... then I can see how using such formatting tags can lead to inconsistencies... |
|||
Gavin Fuzzy Rhinoceruses don't play games. They fucking charge your ass. Level: 43 Posts: 338/799 EXP: 551711 For next: 13335 Since: 03-15-04 From: IL, USA Since last post: 13 hours Last activity: 13 hours |
| ||
Originally posted by neotransotakuOriginally posted by Gavin what? you didnt jump on the new wave of internet savyness and declare war against all deprecated and non-standard web code? you rebel you |
|||
windwaker Ball and Chain Trooper WHY ALL THE MAYONNAISE HATE Level: 61 Posts: 590/1797 EXP: 1860597 For next: 15999 Since: 03-15-04 Since last post: 4 days Last activity: 6 days |
| ||
Lol. Okay, then how do I add a CSS font color? And while I'm asking questions, whenever I do anything in PHP related to cookies, "?" appears on the page . |
|||
Gavin Fuzzy Rhinoceruses don't play games. They fucking charge your ass. Level: 43 Posts: 340/799 EXP: 551711 For next: 13335 Since: 03-15-04 From: IL, USA Since last post: 13 hours Last activity: 13 hours |
| ||
well, what does your code look like? keep in mind that cookies are part of the header information of a page so they have to be set before any html. CSS font (edited by Gavin on 12-11-04 08:53 PM) |
|||
windwaker Ball and Chain Trooper WHY ALL THE MAYONNAISE HATE Level: 61 Posts: 593/1797 EXP: 1860597 For next: 15999 Since: 03-15-04 Since last post: 4 days Last activity: 6 days |
| ||
D'oh , I forgot about that. Now, my code is. . . require "layout.php"; Then I go down to say "if !action, login form appears in $login, if action = login, set some cookies, $login equals 'cookie set', then at the bottom: echo $top.$login". In layout.php, I have: require "function.php"; *if $user = asdf $loggedin = "you are logged in * else *$loggedin = you aren't logged in* $top = " $loggedin"; Aaaand in function.php, I have: $user = $_COOKIE['username']; $pass = $_COOKIE['password']; Pardon my crappy immitation code, I'm just lazy. Edit: nevermind, like Gav said, I was evidently requesting cookie info after the the html started. (edited by windwaker on 12-11-04 09:44 PM) |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
Acmlm's Board - I2 Archive - Programming - Wierdest PHP error I've seen @_@ | | | |