2015-01-13 1 views
0

임 꽤 새를 던져,하지만이 내가내가 file_get_contents 구문을 사용, PHP에 오류

$homepage = file_get_contents('url: '.Config_Reader::readConfig('localhome')->base_url.'setc.php?userid=123&panelid=1'); 
echo $homepage; 

할 수있는 사람을 사용하여 코드

Warning: file_get_contents(url: http://localhost/setc.php?userid=123&panelid=1): failed to open stream: No error in 

말하는 오류를 반환 이런 식으로 사용하려면이

답변

0

에 한번에 도와 :

$homepage = file_get_contents("'".Config_Reader::readConfig('localhome')->base_url."setc.php?userid=123&panelid=1'"); 
+0

덕분에 많이 .. 내가 지금 얼마 동안이 작업을했다 ...하지만 난 여기에 넣어 왜 성공 아직 ..이 이잖아 ... 병 u는 내가 같은 오류 –

+0

위의 대답에 대해 KNW하자 @ShoGumLew : $ homepage = file_get_contents ('http : //localhost/setc.php? userid = 123 & panelid = 1'); –

+0

를 얻을 수 –

0

URL이 필요하다고 생각하지 않습니다. 나는 file_get_contents를 다음과 같이 사용합니다 :

file_get_contents('http://stackoverflow.com/questions/27915659/file-get-content-not-working-throws-an-error'); 

저에게 잘 맞았습니다.