2015-01-13 22 views
0

林很新的PHP,我用的file_get_contents語法,但它返回一個錯誤說File_get_content不工作引發錯誤

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

這是我使用

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

任何代碼幫我在這

回答

0

嘗試使用這樣的:

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

非常感謝..我一直在努力,現在有一段時間......但沒有成功..這就是爲什麼我把它放在這裏...讓我ü關於上述答案 –

+0

我得到同樣的錯誤 –

+0

@ShoGumLew :首先嚐試使用像這樣:$ homepage = file_get_contents('http://localhost/setc.php?userid = 123 & panelid = 1'); –

0

我不認爲你需要的網址。我使用這樣的file_get_contents:

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

對我來說工作很好。