我正在尝试使用WP来生成随机密钥SEE HERE,但我似乎找不到一种方法来检索密钥并将其存储到变量中。
我试过了:
$html = file_get_contents('http://api.wordpress.org/secret-key/1.1/salt/');但它并不可靠,有时返回3组密钥,有时返回5,6,7个随机密钥,而不是它应该返回的8个密钥。
使用cURL也会发生同样的事情:
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://api.wordpress.org/secret-key/1.1/salt/');
$result = curl_exec($curl);
curl_close($curl);如果有人能对此有所了解,我将不胜感激。
发布于 2013-11-09 04:22:49
首先,将allow_url_include设置为true。此外,还要了解implications this can have on security。
然后使用require或include。
include('http://api.wordpress.org/secret-key/1.1/salt/');
echo AUTH_KEY;https://stackoverflow.com/questions/19867608
复制相似问题