小编vin*_*avn的帖子

file_get_contents和curl都不起作用

我刚刚使用file_get_contents来检索我网站上的数据.但它不会返回任何东西.

file_get_contents("https://www.google.co.in/images/srpr/logo11w.png")
Run Code Online (Sandbox Code Playgroud)

当我在我的本地环境中使用它时,它返回值.

我也尝试在我的网站上卷曲,以确定它是否返回任何东西.但它表明

禁止
您无权访问.

我用Google搜索,我发现了一些提示.我启用了allow_url_fopenallow_url_include.

但没有任何效果.

我试过的卷曲代码

function curl($url){ 
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL,$url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  $return = curl_exec($ch); curl_close ($ch);
  return $return;
} 
$string = curl('https://www.google.co.in/images/srpr/logo11w.png');
echo $string;
Run Code Online (Sandbox Code Playgroud)

php curl file-get-contents phpinfo

7
推荐指数
1
解决办法
2348
查看次数

是否有可能在magento中使用"货币代码"获取"国家名称"?

我需要使用我拥有的货币代码来获取国家/地区名称.

有可能吗?

magento magento-1.7

6
推荐指数
1
解决办法
1009
查看次数

$ this-> getRequest() - > getParam()在类别控制器中不起作用

我正在努力从url中恢复制造商属性

本地主机/ magento的/ index.php的/测试pro.html?制造商/ 4

所以我用过 $this->getRequest()->getParam('manufacturer')

我没有得到任何输出.

但是当我将url更改为localhost/magento/index.php/test-pro.html?manufacturer = 4
(/替换为=)时,我得到了正确的输出.

但我需要url应该是localhost/magento/index.php/test-pro.html?manufacturer/4

并希望获取与该制造商ID相关的产品4.

来人帮帮我.

magento magento-1.7 magento-1.8

6
推荐指数
1
解决办法
2万
查看次数

如何使用magento的管理面板中的自定义模块动态创建字段,如产品自定义选项

我想在magento的管理面板中使用自定义模块创建动态字段.

它必须类似于产品部分下的自定义选项.

有人给我一个主意.

magento

5
推荐指数
1
解决办法
956
查看次数