<?php
if(isset($_POST['btnLogin']))
{
$id = $_POST['email'];
$pass = $_POST['password'];
// Resource Address
$url ="http://localhost:81/RouteApp/ViewApi/?id=$id&pass=$pass";
// Send Request To Resource
$client = curl_init($url);
curl_setopt($client,CURLOPT_RETURNTRANSFER,1);
// get Response To Resource
$response = curl_exec($client);
// Decode it
$result = json_decode($response);
session_start();
$res = (array)$result->data;
foreach ($res as $key) {
$_SESSION['sessId']=$key[0];
$_SESSION['sessName']=$key[1];
$_SESSION['sessEmail']=$key[2];
}
header("Location:index.php");
}
?>