-3
$result = $db->execute("
INSERT INTO arrowchat_chatroom_rooms (author_id, name, description, welcome_message, image, type,password, length, max_users, session_time, limit_message_num, limit_seconds_num) 
VALUES ('" . $db->escape_string($userid) . "', 
'" . $_POST["add_chatroom_name"] . "',
'" . $_POST["add_chatroom_desc"] . "', 
'" . $_POST["add_chatroom_welcome_msg" . "', 
'" . $db->escape_string($icon_filename) ."', 
'". $_POST["add_chatroom_type"] . "', 
'" . $_POST["add_chatroom_password"] . "', 
'" . $_POST["add_chatroom_length"] . "', 
'" . $_POST["chatroom_max_users"] . "', 
'" . time() . "', 
'" . $_POST["limit_message_num"] . "', 
'" . *_POST["limit_seconds_num"] . "')"
);

return http 500 x_x

Muhammad Omer Aslam
  • 22,976
  • 9
  • 42
  • 68
  • 1
    could be the last item *_POST["limit_seconds_num"] note the * not a $ –  Feb 01 '18 at 23:01
  • Joke mode on: You're running the newest version of PHP which now has build-in protection against SQL-injection. – KIKO Software Feb 01 '18 at 23:01
  • If you formatted things a bit neater it would be easier to pick out problems. One thing I noticed is you've got `*_POST["limit_seconds_num"]` near the end and that should probably be `$_POST["limit_seconds_num"]`. – cteski Feb 01 '18 at 23:01
  • 1
    1) don't EVER put raw `POST` data into `MySQL` without sanitizing it!! 2) I'd be willing to be there's a problem with one of your `$_POST` variables being either it's not set, or it's the wrong data type.. Use this at the top of your page `ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);` – Zak Feb 01 '18 at 23:02
  • (fixed last "$" post item still not working) @Zak readed up. Btw. i always read the manual lol – SalvatorePeufra Feb 01 '18 at 23:05
  • code is postegres like functions get_var, var_check – SalvatorePeufra Feb 01 '18 at 23:07

1 Answers1

0

you are missing the closing ] for

$_POST["add_chatroom_welcome_msg"

and * in the start of

*_POST["limit_seconds_num"]

in your query, and that is the most probable cause of your 500 error try enabling the display_errors = On from the php.ini

Muhammad Omer Aslam
  • 22,976
  • 9
  • 42
  • 68