Đang Thực Hiện

Load contents of page after CURL operations

A page is called by CURL to do a form submission. What is required after that is to show the output of the page which was called, that is load that page. The page which needs to be loaded has its own cookies as well. A simple code is required to achieve this.

This is the curl part of the php code to do the form submission:


$ch = curl_init("http://mydomain/[url removed, login to view]");

$encoded = '';

// include GET as well as POST variables; your needs may vary.

foreach($_GET as $name => $value) {

$encoded .= urlencode($name).'='.urlencode($value).'&';


foreach($_POST as $name => $value) {

$encoded .= urlencode($name).'='.urlencode($value).'&';


// chop off last ampersand

$encoded = substr($encoded, 0, strlen($encoded)-1);

curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded);

curl_setopt($ch, CURLOPT_HEADER, 0);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$output = curl_exec($ch);



Kĩ năng: PHP

Xem nhiều hơn: operations, load php, contents page, php curl http code, curl code, curl form value, encoded php, curl post form, form asp curl php, load page, page submission, php curl form post, php load, curl http post, curl_setopt, urlencode, page curl, curl php required, curl asp page, curl post asp page, curl form name, curl page asp, simple php curl, substr, post curl

Về Bên Thuê:
( 2 nhận xét ) blackwood, Australia

ID dự án: #1697188

Được trao cho:


Will Complete your Working in 10 Min

$30 USD trong 1 ngày
(1 Nhận xét)