简体   繁体   English

我有一个html div内容的php脚本。 需要使用包含CSS的html代码获取php

[英]I have a php script with html div content. need to fetch php with html code including css

I have a PHP code that fetch data from another server. 我有一个PHP代码,可以从另一台服务器获取数据。 i can't use iframe due to SSL. 由于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正确显示?

<?php

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

$request  = "GET / HTTP/1.1\r\n";
$request .= "HOST: stackoverflow.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包装,这非常简单

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM