0
當php_self以html形式加載時,我的腳本加載了url的標題。警告:implode():在加載頁面傳遞的參數無效
<?php
$bk_url=$_REQUEST['bk_url'];
$remote_url = $bk_url;
$from_remote_url = implode("", file("".$remote_url));
if(preg_match("/<title>(.+)<\/title>/", $from_remote_url, $regs)) {
} else {
echo "<br> Title empty. Manual insert";
}
?>
當負載PHP頁面,會顯示兩個錯誤:
Warning: file(http://): failed to open stream: operation failed
與此錯誤:
Warning: implode(): Invalid arguments passed
我有試着去發現計算器一個解決方案,但沒有找到任何解決方案。
如何解決這兩個錯誤? 謝謝
if(!strlen($ _ REQUEST ['bk_url']))exit(「Can not run with empty URL」); –
它沒有什麼可怕的爆炸'$ from_remote_url = implode(「」,file(「」。$ remote_url));' – RiggsFolly
它總是一個好主意來檢查一個$ _POST或$ _GET參數是否已經真正被傳遞,並且它實際上在嘗試使用'isset()'或'empty()'' – RiggsFolly