Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to send data from one website to another in laravel

$url="http://abc/api/xyz.php";  //url of 2nd website where data is to be send
$postdata = $data
$ch = curl_init(); 
curl_setopt ($ch, CURLOPT_URL, $url); 
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0)
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0); 
curl_setopt ($ch, CURLOPT_POST, 1); 
curl_setopt ($ch, CURLOPT_TIMEOUT, 60); 
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_HTTPHEADER, array('Content-Type', 'application/json'));
$result = curl_exec ($ch); 

echo $result;  
curl_close($ch);
Comment

PREVIOUS NEXT
Code Example
Php :: crul in laravel 
Php :: var_dump php 
Php :: foreign key laravel migration 
Php :: installing bootstrap on laravel8 
Php :: what is scalar data type in php 
Php :: php end session 
Php :: hasone relation in laravel 
Php :: php regex string contains coringa 
Php :: create new laravel 9 project 
Php :: php array length for loop 
Php :: carbon format date in laravel 
Php :: insert data in database using seeder in laravel 
Php :: index.php wont load as main 
Php :: page break in dompdf 
Php :: how to make classess in php 
Php :: send multiple mail in laravel 
Php :: php variable in string 
Php :: lodash tester 
Php :: php read zip file without extracting 
Php :: check if elquent retrun empty array laravel 
Php :: call model function in controller laravel 
Php :: how to insert date in mysql using php 
Php :: php to list files 
Php :: how to retrieve image from database in php mysqli 
Php :: show php all errors 
Php :: php Calculate the number of months between two dates 
Php :: php curl request 
Php :: get day by date in php 
Php :: php postgresql number of rows 
Php :: getting input value in session variable in php 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =