Web service Login dont return response

when i call this function " Call " dont return to me response
when i show the result in console shows me just :


Here is the example of web service :

<?php $url = "http://127.0.0.1:100/suitecrm/service/v4_1/rest.php"; $request = json_decode(file_get_contents('php://input')); //$username= $_POST['username']; //$password= $_POST['password']; $username = $request->username; $password = $request->password; //function to make cURL request function call($method, $parameters, $url) { //echo '
URL: '.print_r($url, true).'
'; ob_start(); $curl_request = curl_init(); curl_setopt($curl_request, CURLOPT_URL, $url); curl_setopt($curl_request, CURLOPT_POST, 1); curl_setopt($curl_request, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); curl_setopt($curl_request, CURLOPT_HEADER, 1); curl_setopt($curl_request, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl_request, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_request, CURLOPT_FOLLOWLOCATION, 0); $jsonEncodedData = json_encode($parameters); $post = array( "method" => $method, "input_type" => "JSON", "response_type" => "JSON", "rest_data" => $jsonEncodedData ); curl_setopt($curl_request, CURLOPT_POSTFIELDS, $post); //echo '
POST: '.print_r($post, true).'
'; $result = curl_exec($curl_request); //echo '
RESULT: '.print_r($result, true).'
'; curl_close($curl_request); $result = explode("\r\n\r\n", $result, 2); $response = json_decode($result[1]); ob_end_flush(); return $response; } //login ------------------------------ $login_parameters = array( "user_auth" => array( "user_name" => $username, "password" => md5($password), "version" => "1" ), "application_name" => "SugarCRM-Mobile", "name_value_list" => array(), ); $login_result = call("login", $login_parameters, $url); echo '
';
print_r($login_result);
echo '
'; //get session id //$session_id = $login_result->id; ?>

thank u !!

your example is from where exactly? is wrong, please follow SugarCRM documentation http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_6.5/Application_Framework/Web_Services/Examples/REST/PHP/Logging_In/

this line

//login $login_parameters = array( 

should be like this

//login 
$login_parameters = array(

maybe a copy paste error?

best regards

also please always check the logs for errors in the code, with that bad line this was the output that apache was telling me

Parse error means a syntax error in the code

best regards

No i’n my php file is like that

//login ------------------------------
$login_parameters = array(
“user_auth” => array(
“user_name” => $username,
“password” => md5($password),
“version” => “1”
),
“application_name” => “SugarCRM-Mobile”,
“name_value_list” => array(),
);

i use the log but no error, and $login_result return no result to me
i use the same exemple in the documenatation.

well change it the way I describe it, and please, check back the link I posted is not the same as your file

best regards