w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
PHP cURL https not working on new VPS
Simple, deactivate SSL. It already happened to me, and this is what i did: curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); Don't forgot to check openssl.so or openssl.dll extensions too. This will also allow Man In The Middle attacks, it's not recommended.

Categories : PHP

PHP Curl Login https
Try comparing the HTTP headers sent by your CURL script to those headers sent by your browser (use chrome dev tools). Maybe the remote server is refusing you due to some missing header info. Ensure cookie files have full permissions. From php.net: When specifing CURLOPT_COOKIEFILE or CURLOPT_COOKIEJAR options, don't forget to "chmod 777" that directory where cookie-file must be created.

Categories : PHP

PHP cURL returns FALSE on HTTPS
You can prevent cURL from trying to verify the SSL certificate by using CURLOPT_VERIFYPEER. Also set the action in the URL: $ch = curl_init(); $data = array('user' => 'xxx', 'password' => 'yyy'); curl_setopt($ch, CURLOPT_URL, 'https://coinroll.it/getbalance'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $result = curl_exec($ch); echo $result;

Categories : PHP

how to save out result of curl open url https
If you want the response to be put in a variable, you need to do: curl_setopt($Curl_Session, CURLOPT_RETURNTRANSFER, 1); $a8 = curl_exec($Curl_Session); Without this option, the response is passed through to the client (unless you use CURLOPT_FILE, which puts it in a file).

Categories : PHP

php curl doesent work on fb graph with https
the problem is with your curl request as seen above with status coce = 0 try this func to see what the error is. string curl_error ( resource $ch ) Returns a clear text error message for the last cURL operation. most likely, its because of incorrect url string. make sure you encode the query string values before making the request with that url.

Categories : PHP

php-fpm crashed when curl or file_get_contents request a https url
Try adding these two: curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); They will prevent the verification of the SSL certificate. This might be the issue as the verification might fail. Unless it's mandatory to verify the source, always add these 2 lines when downloading data with cURL. PS: Not sure this will help you though.

Categories : PHP

cURL as proxy, deal with HTTPS/CONNECT method
If I understand correctly, you're writing a HTTP proxy server in PHP. The CURLOPT_HTTPPROXYTUNNEL option is used when you want to connect to a proxy server using the PHP cURL library and use CONNECT instead of GET. In this case it's not relevant. When your proxy server (PROXY) receives the CONNECT request, it should connect to the specified host (ENDPOINT) using socket_create and socket_connect. Once the connection is established, let the client (CLIENT) know by sending HTTP/1.1 200 Connection Established. After that, you'll want to copy all data that the ENDPOINT sends to PROXY to the CLIENT and all data that the CLIENT sends to PROXY to the ENDPOINT. Using cURL like in your example will create multiple connections. To handle multiple connections, I've used pcntl_fork, which forks a ne

Categories : PHP

Unable to make https requests via proxy using,php and curl
Try changing: curl_setopt($handle, CURLOPT_PROXYPORT, 80); to: curl_setopt($handle, CURLOPT_PROXYPORT, 443); Since https traffic is on port 443.

Categories : PHP

Perform soap request via https with self-signed certificate by cURL
The error doesnt seem to be on the client side but on the server side. The server says that some security check failed. If it was a client error, you would get nothing but an error by cURL. You get an XML answer. You should look at the server side.

Categories : PHP

Using curl to login into https site not working, suspect godaddy verification having something to do with it
You could try this function if you like. It's helped me out a few times. If you still have trouble try fiddler2 (fiddler2.com) to check for all of the headers and attempt to replicate them in PHP ini_set('max_execution_time', 300); $fields['col_email'] = "meahmatt@aol.com"; $fields['col_password'] = "testaccount"; $fields['action'] = "login"; $fields['form1'] = ""; $url = "https://www.voip.ms/m/login.php"; $html = get_html($url,$url,$fields); function get_html($url,$ref='',$fields=array(),$cookie='cookie.txt'){ // $proxyAddress = '127.0.0.1:8888'; $ch = curl_init(); touch($cookie); $header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,"; $header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; $header[] = "Cache-Control: max-age=0";

Categories : PHP

Command line curl to PHP curl and PHP curl returning blank file
You didn't set the POST option: curl_setopt($ch, CURLOPT_POST, 1); If that doesn't work: I notice you're connecting via SSL. Unless you have all the certificates sorted, try this curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); But read up on what this means.

Categories : PHP

PHP cURL function related - what is the difference between browser visit, linux curl command and PHP cURL function?
Your first two examples you are making HTTP GET requests. In your failing php/curl example, you are using HTTP POST. I suspect you Try changing the CURLOPT_POST option: curl_setopt($ch, CURLOPT_POST, 0); The following example works for me. Notice I've added the query parameter to the url and changed the HTTP method to GET. <?php $url = "http://<INSERT URL HERE>?list=sh600123"; // ^ use query params instead of post values... $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_VERBOSE, 1); $result = curl_exec($ch); var_dump($result);

Categories : PHP

How to convert curl file post from command line into PHP cURL
You don't need to open a handle for curl, just have $data = array( 'file' => '@move_file.MOV' ); Curl will see the @ and treat it as a file upload attempt. You also don't have to do http_build_query() either. Curl can accept an array directly and do the query building itself: curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

Categories : PHP

Facebook like button https issue: protocol mismatch from http and https
Reviewing the js code on Facebook there are multiple urls containing hard coded strings for http://static .../rsrc.php it's possible those are the files triggering the error. This may be something Facebook needs to update. On a side note, it may be possible to download that js file from Facebook and store it on your server and remove the hard coded http string. I would test this further but I am on my phone at the moment.

Categories : Facebook

when using https, https can't find codeigniter controllers. Running Centos
Change this line : RewriteRule ^(.*)$ index.php?/$1 [L] to : RewriteRule ^(.*)$ /index.php?/$1 [L] The .htaccess would otherwise be redirected relatively to a index.php in the join folder, which off course is not there.

Categories : PHP

How do you enable https and http->https redirects in ring / compojure
It's possible to serve HTTPS with clojure, but it's much more popular to put nginx or something like that in front of your ring server. If you can figure out how to configure jetty, though, run-jetty clearly supports SSL.

Categories : Http

Once https page is visited, all subsequent pages are served from https
ok I think I found the reason. The links I am visiting are relative, so "/forum" for example. Once https is in the browser it seems like visiting a relative address is leaving the root as https:// and appending the relative path. I believe the fix here will be to use the full path for the link instead of relative.

Categories : Htaccess

How to Implement Command Line CURL into PHP CURL Request
In the $data array, it should be: CURLOPT_POSTFIELDS => $fields And to set all the options it should be: curl_setopt_array($ch, $data); This line doesn't do anything: $options = $fields + $defaults; You can't use + on arrays, and you never set $defaults. For authentication, you need to use the option: CURLOPT_USERPWD => 'apiuser:yru3472825fhj' instead of putting them in $data.

Categories : PHP

How can i convert links to https when server providing https?
If you remove the http:// portion and use instead: <script type="text/javascript" src="//static.monstermmorpg.com/js_files/jquery-1.9.1.min.js"></script> It should request based on the current scheme being used.

Categories : C#

Redirect all http AND https non-www URLS to https://www.xyz.com via htaccess
In case anyone from the future (HELLO PEOPLE OF THE FUTURE) stumble across this, I asked the same question and had it answered over at Server Fault. Short version: impossible. Long version: http://serverfault.com/questions/523199/redirect-all-http-and-https-non-www-urls-to-https-www-example-com-via-htaccess

Categories : Htaccess

Can https fallback to http and security level of https
No, HTTPS never falls back to HTTP automatically. It would take deliberate action by the user. If you're just going to a web page by putting its URL into the address bar, this is easy; for form submission it's harder. Yes, sending plain text over SSL is fine. In fact, sending a hashed password doesn't really increase security much at all -- if someone manages to sniff the connection and gets the hashed password, that's all they need to be able to login to the site. It has one small advantage: if the user uses the same password at multiple sites, learning the hashed password for one site doesn't help them get into another site that uses a different (or no) hash. And it's not likely to be feasible to send salted hashes, since the client doesn't know the salt. A cnonce adds an extra level

Categories : Asp Net

Page curl in tabbed application (curl all but tab bar)
Standard curl effects are on modalViewControllers, if you use a modalVC it will take the whole screen. You will have to find another way to do the effect. Have a look at this https://github.com/xissburg/XBPageCurl Basically, XBPageCurl can be used in two different ways. It can be used to curl a view and show another view behind it where the user can interact with its elements and then uncurl the view back, pretty much like in the Google Maps app (Simple Curl sample). It can also be used to flip pages like in iBooks, where the user can drag the border of a page and release to flip it or cancel the flip (Page Curl sample).

Categories : IOS

cURL- how to submit youtube captcha using cURL
You don't. The whole point of the captcha is to limit access to humans using web browsers and to block automated tools like the one you appear to be trying to write. Use the APIs provided instead.

Categories : PHP

HTTPS GET request to https://www.googleapis.com/plus/v1/people/me
Create a Google_Oauth2Service object (put it under the $plus initialization), like: $client = new Google_Client(); $plus = new Google_PlusService($client); $oauth2 = new Google_Oauth2Service($client); and after succesfully authenticating the client use: $userInfo = $oauth2->userinfo->get(); $email = $userInfo['email'];

Categories : PHP

Log in with cURL and make an other request with cURL after
Taken from php documentation: CURLOPT_COOKIESESSION: TRUE to mark this as a new cookie "session". It will force libcurl to ignore all cookies it is about to load that are "session cookies" from the previous session. By default, libcurl always stores and loads all cookies, independent if they are session cookies or not. Session cookies are cookies without expiry date and they are meant to be alive and existing for this "session" only. So in other words, remove CURLOPT_COOKIESESSION from your second part code and your code should work.

Categories : PHP

IHttpHandler to redirect "https://example.com" to "https://www.example.com"?
If you use IIS7, you might want to try URL Rewrite Module. http://www.4guysfromrolla.com/articles/072810-1.aspx http://www.jppinto.com/2010/03/automatically-redirect-http-requests-to-https-on-iis7-using-url-rewrite-2-0/

Categories : Asp Net

C curl/curl.h Error
Remove this function prototype from inside function. It's invalid C code. char *curl_easy_escape( CURL * curl, char *Buffer, x); BTW,you main function should returns an int.

Categories : C

C/C++ in Linux for curl/curl.h
Here is how you should proceed Install curl from this link http://curl.haxx.se/download.html if you have already installed this go on to this page Then follow this tutorial http://curl.haxx.se/libcurl/c/libcurl-tutorial.html

Categories : C

How to redirect from url: https://myfavourite.test.com/Account/LogOn?ReturnUrl=/ to url: https://myfavourite.test.com/ using IIS7.5
I followed the steps mentioned in the below mentioned article and it helped me. http://www.trainsignal.com/blog/iis7-url-rewrite-extension-on-windows-server-2008 I used the Redirect option and then added a Blank rule with the following regular expression: account$|account/(?!LogOff) and that helped me to resolve the redirection issue.

Categories : Asp Net Mvc

apache redrict 301 from https://www.domain.com to https://domain.com
If you request https://www.meinedomain.de/ and your cert isn't authorized for www.meinedomain.de, then you'll get a security warning regardless of how you redirect. The redirect can only happen after they accept the security exception. Make sure you've put those rules in the SSL vhost's config, not the non-SSL one. Apache usually has them separate. If that still doesn't work, you can try just putting this in an htaccess file in your document root: RewriteEngine On RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^www.meinedomain.de$ [NC] RewriteRule (.*) https://meinedomain.de%{REQUEST_URI} [R=301,L]

Categories : Apache

using PHP cURL in C++
libcurl is available on BB10, and it is already in the sdk. Don't forget to add LIBS += -lcurl to your .pro file There's a lot of examples on their site. Save for some options that should translate nicely from your PHP code, it should almost look like that. #include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* example.com is redirected, so we tell libcurl to follow redirection */ curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed:

Categories : C++

C++ with curl using netbeans
You should add curl library in project settings: Project Properties - Build - Linker. It seems you added a path to headers but you also need to add a library which will be linked after the compilation stage.

Categories : C++

Php curl Facebook
Few changes - If you want to post to the wall, you should be using the '/feed' endpoint, not '/photos'. That's to post an image into an album (and usually, therefore the timeline). The /feed endpoint does not have 'message'. Instead you can use name, caption, description etc. These are highlighted in the links below. As of February 2013 - you cannot post on any others' walls except the user who has authenticated the app. Therefore you can only post to 'me/feed'. https://developers.facebook.com/docs/reference/api/post/ https://developers.facebook.com/roadmap/ If you were indeed trying to upload a photo, you should try the following array: $msg_body = array( 'message' => $message, 'url' => 'http://xyz.com/img.png' ); If the images are from your own website, replac

Categories : PHP

Cookies through Curl
You can store cookies in .TXT which each time will have different name like Time/Date or you can do this. $dir = dirname(__file__); $config['cookie_file'] = $dir . '/cookies/' . md5($_SERVER['REMOTE_ADDR']) . 'txt'; This will save all cookies with User's IP in MD5 to COOKIES Folder. or for directly storing into database. $cookie = tempnam('cookie',rand(000000000,999999999)); and the after each request, you can send cookie to Database. TIP: cURL(cookie) curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie); SQL(storing) Use INSERT for adding cookies to database.

Categories : PHP

How to get xml Curl Response
Use this: ob_start(); $result = curl_exec($ch); $xml = ob_get_contents(); ob_end_clean(); echo htmlspecialchars($xml); The actual function you're searching for is called htmlspecialchars(). It converts symbols like < to to their entity references &lt;. In my code above, we also need the Output Caching (ob_*) functions, so that we can prevent the output from directly being sent to the browser. I'd suggest you though that you use the better way in the code below: curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); if ($result === false) { // error handling } else { echo htmlspecialchars($result); }

Categories : PHP

cURL PHP GET not sending
This type of behavior usually happens when the remote server refuse to serve to request from agents like curl, wget. So we have to spoof the agent header. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); you don't need the following headers because curl handles that on its own. curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: www.thewebsite.com')); curl_setopt($ch, CURLOPT_HTTP_VERSION, 1.1); Apart from these if your site requires cookies Don't forget to include storage for cookies. curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt"); lastly if curl_exec returns FALSE check curl_error() for more information.

Categories : PHP

Intuit and Curl
If the OAuth access token has expired, been revoked, or is invalid for some other reason, then the HTTP response code is 401. So, can you please try to verify the access tokens. If tokens are not valid, then please generate new keys and verify it using ApiExplorer tool Key generation using openssl - https://developer.intuit.com/docs/0020_customeraccountdata/007_firstrequest After generating these keys, you can create a sample app with the public key. https://developer.intuit.com/docs/0020_customeraccountdata/009_using_customeraccountdata/0010_gettingstarted/0015_create_an_cad_integration then use the .p12 file with pwd(if any) for SAML assertion in the apiexplorer tool - https://developer.intuit.com/apiexplorer Let me know if it works for you. Thanks

Categories : PHP

Querying API through Curl/PHP
Your last PHP example has changed the request to a POST from a GET. Pass your parameters in the query string instead of the POST body. Try: $query = urlencode('where={"steps":9243}'); $ch = curl_init('https://api.parse.com/1/classes/Steps?'.$query); curl_setopt($ch,CURLOPT_HTTPHEADER,array('X-Parse-Application-Id: myApplicationID', 'X-Parse-REST-API-Key: myRestAPIKey', 'Content-Type: application/json')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_exec($ch); curl_close($ch);

Categories : PHP

Equivalent cURL in VBA?
Solved it now guys, works well. For other peoples convenience. TargetURL = "https://www.mysite.co.uk/app/api/v1/test" Set HTTPReq = CreateObject("WinHttp.WinHttpRequest.5.1") HTTPReq.Option(4) = 13056 ' HTTPReq.Open "PUT", TargetURL, False HTTPReq.SetCredentials "user", "password", 0 HTTPReq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" HTTPReq.send ("test[status]=" & Forms!curl!Text0.Value & "&test2[status]=" & Text2.Value) MsgBox (HTTPReq.responseText)

Categories : Vba

to close cURL or not
There's a performance increase to reusing the same handle. See: Reusing the same curl handle. Big performance increase? If you don't need the requests to be synchronous, consider using the curl_multi_* functions (e.g. curl_multi_init, curl_multi_exec, etc.) which also provide a big performance boost. UPDATE: I tried benching curl with using a new handle for each request and using the same handle with the following code: ob_start(); //Trying to avoid setting as many curl options as possible $start_time = microtime(true); for ($i = 0; $i < 100; ++$i) { $rand = rand(); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.google.com/?rand=" . $rand); curl_exec($ch); curl_close($ch); } $end_time = microtime(true); ob_end_clean(); echo 'Curl without handle reus

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.