I know this title is rather confusing, but here it goes. I have a PHP cURL request and the return is in a string. Normally i can easily echo specific objects from the JSON response, but i have never dealt with string returns. Here is my php <?php $url = "http://profile.combatarms.nexon.net/en/api/ProfilePlayerV2/OG_KneeGro__"; $ch = curl_init($url); $headr = array(); $headr[] = "Host: profile.combatarms.nexon.net"; $headr[] = "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0"; $headr[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; $headr[] = "Accept-Language: en-US,en;q=0.5"; $headr[] = "Cookie: i18next=en; _ls_bid=__new__; device_id=a2b3c270-bb08-4afd-8839-4c794e71dded; fingerprintv1=655870065693bdf4ced7825e4fee1f7c4e7f8a37; ccc=US"; $headr[] = "Connection: keep-alive"; $headr[] = "Upgrade-Insecure-Requests: 1"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headr); curl_setopt($ch, …

Member Avatar
Member Avatar
+0 forum 2

OK, so in [this thread](https://www.daniweb.com/hardware-and-software/microsoft-windows/threads/507918/presentation-loads-with-error) I offered advice to visit the Microsoft troubleshooter here: https://support.microsoft.com/en-gb/help/927477/how-to-troubleshoot-a-damaged-presentation-in-powerpoint-2007-and-powerpoint-2010 and DaniWeb broke the link and struck a line through it to say it didn't exist, when it quite clearly does. It may well break again here, let's see. I suspect that DaniWeb isn't handling long URLs very well. I ended up doing a Bit.ly on it so the chap can still get to the site, but I'd much rather have left the original so he knows he is going to Microsoft...

Member Avatar
Member Avatar
+1 forum 25

I have a form that creats a json array from user input data. Array ( [full_name] => First Name + Last Name [company_name] => Company Name [email] => Email [free_trial] => trial (Yes/No) [quota] => quota [contract] => 0 (0/1) [per_gb] => cost per gb [per_month] => contract length in months [wanaccel] => No (Yes/No) ) I need to send that to a php curl file so that it can be sent to an ip address. **How do I populate the curl data array from that json file?** Here is where I am starting with the curl page. <?php $url …

Member Avatar
Member Avatar
+0 forum 6

How to store the following curl_exec output into mysql table? sent,success,114661698,709081462,+919900123456 sent,success,134707665,937687314,+917795987654 Eg: var1='sent' var2='success' var3='114661698' var4='709081462' var5='+919900123456' --------------------------------------------------- var1='sent' var2='success' var3='134707665' var4='937687314' var5='+917795987654' Thanks in advance

Member Avatar
Member Avatar
+0 forum 1

Hi everyone, I really hope that you can help me diagnose an issue with my new API. I'm having the following issue: I'm not happy with the performance of the app client at http://app.dazah.com that connects to it ... It uses cURL to issue about 3-4 API requests per page to https://www.dazah.com/api, and half the requests are always speedy, and the other half of the requests take a ridiculously long time. (Half take about 150 seconds per request and the other half take about 800 seconds per request, so every page takes at least 1.5-2 full seconds to load). If …

Member Avatar
Member Avatar
+0 forum 6

Hello! I'm making cURL request to neteller API and it returns 401 not authorized. My IP is whitelisted in neteller test account. I have the following code: $url = 'https://test.api.neteller.com/v1/oauth2/token; $clientId = NETELLER_CLIENT_ID; $clientSecret = NETELLER_CLIENT_SECRET; $grantType = 'grant_type=client_credentials'; $curl = curl_init($url); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_USERPWD, $clientId.":".$clientSecret); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $grantType); $response = curl_exec($curl); if (curl_error($curl)) { curl_close($curl); throw new \Exception('System error. Can not get neteller token'); } curl_close($curl); $jsonResponse = json_decode($response, true); // Convert the result from JSON format to a PHP array return $jsonResponse; But when I run cURL …

Member Avatar
Member Avatar
+0 forum 2

By this script you can remotely login into facebook account with your password and username and fetch/send data.

Member Avatar
Member Avatar
+2 forum 12

Hello, I am trying to understand PayPal IPN proccess. I have built this simple script to test with the IPN simulator in the developer section of PayPal. I have tried different type of transaction status but it keeps returning VERIFIED. Can someone please explain to me how does this work? Thanks, Farris <?php require_once('../includes/main.php'); // Notify command $request = "cmd=_notify-validate"; // Prepare the URL to send via cURL foreach ($_POST as $key => $value){ if(function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()){ $value = urlencode(stripslashes($value)); }else{ $value = urlencode($value); } $request .= "&$key=$value"; } // Initial cURL $ch = curl_init(); // Set opt curl_setopt($ch,CURLOPT_URL,"https://www.sandbox.paypal.com/cgi-bin/webscr"); //curl_setopt($ch,CURLOPT_URL,"https://www.paypal.com"); …

Member Avatar
Member Avatar
+0 forum 1

Hello Daniweb, I was wondering how come a cURL API I made to call a function from my other website (but on the same hosting plan) no longer works. I even tried making a test API to call in the same directory, eg... :api.php <?php die(json_encode("something")); ?> :testing.php <?php $url = "http://mywebsite.com/api.php"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); $result = curl_exec($ch); if ($result === false) { echo "_error_".curl_error($ch); } else if ($result == "1") { echo "success"; } else { echo $result; } curl_close($ch); ?> However it's really weird, if I try that same script from testing.php but on another …

Member Avatar
Member Avatar
+0 forum 4

I want to learn how HTTP PUT method is used with PHP? I googled at the web and found some tutorials about it with cURL. But i dont know how to use it (Like REST API). Can anyone help me? Thank in advance

Member Avatar
Member Avatar
+0 forum 1

I am trying to use a sms gateway app for android called SMSGateway with a http header request using curl as below; $curl_handle=curl_init(); curl_setopt($curl_handle, CURLOPT_URL,"http://192.168.1.2:9090/sendsms?phone=$phone&text=$message1&password=xxxxxxxx"); curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 10000); curl_setopt($curl_handle, CURLOPT_TIMEOUT,50000); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:36.0) Gecko/20100101 Firefox/36.0'); $query = curl_exec($curl_handle); if($query){echo "Message Sent to $phone !<br>";}else{echo "Message Not Sent to $phone !<br>";echo 'Curl error: ' . curl_error($curl_handle)."<br>";} curl_close($curl_handle); This works perfectly fine on my local system but it gets timed out when executing from server... I need to know what is wrong...is it a curl issue ? should i use file_get_contents ? Actually I did …

Member Avatar
Member Avatar
+0 forum 8

Hey guys, this seems to be a thorn in my side. I've been working on scraping a website which uses aspx and has eventvalidation/viewstate inputs. Every other scraping experiment I've made was not this difficult. Maybe one of you geniuses here at Daniweb has an idea of how to solve this? I've managed to get Selenium/PHPUnit to automate the process of opening the browser, typing in the URL, filling out the required fields (todays date), and then landing on the page I need to scrape and can get the viewstate and eventvalidation values from any of those pages. I've been …

Member Avatar
Member Avatar
+0 forum 2

I'm trying to make a curl through php below is the command line : curl -i -H "Accept: application/json" -d "{"username": "divmesselibrary", "password": "677Sure1@"}" https://openlibrary.org/account/login Please I need your help

Member Avatar
Member Avatar
+0 forum 5

http://api.ean.com/ean-services/rs/hotel/v3/list?minorRev=4&cid=55505&apiKey=5q4gzx43g6ukcrq798z2hz75&customerSessionId=&locale=en_US&currencyCode=USD&xml=<HotelListRequest><city>new%20delhi</city><RoomGroup><Room><numberOfAdults>2</numberOfAdults><numberOfResults></numberOfResults></Room></RoomGroup></HotelListRequest> when i call api directly to browser i got right data in xml format. but when i call it through curl.. sometime i get data in json format or sometimes no data.. [CODE] $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"http://api.ean.com/ean-services/rs/hotel/v3/list?minorRev=4&cid=55505&apiKey=5q4gzx43g6ukcrq798z2hz75&customerSessionId=&locale=en_US&currencyCode=USD&xml=<HotelListRequest><city>new%20delhi</city><RoomGroup><Room><numberOfAdults>2</numberOfAdults><numberOfResults></numberOfResults></Room></RoomGroup></HotelListRequest>"); curl_setopt($ch, CURLOPT_FAILONERROR,1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT, 15); $retValue = curl_exec($ch); curl_close($ch); echo $retValue;[/CODE] help me. thanks in advance

Member Avatar
Member Avatar
+0 forum 6

Hello Guys, I apologized if I may have misplaced this post as I cannot see CURL on any category. Here is my situation. I am trying to create a batch file which will pull up information from a fleet of devices via its web interface. I am using CURL to do that. The output will be 1 file for each device. I created a text file that lists all the IP address of the devices. Below is the command I usedd for just one device: curl http://<IP>/cgi-bin/history > <nameOFfile.txt> Any help will be much appreciated. Thanks.

Member Avatar
Member Avatar
+0 forum 3

I have some code that takes a URL and downloads it using CURL. Here's the code: $url= $row['loc']; $path = 'tmp/'; $path .= rand(100,999); $path .= $row['name']; $fp = fopen($path, 'w'); $ch = curl_init($url); curl_setopt($ch, CURLOPT_FILE, $fp); $data = curl_exec($ch); curl_close($ch); fclose($fp); $downloadarray[] = array($path, $row['name']); However the file is not correctly downloading as an image even though the filename is, for example paradise-island.jpg. Do I need to specify a minetype somewhere? I belive this is also causing problems further down the code, because despite the fact this code is run twice on separate files this code: foreach ($downloadarray as …

Member Avatar
Member Avatar
+0 forum 10

This is a SMS DLR application from http://www.smsgatewaycenter.com which is sent by them to my client's url and I need to configure for my client the same from my client's url to his reseller's url. This script uses every 1 hour to post data to my client's reseller/customer. So, it piles up with thousands of report to send. I am trying to send dataset which is more than 10000 looped rows using curl. I have tried with `curl_multi_exec` and `curl_setopt_array`. No matter what, it sends out one by one which is causing load on server. Is there a way, where …

Member Avatar
Member Avatar
+0 forum 9

Hi all! I am trying to post from a form to an URL, using cURL. I have managed to do the posting bit, and my data is coming thew to the URL just like I wanted. Here is my code: <?php //create array of data to be posted $post_data['Application.Ssn'] = 'value'; $post_data['Application.Not_Living_Legal_Address'] = 'value'; $post_data['Application.Cellphone'] = 'value'; $post_data['Application.Telephone'] = 'value'; $post_data['Application.Email'] = 'value'; $post_data['Application.Marital_Status'] = 'value'; $post_data['Application.Children_Count'] = 'value'; $post_data['Application.Housing'] = 'value'; $post_data['Application.Tendency'] = 'value'; $post_data['Application.Employment'] = 'value'; $post_data['Application.Employer'] = 'value'; $post_data['Application.Hired_From'] = 'value'; $post_data['Application.Net_Income'] = 'value'; $post_data['Application.Total_Debt'] = 'value'; $post_data['Application.Loans_Debt'] = 'value'; $post_data['Application.Loans_Count'] = 'value'; $post_data['Application.Total_Debt_Expenses'] = 'value'; $post_data['Application.Application_Type'] …

Member Avatar
Member Avatar
+0 forum 1

Hello, I am getting a weird error when i try to run this array: //leafly api keys $appID ='Blah'; $appKEY = 'blah'; //init curl $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://data.leafly.com/strains/".strtolower($data)); //change the strain dynamically of course for your app curl_setopt($ch,CURLOPT_HTTPHEADER,array('APP_ID:'.$appID,'APP_KEY:'.$appKEY)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); //Clean it into an php array object and set var $cleaned_response = json_decode($output,true); foreach($cleaned_response as $image){ //continue; echo'<img height="100" width="100" src="'.$image['photos'].'"/>'; //<--Line 73 } // Look at it print_r($cleaned_response); // close curl resource to free up system resources $output = curl_init(); then when i run the script, i get this: <b>Warning</b>: Illegal string offset …

Member Avatar
Member Avatar
+0 forum 2

Server information: Ubuntu 14.04 Apache2 I installed PHP5 on my webserver and tried to run a script that contained a call to the function curl_init(). The server responded with an error indicating that the function curl_init() was undefined. I installed PHP-CURL and restarted my webserver and encountered the same error. I created an info.php file containing a call to the function phpinfo() and checked to see that the CURL extension was installed and not only did the page say that the module was installed but it also said that CURL was enabled. I'm still recieving an error saying that curl_init() …

Member Avatar
Member Avatar
+0 forum 1

Ok i have a daily csv file that i am trying to get python to post to my database every day. I have used curl befor to post it but i want to set python up so that it post it for me is there a way to do this that is simple to under stand for a new python coder.

Member Avatar
Member Avatar
+0 forum 2

I am new to cURL and im trying to get it to add new contacts to my database. i have all my information right but when it reads my csv file it tells me no email column was found in the file you are uploading> I know for a fact that i put my email column in it could someone tell me what i could be doing wrong and i will post my curl code if it is needed.

Member Avatar
Member Avatar
+0 forum 1

Hello I made some tries to get info from http://portal.onrc.ro The workflow is like: 1. Login => redirects to a page 2. Get the form (GET /ONRCPortalWeb/appmanager/myONRC/wicket?p=bpi.buletinBpiOnline) 3. Change the search type (POST /ONRCPortalWeb/appmanager/myONRC/wicket?_nfpb=true&_windowLabel=TestWicket03_1&_urlType=action&wlpTestWicket03_1__wu=%2FONRCPortalWeb%2Fappmanager%2FmyONRC%2Fwicket%2F%3Fwicket%3Ainterface%3D%3A1%3AformCautare%3A%3AIFormSubmitListener%3A%3A) => redirect to an interface (GET /ONRCPortalWeb/appmanager/myONRC/wicket/?wicket:interface=:<@interface_NO>:1:::) After changing the search type, i don't get redirected. It triggers an error on the search page. I checked the request methods and parameters, i also checked the cookies, and i can't find anything wrong. Can anyone help here?

Member Avatar
+0 forum 0

Ok so i didnt know where to post this but i am getting two errors while useing cURL. The first says cURL: (26) coudn't open file "test.csv". The second one keeps saying please upload a file. I have been trying to fix this for over a hour now and can not get a different result if someone could tell me what im doin wrong that would be amazing. curl -F 'source="Test Contacts"' -F 'filename=@test.csv' -F 'site_id=XXXXX' -F 'user_id=XXXXX' -F 'key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' -F 'format=csv' -F 'action=add' -F 'listname=TEST List For API Integration' -F 'email=XXXXXXXXXXXXXXXXXXXXX'http://app.example.com/mail/subscriber_upload/index/

Member Avatar
+0 forum 0

Hi, I'm developing a software in C++/Qt5 and I would like to create a button, which when u click on it, a "status" is posted on the user own wall. So I created a facebook app on https://developers.facebook.com/ but I don't know how to configure it. Also I tried to run via my program this cURL command : curl -F 'access_token=XXX' -F 'message=test' http://graph.facebook.com/me/feed and I have this error : {"error":{"message":"An active access token must be used to query information about the current user.","type":"OAuthException","code":2500}} I don't know what it exactly means, but I think it's because the user have to …

Member Avatar
Member Avatar
+0 forum 1

This is regarding paypal through Curl. I am trying to access paypal by using below code. The code is working fine in one server. After moving this code to live server, getting the below error. Can anybody tell me the solution for this. $API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp"; $version = urlencode('76.0'); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $API_Endpoint); curl_setopt($ch, CURLOPT_VERBOSE, 1); // Turn off the server and peer verification (TrustManager Concept). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); // Set the API operation, version, and API signature in the request. $nvpreq = "METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_"; // Set the request as …

Member Avatar
Member Avatar
+0 forum 1

I have this code for my site, the zip is generating (but corrupted because of the 0 byte files...) but the actual curled files (in the tmp/ directory) are there, just with nothing in them. if ($_GET['download']== 'true'){ $downloadarray = array(); while($row = mysql_fetch_array($res)){ $url= $row['loc']; $path = 'tmp/'; $path .= rand(100,999); $path .= $row['name']; $fp = fopen($path, 'w'); $ch = curl_init($url); curl_setopt($ch, CURLOPT_FILE, $fp); $data = curl_exec($ch); curl_close($ch); fclose($fp); echo print_r($data); $downloadarray[] = array($path, $row['name']); } $zipname = rand(0,9999) . 'download.zip'; $zip = new ZipArchive; $zip->open($zipname, ZipArchive::CREATE); foreach ($downloadarray as $file) { $zip->addFile($file['0'], $file['1']); } $zip->close(); header('Content-Type: application/zip'); header('Content-disposition: …

Member Avatar
Member Avatar
+0 forum 7

I wrote this code to integrate with filepicker.io, it takes the URL of the file and gets the header information: $info = curl_init() or die('error 1'); curl_setopt($info, CURLOPT_RETURNTRANSFER, 1); //curl_setopt($info, CURLOPT_PORT , 8089); curl_setopt($info, CURLOPT_URL, $url); curl_setopt($info, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($info, CURLOPT_NOBODY, true); //curl_setopt($info, CURLOPT_SSL_VERIFYPEER, 0); curl_exec($info); if(!curl_errno($info)){ $response = curl_getinfo($info); echo "<pre>"; echo var_dump($response); echo "</pre>"; }else{ echo "error!"; echo "<br>" . curl_error($info); } And here is a response: array(26) { ["url"]=> string(55) "https://www.filepicker.io/api/file/CjDfxG0WSmGiY3O2eKDE" ["content_type"]=> string(9) "image/png" ["http_code"]=> int(200) ["header_size"]=> int(840) ["request_size"]=> int(86) ["filetime"]=> int(-1) ["ssl_verify_result"]=> int(0) ["redirect_count"]=> int(0) ["total_time"]=> float(2.805141) ["namelookup_time"]=> float(0.442366) ["connect_time"]=> float(0.46781) ["pretransfer_time"]=> float(0.873621) ["size_upload"]=> float(0) ["size_download"]=> …

Member Avatar
Member Avatar
+0 forum 3

Hi Everyone, I'm not sure if I may be in the wrong venue to post as this would have to do with PHP, CURL and SSL, so I've decided to place the question here. Please feel free to let me know if the question should be dropped in some other location… My company has been using a ticketing system that is hosted on another server being cloud based which uses a RESTful style API over HTTP using XML. They also use HTTP Basic Authentication over SSL to secure data. For any options worth knowing, the cloud based ticketing system cannot …

Member Avatar
Member Avatar
+1 forum 3

The problem is that, Server doesn't not able to open this url: https://gw1.cardsaveonlinepayments.com:4430/ OR https://gw3.cardsaveonlinepayments.com:4430/?WSDL When you run this url from your browser then it would work and show you some kind of data like: "GetCardType CardDetailsTransaction CrossReferenceTransaction ThreeDSecureAuthentication" But when we try open the url using script then server show warning: "failed to open stream: Connection refused" Same error with cURL, SOAP or fopen. Please check here: http://thelightroomclothing.com/log/test.php Port 4430 is enable on server. I am not sure which settings to ajdust on server to make it work. Please share your experience if you could help.

Member Avatar
Member Avatar
+0 forum 2

The End.