<html> <title>A Simple Store</title> <table width='100%' cols='2' border='3px'> <colgroup span='2'> <col width='20%'></col> <col width='80%'></col> </colgroup> <tr><td colspan='2'><center><h1>Simple Store</h1></center></td></tr> <tr><td valign='top'> <table width='100%' align='left' height='100%'> <?php define('KEYID','[YourAccessKeyIdHere]'); define('AssocTag','[YourAssocitaeTagHere]'); if($_GET['Action'] == 'Search'){ print(" <formname='SearchTerms'action=SimpleStore.phpmethod='GET'> <tr><td valign='top'> <b>Choose a Category</b><br> <div align='center'> <select name='SearchIndex'> <option value='Books'>Books</option> <option value='DVD'>DVD</option> <option value='Music'>Music</option> </select> </div> </td></tr> <tr><td><b>Eneter Key Words</b><br> <input type='text' name='Keywords' size='40'/></td></tr> <input type='hidden' name='Action' value='Search'> <input type='hidden' name='ItemPage' value='1'> <input type='hidden' name='CartId' value=$CartId> <input type='hidden' name='HMAC' value=$HMAC> <tr align='center'><td><input type='submit'/></td></tr> </form> "); } ?> </table> <td> <?php if($_GET['Action'] == 'Search'){ if($_GET['Keywords'] == ''){ print("Please enter keywords for your search."); }else{ $keywords = urlencode($_GET['Keywords']); ItemSearch($_GET['SearchIndex'], $keywords, $_GET['ItemPage']); } } if($_GET['Action'] == 'SeeDetails'){ ItemLookup($_GET['ASIN'], $_GET['SearchIndex']); } if($_GET['Action'] == 'CartAdd'){ if($_GET['CartId'] != ''){ CartAdd($_GET['ASIN']); }else{ CartCreate($_GET['ASIN']); } } if($_GET['Action'] == 'Remove'){ removeFromCart($_GET['CartItemId']); } ?> </td> </table> <table width='100%'> <tr><td colspan="2"><font size="2px"><br><center>Copyright 2006, Simple Store<br>Product information and pictures Copyright Amazon</center></font></td></tr> </table> <?php function ItemSearch($SearchIndex, $Keywords, $ItemPage){ $request="http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=".KEYID."&AssociateTag=".AssocTag."&Version=2006-09-11&Operation=ItemSearch&ResponseGroup=Medium,Offers"; $request.="&SearchIndex=$SearchIndex&Keywords=$Keywords&ItemPage=$ItemPage"; //The use of `file_get_contents` may not work on all servers because it relies on the ability to open remote URLs using the file manipulation functions. //PHP gives you the ability to disable this functionality in your php.ini file and many administrators do so for security reasons. //If your administrator has not done so, you can comment out the following 5 lines of code and uncomment the 6th. $session = curl_init($request);这个是代码,执行到这里就报错了.TO:xuzuning(唠叨) 我把php_curl.dll,libeay32.dll,ssleay32.dll,都导入到系统目录下了,但是..
或者
function_exists()下
看是否已经支持CURL
请将支持库放在系统搜索路径中
<title>A Simple Store</title>
<table width='100%' cols='2' border='3px'>
<colgroup span='2'>
<col width='20%'></col>
<col width='80%'></col>
</colgroup>
<tr><td colspan='2'><center><h1>Simple Store</h1></center></td></tr>
<tr><td valign='top'>
<table width='100%' align='left' height='100%'>
<?php
define('KEYID','[YourAccessKeyIdHere]');
define('AssocTag','[YourAssocitaeTagHere]');
if($_GET['Action'] == 'Search'){
print("
<formname='SearchTerms'action=SimpleStore.phpmethod='GET'>
<tr><td valign='top'>
<b>Choose a Category</b><br>
<div align='center'>
<select name='SearchIndex'>
<option value='Books'>Books</option>
<option value='DVD'>DVD</option>
<option value='Music'>Music</option>
</select>
</div>
</td></tr>
<tr><td><b>Eneter Key Words</b><br>
<input type='text' name='Keywords' size='40'/></td></tr>
<input type='hidden' name='Action' value='Search'>
<input type='hidden' name='ItemPage' value='1'>
<input type='hidden' name='CartId' value=$CartId>
<input type='hidden' name='HMAC' value=$HMAC>
<tr align='center'><td><input type='submit'/></td></tr>
</form> ");
}
?>
</table>
<td>
<?php
if($_GET['Action'] == 'Search'){
if($_GET['Keywords'] == ''){
print("Please enter keywords for your search.");
}else{
$keywords = urlencode($_GET['Keywords']);
ItemSearch($_GET['SearchIndex'], $keywords, $_GET['ItemPage']);
}
}
if($_GET['Action'] == 'SeeDetails'){
ItemLookup($_GET['ASIN'], $_GET['SearchIndex']);
}
if($_GET['Action'] == 'CartAdd'){
if($_GET['CartId'] != ''){
CartAdd($_GET['ASIN']);
}else{
CartCreate($_GET['ASIN']);
}
}
if($_GET['Action'] == 'Remove'){
removeFromCart($_GET['CartItemId']);
}
?>
</td>
</table>
<table width='100%'>
<tr><td colspan="2"><font size="2px"><br><center>Copyright 2006, Simple Store<br>Product information and pictures Copyright Amazon</center></font></td></tr>
</table>
<?php
function ItemSearch($SearchIndex, $Keywords, $ItemPage){
$request="http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=".KEYID."&AssociateTag=".AssocTag."&Version=2006-09-11&Operation=ItemSearch&ResponseGroup=Medium,Offers";
$request.="&SearchIndex=$SearchIndex&Keywords=$Keywords&ItemPage=$ItemPage";
//The use of `file_get_contents` may not work on all servers because it relies on the ability to open remote URLs using the file manipulation functions.
//PHP gives you the ability to disable this functionality in your php.ini file and many administrators do so for security reasons.
//If your administrator has not done so, you can comment out the following 5 lines of code and uncomment the 6th.
$session = curl_init($request);这个是代码,执行到这里就报错了.TO:xuzuning(唠叨)
我把php_curl.dll,libeay32.dll,ssleay32.dll,都导入到系统目录下了,但是..
thinks!
我真是服了你了。
已经说了安装目录下有这三个dll文件,还在重复。
我跟LZ的情况是一样的,安装目录下的ext文件夹里面有这个文件,另外的两个文件在安装目录里面也有。
extension=php_openssl.dll 也打开就行了
Win7 64位拷贝libeay32.dll、ssleay32.dll(C:\AppServ\php5\)两个文件到Windows目录下
1.修改php.ini,将;extension=php_curl.dll前面的分号去掉
2.拷贝libeay32.dll、ssleay32.dll(C:\AppServ\php5\)两个文件到system32目录
3.重启Apache(services.msc)即可