US 14111 1 This is the item description. Days_7 San Jose, CA PaymentSeeDescription 357 1 0 5.0 1.0 Test Auction, TESTBAIT23 1 0 2 1.00 "; // header("Content-Type: application/xml"); //$response = sendRequest($request, 1, "AddItem"); //echo $response; $itemInfo = array(); addItem($itemInfo); function addItem($itemInfo) { global $token; $itemInfo[] = array("DetailLevel" => "1"); $itemInfo[] = array("SiteId" => "0"); $itemInfo[] = array("Verb" => "AddItem"); $itemInfo[] = array("ErrorLevel" => "1"); $itemInfo[] = array("RequestToken" => $token); $request = "\n"; $request .= "\n"; foreach ($itemInfo as $key => $value) { $request .= "\t<{$key}>{$value}\n"; } $request .= ""; } function sendRequest($request, $detailLevel, $callName) { global $devID, $appID, $cert, $token, $endPoint; $requestLength = strlen($request); $headers = array(); $headers[] = "X-EBAY-API-COMPATIBILITY-LEVEL: 353"; $headers[] = "X-EBAY-API-SESSION-CERTIFICATE: $devID;$appID$cert"; $headers[] = "X-EBAY-API-DEV-NAME: $devID"; $headers[] = "X-EBAY-API-APP-NAME: $appID"; $headers[] = "X-EBAY-API-CERT-NAME: $cert"; $headers[] = "X-EBAY-API-CALL-NAME: $callName"; $headers[] = "X-EBAY-API-SITEID: 0"; $headers[] = "X-EBAY-API-DETAIL-LEVEL: $detailLevel"; $headers[] = "Content-Type: text/xml"; $headers[] = "Content-Length: $requestLength"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $endPoint); curl_setopt($ch, CURLOPT_HEADER, false); // Don't bother giving us the header back curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // Send our header curl_setopt($ch, CURLOPT_POST, true); // Send a POST curl_setopt($ch, CURLOPT_POSTFIELDS, $request); // This is the post to send curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Return the result, rather than printing it out $data = curl_exec($ch); curl_close($ch); return $data; } ?>