我有一个带有html div内容的php脚本。需要用html代码获取php,包括css

时间:2022-10-29 13:10:57

I have a PHP code that fetch data from another server. i can't use iframe due to SSL.

我有一个从其他服务器获取数据的PHP代码。由于SSL,我无法使用iframe。

I'm tryin to use the code to fetch php content

我正在尝试使用代码来获取php内容

here is the code im using:

这是我正在使用的代码:

$statsframe = file_get_contents('http://myurl/index.php');  
echo $statsframe;  

the code is actually working but unfortunately the css is broken and no html showing.

代码实际上工作,但不幸的是,CSS已经破坏,没有html显示。

Is there a way i can make the HTML with css show properly ?

有没有办法可以使用CSS显示正确的HTML?

1 个解决方案

#1


0  

<?php

$fp = fsockopen('*.com',80);

$request  = "GET / HTTP/1.1\r\n";
$request .= "HOST: *.com\r\n";
$request .= "Connection: Close\r\n\r\n";

fwrite($fp,$request);
while(!feof($fp))
  echo fgets($fp,256);

fclose($fp);

but you know use the curl package, which is very simple

但是你知道使用curl包,这非常简单

#1


0  

<?php

$fp = fsockopen('*.com',80);

$request  = "GET / HTTP/1.1\r\n";
$request .= "HOST: *.com\r\n";
$request .= "Connection: Close\r\n\r\n";

fwrite($fp,$request);
while(!feof($fp))
  echo fgets($fp,256);

fclose($fp);

but you know use the curl package, which is very simple

但是你知道使用curl包,这非常简单