ورود

View Full Version : تغییر در ساختار curl



ms-ninja
شنبه 22 شهریور 1399, 16:09 عصر
با سلام خدمت تمامی دوستان



<?php
$post = [ "_token" => "Apinbgsjxxx@4dcssssx8449003", "username" => "test3",
"password" => "test3"
];
$ch = curl_init('http://api.nodhost.ir/api/checkUsernameAndPassword');curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);


من در تبدیل کد ارسال بالا به مشکل خوردم

میخوام در Codeigniter به ورش زیر این کار انجام بدم



public function RequestLogin(){ $username = $this->input->get('username'); $password = $this->input->get('password'); $token="Apinbgsjxxx@4dcssssx8449003"; $result = $this->curl->simple_get('http://82.145.55.61/api/user/auth_v2.php?_token='.$token.'username='.$username. '&password='.$password);echo ($result); }

لطفا راهنمایی کنید