...

View Full Version : Getting unexpected T_DNUMBER, but why??



kaidine
11-22-2011, 06:48 AM
Hi all,

This is my first shot at using PHP and cURL. I am getting the error "unexpected T_DNUMBER" on line 4 and I don't know why.



<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.example.com/gateway_cvn/xmlpayment.asp");
curl_setopt($ch, CURLOPT_POST, "<?xml version="1.0" encoding="ISO-8859-1"?><root><CustomerID>1</CustomerID></root>");
curl_exec($ch);
curl_close($ch);
?>


Does anyone know why?

Adee
11-22-2011, 07:21 AM
curl_setopt($ch, CURLOPT_POST, "<?xml version="1.0" encoding="ISO-8859-1"?><root><CustomerID>1</CustomerID></root>");

should be


curl_setopt($ch, CURLOPT_POST, "<?xml version='1.0' encoding='ISO-8859-1' ?><root><CustomerID>1</CustomerID></root>");

kaidine
11-22-2011, 08:25 AM
Yeah I thought it a bit strange to. I tried with a space, but it still doesn't work. I was going off what w3schools.com outlined.

I just removed it. I didn't need it anyway.

kaidine
11-22-2011, 08:34 AM
For some reason its not letting me thank you via the green button, so thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum