
homer.favenir
Members-
Posts
272 -
Joined
-
Last visited
Never
About homer.favenir
- Birthday 12/08/1976
Profile Information
-
Gender
Male
-
Location
Manila, Philippines
homer.favenir's Achievements

Regular Member (3/5)
0
Reputation
-
thanks for the reply, the username and password given by the administrator is correct. updated code <?php $url = 'https://testapi.ssl.trustwave.com/3.0/'; $xmltosend = "<?xml version='1.0' encoding='UTF-8'?>\n". "<soap:Envelope xmlns:soap='http://www.w3.org/2001/12/soap-envelope' soap:encodingStyle='http://www.w3.org/2001/12/soap-encoding'>\n". "<soap:Body xmlns:m='https://testapi.ssl.trustwave.com/3.0/'>\n". "<request>\n". "<authentication>\n". "<username>username</username>\n". "<password>password</password>\n". "</authentication>\n". "<operation>getResellerProducts</operation>\n". "<params>\n". "<int>12345</int>\n". "</params>\n". "</request>\n". "</soap:Body>\n". "</soap:Envelope>\n"; $reqheader = "POST /index.php HTTP/1.1\r\n". "Host:www.trustwave.com\r\n". "Content-Type: application/soap+xml; charset=utf-8\r\n". "Content-Length: ".strlen($xmltosend) ."\r\n\r\n"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$xmltosend); // what to post curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $reqheader); curl_setopt($ch, CURLOPT_USERPWD, "username:password"); $result = curl_exec($ch); if($result === false) { echo 'Curl error: ' . curl_error($ch); } else { echo 'Operation completed without any errors'; } curl_close($ch); print $result; ?> i cant find the error...ive been searching the net but found no concrete solutions...
-
Can't Understand Why This Code is'nt Working
homer.favenir replied to JamesThePanda's topic in PHP Coding Help
you forgot the closing bracket of if (!isset($_POST['id'])){ -
hi everyone, can you please kindly check my code for error $xmltosend = "<?xml version='1.0'?>\r\n". "<soap:Envelope xmlns:soap='http://www.w3.org/2001/12/soap-envelope' soap:encodingStyle='http://www.w3.org/2001/12/soap-encoding'>\r\n". "<soap:Body xmlns:m='https://www.trustwave.com/'>\r\n". "<request>\n". "<authentication>\n". "<username>username</username>\n". "<password>password</password>\n". "</authentication>\n". "<operation>getResellerProducts</operation>\n". "<params>\n". "<int>12345</int>\n". "</params>\n". "</request>\n". "</soap:Envelope>\n"; $reqheader = "POST /index.php HTTP/1.1\r\n". "Host:www.trustwave.com\r\n". "Content-Type: application/soap+xml; charset=utf-8\r\n". "Content-Length: ".strlen($xmltosend) ."\r\n\r\n"; $url = 'https://testapi.ssl.trustwave.com/3.0/'; // fake - obviosly! $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, $xmltosend); curl_setopt($ch, CURLOPT_POST, true); // what to post curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $reqheader); curl_setopt($ch, CURLOPT_USERPWD, "username:password"); $result = curl_exec($ch); curl_close($ch); print $result; im getting this error Authorization Required This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required. anyone pleeeaassseee...!!! tia
-
hi, i tried curl $request = 'URL'; $method = 'myMethod'; $username = 'myusername'; $password = 'mypassword'; $rsId = 12345; $postargs = 'operation='.$method.'&rsId='.$rsId; $postFields = $postargs; $ch = curl_init($request); curl_setopt($ch, CURLOPT_URL, $request); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERPWD, "myUsername:myPassword"); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); $result = curl_exec($ch); curl_close($ch); print_r($result); but the result is blank, all blank page. anyone please guide me thanks in advance
-
Request Parameter: rsId Datatype: Integer Required: Yes Description: The reseller id Expected request: <request> <authentication> <username>username</username> <password>password</password> </authentication> <operation>getResellerProducts</operation> <params> <int>22</int> </params> </request> this is one of the part of the documentation. question is how am i going to use it to get the response? i searched the net and got the code above. but it returns no error but blank white webpage tia
-
hi, thanks for the reply, how am i going to use the curlopt_httpheader for this particular request? btw is this the correct format? <?php $request = "<?xml version='1.0'?><request> <authentication> <username>username</username> <password>password</password> </authentication> <operation>getResellerProducts</operation> <params> <int>22</int> </params> </request>"; $url = urlencode( "https://testapi.ssl.trustwave.com/3.0/"); // fake - obviosly! $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); // what to post curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $result = curl_exec($ch); curl_close($ch); print $result; ?> tia
-
hi, can anyone please check my code it has an error <?php $request = "<?xml version='1.0'?><request><br> <authentication><br> <username>username</username><br> <password>password</password><br> </authentication><br> <operation>getResellerProducts</operation><br> <params><br> <int>22</int><br> </params><br> </request></myXML> "; $url = "https://testapi.ssl.trustwave.com/3.0/"; // fake - obviosly! $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); // what to post curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $result = curl_exec($ch); curl_close($ch); print $result; ?> thanks!
-
this is an api of SSL getResellerProducts Get a list of all the available products, along with the price and cost of that product for the given reseller. Request Parameter Datatype Required Description rsId Integer Yes The reseller id Expected request: <request> <authentication> <username>username</username> <password>password</password> </authentication> <operation>getResellerProducts</operation> <params> <int>22</int> </params> </request> they sent me a copy of their api which will i use to integrate in a website. and i dont know where to start using their documentation of api. btw, theres more xml like that in their documentation any advice? thanks for helping
-
Hi, anyone knows where to start in learning API with php? i have this request <request> <authentication> <username>username</username> <password>password</password> </authentication> <operation>getResellerProducts</operation> <params> <int>22</int> </params> </request> and the response <?xml version="1.0" ?> <response> <params> <struct> <member name="price"><double>89.0</double></member> <member name="productId"><int>10</int></member> <member name="cost"><double>49.0</double></member> <member name="productName"><string>Basic Certificate</string></member> <member name="certType"><string>OV</string></member> </struct> <struct> <member name="price"><double>189.0</double></member> <member name="productId"><int>20</int></member> <member name="cost"><double>99.0</double></member> <member name="productName"><string>Enterprise Certificate</string></member> <member name="certType"><string>OV</string></member> </struct> <struct> <member name="price"><double>389.0</double></member> <member name="productId"><int>15</int></member> <member name="cost"><double>249.0</double></member> <member name="productName"><string>Wildcard Certificate</string></member> <member name="certType"><string>OV</string></member> </struct> <struct> <member name="price"><double>599.0</double></member> <member name="productId"><int>550</int></member> <member name="cost"><double>399.0</double></member> <member name="productName"><string>EV Certificate</string></member> <member name="certType"><string>EV</string></member> </struct> </params> </response> but i dont know how to where to start anyone who can guide me with this? tia
-
hi, how can i make a autoupdate currency table currency value CHF USD EURO KD (Kuwaiti Dinars) 1 Converted Value Converted Value Converted Value when the page loads, it will convert the currency and the value of CHF, USD and EURO are real time please kindly help tia
-
hi, how can i make a autoupdate currency table currency value CHF USD EURO KD (Kuwaiti Dinars) 1 Converted Value Converted Value Converted Value when the page loads, it will convert the currency and the value of CHF, USD and EURO are real time please kindly help tia