1

Hi I’m trying to recieve data and i get the error Notice: Undefined index:['my key']

my php codes:

$Username = $_REQUEST['username'];
$Password = $_REQUEST['password'];

the code i'm sending:

{
  "username":"sss",
  "password":"aaa"

}

exact error:

Notice: Undefined index: username in C:\xampp\htdocs\android.dev\first_page.php on line 33

Notice: Undefined index: password in C:\xampp\htdocs\android.dev\first_page.php on line 34
x RaGNaR x
  • 13
  • 3
  • you decoded the json before trying to use it right? – treyBake Sep 10 '19 at 16:18
  • How are you sending it? – Claudio Sep 10 '19 at 16:22
  • im sending it with asynchttppost and no cause the tutorial im watching it dosn't and the problem is i just open my php file and i have this error without sending anything....isn't my syntax trying to receive the key the problem? – x RaGNaR x Sep 10 '19 at 16:24

0 Answers0