Throws an error when accepting a parameter

Tell me what’s wrong here? I’m just not very good at php…

if (isset($_POST['type'])) {
if (isset($_POST['type'])) {$type = $_POST['type']; }
if (isset($_POST['id'])) {$id = $_POST['id']; }
}

Request like domen.com/file.php?type=action?id=number

Type error
Parse error: syntax error, unexpected T_IF in if (isset($_POST['type'])) {


Answer 1, authority 100%

There is no error in this code.


Answer 2, authority 100%

  1. “domen.com/file.php?type=action?id=number” – you have a GET request here
  2. if you make a GET request, then type=action&id=number (you have two “?”)
  3. most likely, the above expression is an error – show the whole code

Leave a reply

Please enter your comment!
Please enter your name here