Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: Uncaught Error: Array callback must have exactly two elements [closed]

Tags:

php

I tried a lot but it, again and again, showing same error:

Fatal error: Uncaught Error: Array callback must have exactly two elements",

error is showing on line no.2

if($_SERVER(['REQUEST_METHOD'] == 'POST')){  
like image 530
Prathamesh R. Pawar Avatar asked Apr 21 '26 13:04

Prathamesh R. Pawar


1 Answers

$_SERVER is not a function, its an array, you need to remove () after $_SERVER, and your code will look like below

if($_SERVER['REQUEST_METHOD'] == 'POST'){ ... }

PS: as everyone said , your script is open to SQL Injection Attack and Never store passwords in the database as Plain Text. Please follow the guidelines on the comments

like image 195
Tushar Avatar answered Apr 23 '26 06:04

Tushar