ignasiux Posted September 19, 2012 Share Posted September 19, 2012 Hello. I am having 1 problem. Parse error: syntax error, unexpected T_EXIT <?phpif (!defined('SYS_STARTED')) die('Security activated');if (isset($_POST['server_information'])) { save_input_values($_POST); $post_data = do_request($_POST, true, ''); if (!$post_data) set_msg('Būtina u?pildyti visus laukelius', 'error', $config['home_url'] . '/go/control#response'); if (strlen($post_data['title']) > 40) set_msg('Serverio pavadinimas negali būti ilgesnis, nei 40 simbolių', 'error', $config['home_url'] . '/go/control#response'); if (!preg_match("/^[A-Za-z0-9.,-_* ]+$/", $post_data['title'])) set_msg('Blogai sudarytas serverio pavadinimas', 'error', $config['home_url'] . '/go/control#response'); if (!preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $post_data['web_url'])) set_msg('Blogai sudarytas serverio puslapio adresas (turi prasidėti http://)', 'error', $config['home_url'] . '/go/control#response'); $query = $db->prepare("SELECT login_server_ip FROM servers WHERE user_id = '" . read_session('user_id') . "'"); $query->execute(); if ($query->rowCount() > 0) { $server_data = $query->fetch(); if ($server_data['login_server_ip'] != $post_data['login_server_ip']) { $query = $db->prepare("SELECT id FROM servers WHERE user_id != '" . read_session('user_id') . "' AND login_server_ip = '{$post_data['login_server_ip']}'"); $query->execute(); if ($query->rowCount() > 0) set_msg('Toks serverio login IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } } else { $query = $db->prepare("SELECT id FROM servers WHERE user_id != '" . read_session('user_id') . "' AND login_server_ip = '{$post_data['login_server_ip']}'"); $query->execute(); if ($query->rowCount() > 0) set_msg('Toks serverio login IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } $query = $db->prepare("SELECT game_server_ip FROM servers WHERE user_id = '" . read_session('user_id') . "'"); $query->execute(); if ($query->rowCount() > 0) { $server_data = $query->fetch(); if ($server_data['game_server_ip'] != $post_data['game_server_ip']) { $query = $db->prepare("SELECT id FROM servers WHERE user_id != '" . read_session('user_id') . "' AND game_server_ip = '{$post_data['game_server_ip']}'"); $query->execute(); if ($query->rowCount() > 0) set_msg('Toks serverio game IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } } else { $query = $db->prepare("SELECT id FROM servers WHERE user_id != '" . read_session('user_id') . "' AND game_server_ip = '{$post_data['game_server_ip']}'"); $query->execute(); if ($query->rowCount() > 0) set_msg('Toks serverio game IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } if (!is_numeric($post_data['login_server_port']) || $post_data['login_server_port'] == 21 || $post_data['login_server_port'] == 80) set_msg('Blogai sudarytas login serverio PORT adresas', 'error', $config['home_url'] . '/go/control#response'); if (!is_numeric($post_data['game_server_port']) || $post_data['game_server_port'] == 21 || $post_data['game_server_port'] == 80) set_msg('Blogai sudarytas game serverio PORT adresas', 'error', $config['home_url'] . '/go/control#response'); if (!is_numeric($post_data['xp'])) set_msg('Blogai sudaryti serverio daugikliai (rate)', 'server_information_msg', 'error medium_plus', base64_decode($_POST['back_path'])); if (strlen($post_data['description']) > 600) set_msg('Serverio apra?ymas per ilgas, max. 600 simbolių', 'error', $config['home_url'] . '/go/control#response'); remove_input_values($_POST); $query = $db->prepare("SELECT id FROM servers WHERE user_id = '" . read_session('user_id') . "'"); $query->execute(); if ($query->rowCount() == 0) { if (check_server_status($post_data['login_server_ip'], $post_data['login_server_port'])) $login_server_status = 1; else $login_server_status = 0; if (check_server_status($post_data['game_server_ip'], $post_data['game_server_port'])) $game_server_status = 1; else $game_server_status = 0; $query = $db->prepare("INSERT INTO servers SET user_id = '" . read_session('user_id') . "', title = '{$post_data['title']}', web_url = '{$post_data['web_url']}', chronicle = '{$post_data['chronicle']}', xp = '{$post_data['xp']}', description = '{$post_data['description']}', game_server_status = '{$game_server_status}', login_server_status = '{$login_server_status}', login_server_ip = '{$post_data['login_server_ip']}', game_server_ip = '{$post_data['game_server_ip']}', login_server_port = '{$post_data['login_server_port']}', game_server_port = '{$post_data['game_server_port']}', votes = '0', last_vote_date = '0'"); $query->execute(); set_msg('Serverio informacija i?saugota', 'success', $config['home_url'] . '/go/control#response'); } else { $query = $db->prepare("UPDATE servers SET title = '{$post_data['title']}', web_url = '{$post_data['web_url']}', chronicle = '{$post_data['chronicle']}', xp = '{$post_data['xp']}', description = '{$post_data['description']}', login_server_ip = '{$post_data['login_server_ip']}', game_server_ip = '{$post_data['game_server_ip']}', login_server_port = '{$post_data['login_server_port']}', game_server_port = '{$post_data['game_server_port']}' WHERE user_id = '" . read_session('user_id') . "'"); $query->execute(); set_msg('Serverio informacija i?saugota', 'success', $config['home_url'] . '/go/control#response'); }}?> What can this be?? Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/ Share on other sites More sharing options...
Jessica Posted September 19, 2012 Share Posted September 19, 2012 You are likely missing a closing } somewhere. I commend the person who finds it in that code. Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379290 Share on other sites More sharing options...
premiso Posted September 19, 2012 Share Posted September 19, 2012 <?phpif (!defined('SYS_STARTED')) I think it should be <?php if not <?phpif but of course I could be wrong. Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379293 Share on other sites More sharing options...
mikosiko Posted September 19, 2012 Share Posted September 19, 2012 c'mon it is easy.... the error is in line 1 (pun intended) Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379295 Share on other sites More sharing options...
ignasiux Posted September 19, 2012 Author Share Posted September 19, 2012 <?phpif (!defined('SYS_STARTED')) I think it should be <?php if not <?phpif but of course I could be wrong. Nope, didn't helped.. Anything more ? Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379301 Share on other sites More sharing options...
Jessica Posted September 19, 2012 Share Posted September 19, 2012 <?php if not just <?php. Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379302 Share on other sites More sharing options...
kicken Posted September 19, 2012 Share Posted September 19, 2012 Anything more ? How about don't post all your code on one line? Maybe then you'll get some actual help. Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379303 Share on other sites More sharing options...
ignasiux Posted September 19, 2012 Author Share Posted September 19, 2012 <?php if not just <?php. Oh... This helped. Thank. Can't submit, but nevermind. No more errors right. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379306 Share on other sites More sharing options...
Jessica Posted September 19, 2012 Share Posted September 19, 2012 If you need help with the rest of it you're going to have to post it so we can read it. Not one line. Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379307 Share on other sites More sharing options...
ignasiux Posted September 19, 2012 Author Share Posted September 19, 2012 When I press submit Its just says, that I need to fill all fields. I filled all, but same... Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379309 Share on other sites More sharing options...
premiso Posted September 19, 2012 Share Posted September 19, 2012 "I don't always write code, but when I do I write it in one line." Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379310 Share on other sites More sharing options...
ignasiux Posted September 19, 2012 Author Share Posted September 19, 2012 Guyz, sorry... This is not my code... "The requested URL /validate/error medium_plus was not found on this server." WHY THE HELL MY HTACCESS IS BUGGY ??? Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379311 Share on other sites More sharing options...
Jessica Posted September 19, 2012 Share Posted September 19, 2012 You should ask the person who wrote it. If it's a third party script, we can move this to the right forum, and you can say the name of the script. If you need to hire someone to help, we also have a freelance forum. Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379312 Share on other sites More sharing options...
darkfreaks Posted September 19, 2012 Share Posted September 19, 2012 @OP: next time run it through a php formatter before posting formatted code with phpif corrected: <?php if(!defined('SYS_STARTED')) die('Security activated'); if (isset($_POST['server_information'])) { save_input_values($_POST); $post_data = do_request($_POST, true, ''); if (!$post_data) set_msg('Būtina u?pildyti visus laukelius', 'error', $config['home_url'] . '/go/control#response'); if (strlen($post_data['title']) > 40) set_msg('Serverio pavadinimas negali būti ilgesnis, nei 40 simbolių', 'error', $config['home_url'] . '/go/control#response'); if (!preg_match("/^[A-Za-z0-9.,-_* ]+$/", $post_data['title'])) set_msg('Blogai sudarytas serverio pavadinimas', 'error', $config['home_url'] . '/go/control#response'); if (!preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $post_data['web_url'])) set_msg('Blogai sudarytas serverio puslapio adresas (turi prasidėti http://)', 'error', $config['home_url'] . '/go/control#response'); $query = $db->prepare("SELECT login_server_ip FROM servers WHERE user_id = '" . read_session('user_id') . "'"); $query->execute(); if ($query->rowCount() > 0) { $server_data = $query->fetch(); if ($server_data['login_server_ip'] != $post_data['login_server_ip']) { $query = $db->prepare("SELECT id FROM servers WHERE user_id != '" . read_session('user_id') . "' AND login_server_ip = '{$post_data['login_server_ip']}'"); $query->execute(); if ($query->rowCount() > 0) set_msg('Toks serverio login IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } } else { $query = $db->prepare("SELECT id FROM servers WHERE user_id != '" . read_session('user_id') . "' AND login_server_ip = '{$post_data['login_server_ip']}'"); $query->execute(); if ($query->rowCount() > 0) set_msg('Toks serverio login IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } $query = $db->prepare("SELECT game_server_ip FROM servers WHERE user_id = '" . read_session('user_id') . "'"); $query->execute(); if ($query->rowCount() > 0) { $server_data = $query->fetch(); if ($server_data['game_server_ip'] != $post_data['game_server_ip']) { $query = $db->prepare("SELECT id FROM servers WHERE user_id != '" . read_session('user_id') . "' AND game_server_ip = '{$post_data['game_server_ip']}'"); $query->execute(); if ($query->rowCount() > 0) set_msg('Toks serverio game IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } } else { $query = $db->prepare("SELECT id FROM servers WHERE user_id != '" . read_session('user_id') . "' AND game_server_ip = '{$post_data['game_server_ip']}'"); $query->execute(); if ($query->rowCount() > 0) set_msg('Toks serverio game IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } if (!is_numeric($post_data['login_server_port']) || $post_data['login_server_port'] == 21 || $post_data['login_server_port'] == 80) set_msg('Blogai sudarytas login serverio PORT adresas', 'error', $config['home_url'] . '/go/control#response'); if (!is_numeric($post_data['game_server_port']) || $post_data['game_server_port'] == 21 || $post_data['game_server_port'] == 80) set_msg('Blogai sudarytas game serverio PORT adresas', 'error', $config['home_url'] . '/go/control#response'); if (!is_numeric($post_data['xp'])) set_msg('Blogai sudaryti serverio daugikliai (rate)', 'server_information_msg', 'error medium_plus', base64_decode($_POST['back_path'])); if (strlen($post_data['description']) > 600) set_msg('Serverio apra?ymas per ilgas, max. 600 simbolių', 'error', $config['home_url'] . '/go/control#response'); remove_input_values($_POST); $query = $db->prepare("SELECT id FROM servers WHERE user_id = '" . read_session('user_id') . "'"); $query->execute(); if ($query->rowCount() == 0) { if (check_server_status($post_data['login_server_ip'], $post_data['login_server_port'])) $login_server_status = 1; else $login_server_status = 0; if (check_server_status($post_data['game_server_ip'], $post_data['game_server_port'])) $game_server_status = 1; else $game_server_status = 0; $query = $db->prepare("INSERT INTO servers SET "#@%+=FEFGT6R3987EFDF86347GR=+%@#" user_id = '" . read_session('user_id') . "', title = '{$post_data['title']}', web_url = '{$post_data['web_url']}', chronicle = '{$post_data['chronicle']}', xp = '{$post_data['xp']}', description = '{$post_data['description']}', game_server_status = '{$game_server_status}', login_server_status = '{$login_server_status}', login_server_ip = '{$post_data['login_server_ip']}', game_server_ip = '{$post_data['game_server_ip']}', login_server_port = '{$post_data['login_server_port']}', game_server_port = '{$post_data['game_server_port']}', votes = '0', last_vote_date = '0'"); "#@%+=FEFGT6R3987EFDF86347GR=+%@#" $query->execute(); set_msg('Serverio informacija i?saugota', 'success', $config['home_url'] . '/go/control#response'); } else { $query = $db->prepare("UPDATE servers SET "#@%+=FEFGT6R3987EFDF86347GR=+%@#" title = '{$post_data['title']}', web_url = '{$post_data['web_url']}', chronicle = '{$post_data['chronicle']}', xp = '{$post_data['xp']}', description = '{$post_data['description']}', login_server_ip = '{$post_data['login_server_ip']}', game_server_ip = '{$post_data['game_server_ip']}', login_server_port = '{$post_data['login_server_port']}', game_server_port = '{$post_data['game_server_port']}' WHERE user_id = '" . read_session('user_id') . "'"); "#@%+=FEFGT6R3987EFDF86347GR=+%@#" $query->execute(); set_msg('Serverio informacija i?saugota', 'success', $config['home_url'] . '/go/control#response'); } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379373 Share on other sites More sharing options...
Jessica Posted September 19, 2012 Share Posted September 19, 2012 That version is slightly better but almost as bad. Indentation matters! Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379379 Share on other sites More sharing options...
darkfreaks Posted September 19, 2012 Share Posted September 19, 2012 @Jesi it's better than endlessly scrolling left to right *headache* reformatted the code it again much much better. <?php if(!defined('SYS_STARTED')) die('Security activated'); if (isset($_POST['server_information'])) { save_input_values($_POST); $post_data = do_request($_POST, true, ''); if (!$post_data) set_msg('Būtina u?pildyti visus laukelius', 'error', $config['home_url'] . '/go/control#response'); if (strlen($post_data['title']) > 40) set_msg('Serverio pavadinimas negali būti ilgesnis, nei 40 simbolių', 'error', $config['home_url'] . '/go/control#response'); if (!preg_match("/^[A-Za-z0-9.,-_* ]+$/", $post_data['title'])) set_msg('Blogai sudarytas serverio pavadinimas', 'error', $config['home_url'] . '/go/control#response'); if (!preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $post_data['web_url'])) set_msg('Blogai sudarytas serverio puslapio adresas (turi prasidėti http://)', 'error', $config['home_url'] . '/go/control#response'); $query = $db->prepare("SELECT login_server_ip FROM servers WHERE user_id = '" . read_session('user_id') . "'"); $query->execute(); if ($query->rowCount() > 0) { $server_data = $query->fetch(); if ($server_data['login_server_ip'] != $post_data['login_server_ip']) { $query = $db->prepare("SELECT id FROM servers WHERE user_id != '" . read_session('user_id') . "' AND login_server_ip = '{$post_data['login_server_ip']} '"); $query->execute(); if ($query->rowCount() > 0) set_msg('Toks serverio login IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } } else { $query = $db->prepare("SELECT id FROM servers WHERE user_id != '" . read_session('user_id') . "' AND login_server_ip = '{$post_data['login_server_ip']} '"); $query->execute(); if ($query->rowCount() > 0) set_msg('Toks serverio login IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } $query = $db->prepare("SELECT game_server_ip FROM servers WHERE user_id = '" . read_session('user_id') . "'"); $query->execute(); if ($query->rowCount() > 0) { $server_data = $query->fetch(); if ($server_data['game_server_ip'] != $post_data['game_server_ip']) { $query = $db->prepare("SELECT id FROM servers WHERE user_id != '" . read_session('user_id') . "' AND game_server_ip = '{$post_data['game_server_ip']} '"); $query->execute(); if ($query->rowCount() > 0) set_msg('Toks serverio game IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } } else { $query = $db->prepare("SELECT id FROM servers WHERE user_id != '" . read_session('user_id') . "' AND game_server_ip = '{$post_data['game_server_ip']} '"); $query->execute(); if ($query->rowCount() > 0) set_msg('Toks serverio game IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } if (!is_numeric($post_data['login_server_port']) || $post_data['login_server_port'] == 21 || $post_data['login_server_port'] == 80) set_msg('Blogai sudarytas login serverio PORT adresas', 'error', $config['home_url'] . '/go/control#response'); if (!is_numeric($post_data['game_server_port']) || $post_data['game_server_port'] == 21 || $post_data['game_server_port'] == 80) set_msg('Blogai sudarytas game serverio PORT adresas', 'error', $config['home_url'] . '/go/control#response'); if (!is_numeric($post_data['xp'])) set_msg('Blogai sudaryti serverio daugikliai (rate)', 'server_information_msg', 'error medium_plus', base64_decode($_POST['back_path'])); if (strlen($post_data['description']) > 600) set_msg('Serverio apra?ymas per ilgas, max. 600 simbolių', 'error', $config['home_url'] . '/go/control#response'); remove_input_values($_POST); $query = $db->prepare("SELECT id FROM servers WHERE user_id = '" . read_session('user_id') . "'"); $query->execute(); if ($query->rowCount() == 0) { if (check_server_status($post_data['login_server_ip'], $post_data['login_server_port'])) $login_server_status = 1; else $login_server_status = 0; if (check_server_status($post_data['game_server_ip'], $post_data['game_server_port'])) $game_server_status = 1; else $game_server_status = 0; $query = $db->prepare("INSERT INTO servers SET "#@%+=FEFGT6R3987EFDF86347GR=+%@#" user_id = '" . read_session('user_id') . "', title = '{$post_data['title']}',web_url = '{$post_data['web_url']}',chronicle = '{$post_data['chronicle']}',xp = '{$post_data['xp']}',description = '{$post_data['description']}',game_server_status = '{$game_server_status}',login_server_status = '{$login_server_status}',login_server_ip = '{$post_data['login_server_ip']}',game_server_ip = '{$post_data['game_server_ip']}',login_server_port = '{$post_data['login_server_port']}',game_server_port = '{$post_data['game_server_port']}',votes = '0',last_vote_date = '0'"); "#@%+=FEFGT6R3987EFDF86347GR=+%@#" $query->execute(); set_msg('Serverio informacija i?saugota', 'success', $config['home_url'] . '/go/control#response'); } else { $query = $db->prepare("UPDATE servers SET "#@%+=FEFGT6R3987EFDF86347GR=+%@#" title = '{$post_data['title']}',web_url = '{$post_data['web_url']}',chronicle = '{$post_data['chronicle']}',xp = '{$post_data['xp']}',description = '{$post_data['description']}',login_server_ip = '{$post_data['login_server_ip']}',game_server_ip = '{$post_data['game_server_ip']}',login_server_port = '{$post_data['login_server_port']}',game_server_port = '{$post_data['game_server_port']}'WHERE user_id = '" . read_session('user_id') . "'"); "#@%+=FEFGT6R3987EFDF86347GR=+%@#" $query->execute(); set_msg('Serverio informacija i?saugota', 'success', $config['home_url'] . '/go/control#response'); } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379381 Share on other sites More sharing options...
Christian F. Posted September 19, 2012 Share Posted September 19, 2012 Courtesy by Zend Studio, with additional newlines added by yours truly: <?php if (!defined ('SYS_STARTED')) die ('Security activated'); if (isset ($_POST['server_information'])) { save_input_values ($_POST); $post_data = do_request ($_POST, true, ''); if (!$post_data) set_msg ('Būtina u?pildyti visus laukelius', 'error', $config['home_url'] . '/go/control#response'); if (strlen ($post_data['title']) > 40) set_msg ('Serverio pavadinimas negali būti ilgesnis, nei 40 simbolių', 'error', $config['home_url'] . '/go/control#response'); if (!preg_match ("/^[A-Za-z0-9.,-_* ]+$/", $post_data['title'])) set_msg ('Blogai sudarytas serverio pavadinimas', 'error', $config['home_url'] . '/go/control#response'); if (!preg_match ('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $post_data['web_url'])) set_msg ('Blogai sudarytas serverio puslapio adresas (turi prasidėti http://)', 'error', $config['home_url'] . '/go/control#response'); $query = $db->prepare ("SELECT login_server_ip FROM servers WHERE user_id = '" . read_session ('user_id') . "'"); $query->execute (); if ($query->rowCount () > 0) { $server_data = $query->fetch (); if ($server_data['login_server_ip'] != $post_data['login_server_ip']) { $query = $db->prepare ("SELECT id FROM servers WHERE user_id != '" . read_session ('user_id') . "' AND login_server_ip = '{$post_data['login_server_ip']}'"); $query->execute (); if ($query->rowCount () > 0) set_msg ('Toks serverio login IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } } else { $query = $db->prepare ("SELECT id FROM servers WHERE user_id != '" . read_session ('user_id') . "' AND login_server_ip = '{$post_data['login_server_ip']}'"); $query->execute (); if ($query->rowCount () > 0) set_msg ('Toks serverio login IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } $query = $db->prepare ("SELECT game_server_ip FROM servers WHERE user_id = '" . read_session ('user_id') . "'"); $query->execute (); if ($query->rowCount () > 0) { $server_data = $query->fetch (); if ($server_data['game_server_ip'] != $post_data['game_server_ip']) { $query = $db->prepare ("SELECT id FROM servers WHERE user_id != '" . read_session ('user_id') . "' AND game_server_ip = '{$post_data['game_server_ip']}'"); $query->execute (); if ($query->rowCount () > 0) set_msg ('Toks serverio game IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } } else { $query = $db->prepare ("SELECT id FROM servers WHERE user_id != '" . read_session ('user_id') . "' AND game_server_ip = '{$post_data['game_server_ip']}'"); $query->execute (); if ($query->rowCount () > 0) set_msg ('Toks serverio game IP jau naudojamas', 'error', $config['home_url'] . '/go/control#response'); } if (!is_numeric ($post_data['login_server_port']) || $post_data['login_server_port'] == 21 || $post_data['login_server_port'] == 80) set_msg ('Blogai sudarytas login serverio PORT adresas', 'error', $config['home_url'] . '/go/control#response'); if (!is_numeric ($post_data['game_server_port']) || $post_data['game_server_port'] == 21 || $post_data['game_server_port'] == 80) set_msg ('Blogai sudarytas game serverio PORT adresas', 'error', $config['home_url'] . '/go/control#response'); if (!is_numeric ($post_data['xp'])) set_msg ('Blogai sudaryti serverio daugikliai (rate)', 'server_information_msg', 'error medium_plus', base64_decode ($_POST['back_path'])); if (strlen ($post_data['description']) > 600) set_msg ('Serverio apra?ymas per ilgas, max. 600 simbolių', 'error', $config['home_url'] . '/go/control#response'); remove_input_values ($_POST); $query = $db->prepare ("SELECT id FROM servers WHERE user_id = '" . read_session ('user_id') . "'"); $query->execute (); if ($query->rowCount () == 0) { if (check_server_status ($post_data['login_server_ip'], $post_data['login_server_port'])) $login_server_status = 1; else $login_server_status = 0; if (check_server_status ($post_data['game_server_ip'], $post_data['game_server_port'])) $game_server_status = 1; else $game_server_status = 0; $query = $db->prepare ("INSERT INTO servers SET user_id = '" . read_session ('user_id') . "', title = '{$post_data['title']}', web_url = '{$post_data['web_url']}', chronicle = '{$post_data['chronicle']}', xp = '{$post_data['xp']}', description = '{$post_data['description']}', game_server_status = '{$game_server_status}', login_server_status = '{$login_server_status}', login_server_ip = '{$post_data['login_server_ip']}', game_server_ip = '{$post_data['game_server_ip']}', login_server_port = '{$post_data['login_server_port']}', game_server_port = '{$post_data['game_server_port']}', votes = '0', last_vote_date = '0'"); $query->execute (); set_msg ('Serverio informacija i?saugota', 'success', $config['home_url'] . '/go/control#response'); } else { $query = $db->prepare ("UPDATE servers SET title = '{$post_data['title']}', web_url = '{$post_data['web_url']}', chronicle = '{$post_data['chronicle']}', xp = '{$post_data['xp']}', description = '{$post_data['description']}', login_server_ip = '{$post_data['login_server_ip']}', game_server_ip = '{$post_data['game_server_ip']}', login_server_port = '{$post_data['login_server_port']}', game_server_port = '{$post_data['game_server_port']}' WHERE user_id = '" . read_session ('user_id') . "'"); $query->execute (); set_msg ('Serverio informacija i?saugota', 'success', $config['home_url'] . '/go/control#response'); } } ?> A really interesting thing to note, is that based upon the whitespaces in the queries this code has been properly newlined and indented before. Don't really know why or what caused it all to end up in one line, but I suspect notepad has been involved. Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379391 Share on other sites More sharing options...
Barand Posted September 19, 2012 Share Posted September 19, 2012 ... and what happened to the $ prefixes to variable names in the latter section? Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379431 Share on other sites More sharing options...
Christian F. Posted September 19, 2012 Share Posted September 19, 2012 Barand: Referring to darkfreak's post? Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379442 Share on other sites More sharing options...
Barand Posted September 20, 2012 Share Posted September 20, 2012 Christian: Yes - his former submission. Oddly there was no warning of intermediate replies Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379531 Share on other sites More sharing options...
Christian F. Posted September 20, 2012 Share Posted September 20, 2012 Though so. You've probably got the warning turned off in your profile, as I have. That said, I don't think he's missing any dollar signs, but rather has the SQL query strings broken by this string: "#@%+=FEFGT6R3987EFDF86347GR=+%@#" Something not wholly bad, as I just noticed the original script uses prepared statements without actually preparing them. Instead it's using string concatenation to put, what I assume to be, unescaped data straight into the query. Quote Link to comment https://forums.phpfreaks.com/topic/268559-parse-error-syntax-error-unexpected-t_exit/#findComment-1379537 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.