
homer.favenir
Members-
Posts
272 -
Joined
-
Last visited
Never
Everything posted by homer.favenir
-
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
-
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
-
does it return boolean?
-
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
-
anyone knows how to copy files from client to server... a shared folder will be copied to a server... TIA
-
and im wondering when i use computer name (hardcoded) it can see the directory of the client, but with ip address it didnt. but, when i use this script it gives me different computer name... echo $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])."<br>"; echo $_SERVER['REMOTE_ADDR'] not my real computer name i dont know why and how... please advice TIA
-
it has an error Warning: scandir(//192.168.200.109/NewFolder/) [function.scandir]: failed to open dir: No error in C:\xampp\htdocs\laboratory\scandir.php on line 30
-
hi, how can i scandir or read the files of a client's folder. the client have a shared folder and i want my program to scan it for files $dir = "\\\\".$_SERVER["REMOTE_ADDR"]."\\NewFolder"; $dir = scandir($dir); foreach($dir as $item){ echo $item."<br>"; } TIa
-
hi, is there a way i can browse or get the directory or folder only and not the file? i just want to browse the directory and get the files from it. TIA
-
ftp? on each work station? the scenario is this, all users will access the web app, then the server will scandir the shared folder to upload it to server TIa
-
hi, how can i scandir the clients directory? i need a script that when i click a button it will upload all the files in the directory $dir = "\\\\".$_SERVER["REMOTE_ADDR"]."\\NewFolder"; $dir = scandir($dir); foreach($dir as $item){ echo $item; } its not working error: its in intranet and the folder is already fully shared TIA
-
my text box is not dynamic, when i only edit it, the script should know whether it has been changed or not. im submitting it with post the textbox has already value, because it was only in edit mode. tia
-
hi, i want my form to know whether its textbox is unchange or not. if($textbox == 'unchanged'){ //do this }else{ //do this } ive been searching all day , but cant find the exact solutions... TIA
-
i already make it work for just decompressing a whole zip file. so there is no problem in permission or path. or even in server apache or IIS.
-
i cant find where my file go... $file = "AG3421226.WDB09.02.010.pdf"; $zip = new ZipArchive; $res = $zip->open('\\\\asecasiagsd\\AGS\\AGS\\WIP\\PROOF_QA_CSR\\AG3421226.WDB09.02.010.zip'); if ($res === TRUE) { $zip->extractTo('\\\\asecasiagsd\\AGS\\AGS\\WIP\\PROOF_QA_CSR\\extract', $file); $zip->close(); echo 'ok'; } else { echo 'failed'; }