Tell me, what is the error here? I just do not really understand php ...

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

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

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

  • 2
    the error may not be in these lines ... where the curly bracket is missing ... - Yoharny Babay
  • one
    But why check the $_POST['type'] second time? - Oleg Arkhipov

2 answers 2

There is no error in this code.

    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 (do you have two "?" there)
    3. Most likely, the error above this expression - show all the code