dpw50696 2016-06-10 14:17
浏览 22

使用cURL登录远程站点

I'm trying to integrate a website into my own page. To get acces to the remote site you must to be logged in. The index.php shows how I embed the site using cURL.

index.php

<?php
ob_start();
$path = "http://domain.de";
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, $path);
curl_exec($curl_handle);


$contents=ob_get_contents();

ob_end_clean();

echo str_replace('href="/','href="http://domain.de/',str_replace('src="/','src="http://domain.de/',$contents));
curl_close($curl_handle);

When I fill out the login-form and submit, I got this error:

We received an unexpected status code from the server (404)  

The problem is that the POST request goes to my site and not the remote.
My question:
How can I post my login-data to the remote site, catch out the response and then use the site on my page? Any help is welcome! (Sorry for my bad description)

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
    • ¥500 火焰左右视图、视差(基于双目相机)
    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统