Jump to content

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

Regular Member (3/5)

0

Reputation

  1. 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...
  2. you forgot the closing bracket of if (!isset($_POST['id'])){
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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!
  8. 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
  9. 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
  10. 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
  11. 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
  12. hi, i want to make a printer controller system in php the printer is in the host, the client will request for permission to print. the host has the ability to allow and disallow a client to print. is there a way? where can i start? tia
  13. hi to all, is there a way i can search an array in a line $tag = array("<html>","<title>","</title>","<head>","</head>","<meta","<body","</body>","</html>"); $line = "<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>"; $pos = strpos($tag, $line); i want to search the array entities in the lines, without using the foreach function anyone please... tia
  14. anyone knows how to copy files from client to server... a shared folder will be copied to a server... TIA
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.