Search Results

Search found 5809 results on 233 pages for 'curl multi'.

Page 12/233 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Zend + Wamp = Cant use curl/fput for a url locally

    - by bluedaniel
    Ive got a page in Zend all set up that will for now just echo "Hello", this address is at http://dev.local/hello and works when visiting in the browser. However when I try to use curl or file_get_contents from a script in my zend 'public' folder I get a 500 Internal error message. UPDATE Its failing because my application tries to set the langauge based on the browsers default language, when using headers like I have below, how do I add this locale? "User-Agent: XXXXXXX/2.0\r\n" . "Accept: */*\r\n" . "Accept-Charset: utf-8;\r\n" .

    Read the article

  • login to any site using curl in php

    - by user550265
    login to a website using curl php I have tried $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.sitename.com"); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt'); curl_setopt($ch, CURLOPT_POSTFIELDS, true); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ); curl_setopt($ch, CURLOPT_USERPWD, "username:password"); curl_exec($ch); curl_close($ch); ? But this does not log in .

    Read the article

  • PHP CURL sending POST to Django app issue

    - by Felipe Pelá
    This code in PHP sends a HTTP POST to a Django app using CURL lib. I need that this code sends POST but redirect to the page in the same submit. Like a simple form does. The PHP Code: $c = curl_init(); curl_setopt($c, CURLOPT_FOLLOWLOCATION, true); curl_setopt($c, CURLOPT_URL, "http://www.xxx.com"); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, 'Var='.$var); curl_exec($c); curl_close ($c); In this case, the PHP is sending the HTTP POST, but is not redirecting to the page. He is printing the result. My URL still .php and not a django/url/ I need be redirected to the django URL with the Post like a simple form in HTML does. Any Idea? Thanks.

    Read the article

  • extension file "curl" is must be loaded

    - by Sharvan
    Using XAMPP 1.6.7 I installed the community version of Magento. But there seems to be a problem. I am getting the error message 'extension file "curl" is must be loaded'. In another computer, everything seems fine. (the other computer) intel(R) Pentium(R) Dual CPU, E2140 @ 1.60Hz, 1.60 GHz. 504 MB of RAM and XP professional 2002 sp2 My computer is less powerful (Inet Pentium 4 1.6 GHz. with sp2.) Please help me, thanks.

    Read the article

  • PHP cURL: get headers only from post

    - by Stewart
    There ought to be a way of sending a post request and getting back just the headers. $ch = curl_init('http://www.stackoverflow.com/'); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_NOBODY, true); doesn't work, because all setting CURLOPT_NOBODY does is to change the request method to HEAD, thereby overriding CURLOPT_POST. I could just leave the last of these lines out and only process the headers, but is there a more efficient way? It's also odd that there doesn't seem to be a way in cURL to truncate the received content to a specified length as there is with file_get_contents.

    Read the article

  • Problem getting response from server using cURL, file_get_contents, etc

    - by shyam
    I am trying to get the response from a server, which is now not giving any response. I tried file_get_contents(), cURL, and tried getting the headers, but apparently the server is not responding. There are no headers returned or any response of any kind. Also, this happens when I try from my web server - it works fine in my local machine. The server I'm calling is an sms server, to use which they've given a url. The problem is only with this particular server. I get response while trying Google. So may be it's caused by the called server. What I wanna know is what could be (or how to find out) the reasons... Any advices?

    Read the article

  • dell studio 1558 multi touchpad multi finger problem

    - by christian130
    Recently I bought an Intel Core i7 Dell laptop fully integrated. I have an ATi Radeon 1 gb ram graphic card and so on. Everything works fine even the brightness, but when I try the multi touch multi finger(touchpad which enables two or more finger) the pointer jump and go there and go here and so It's very annoying because when I'm trying to write this question I cannot let the pointer be cool! when I accidentally the touchpad it is very annoying. How can I fix this ?

    Read the article

  • How do I compile and build the taf2-curb Ruby gem on Windows XP with MinGW?

    - by Laran Evans
    How do I compile and build the taf2-curb Ruby gem on Windows XP with MinGW? I tried this, but I'm kinda fishing, unsuccessfully. C:\Documents and Settings\Megem install taf2-curb -- --with-curl-include=C:/curl-7.19.5-devel-mingw32/include --with-curl-dir=C:/curl-7.19.5 --with-curl-lib=C:/curl-7.19.5-devel-mingw32/lib --prefix=C:/MinGW --with-curllib Bulk updating Gem source index for: http://gems.rubyforge.org Updating metadata for 73 gems from http://gems.rubyonrails.org ......................................................................... complete Bulk updating Gem source index for: http://gems.github.com Building native extensions. This could take a while... ERROR: Error installing taf2-curb: ERROR: Failed to build gem native extension. C:/Ruby/bin/ruby.exe extconf.rb install taf2-curb -- --with-curl-include=C:/curl-7.19.5-devel-mingw32/include --with-cur l-dir=C:/curl-7.19.5 --with-curl-lib=C:/curl-7.19.5-devel-mingw32/lib --prefix=C:/MinGW --with-curllib checking for curl-config... no checking for main() in true.lib... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --srcdir=. --curdir --ruby=C:/Ruby/bin/ruby --with-curl-dir --with-curl-include=${curl-dir}/include --with-curl-lib=${curl-dir}/lib --with-curllib extconf.rb:9: Can't find libcurl or curl/curl.h (RuntimeError) Try passing --with-curl-dir or --with-curl-lib and --with-curl-include options to extconf. Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.8/gems/taf2-curb-0.4.8.0 for inspection. Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/taf2-curb-0.4.8.0/ext/gem_make.out C:\Documents and Settings\Me I've installed curl-7.19.5 and curl-7.19.5-devel-mingw from this url: http://curl.haxx.se/download.html Help! And thanks!

    Read the article

  • cURL PHP: Connecting to Invoicing System

    - by Ben
    I am attempting to use cURL to connect to a page like this: https://clients.mindbodyonline.com/asp/home.asp?studioid=851 with the following code; <?php $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,'https://clients.mindbodyonline.com/asp/home.asp?studioid=851'); //curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2); curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1); curl_setopt($curl_handle,CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($curl_handle,CURLOPT_COOKIEJAR, '/tmp/cookies.txt'); curl_setopt($curl_handle,CURLOPT_COOKIEFILE, '/tmp/cookies.txt'); //curl_setopt($curl_handle,CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl_handle,CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, 1); //curl_setopt($curl_handle,CURLOPT_HEADER, 1); //curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER, 1); //curl_setopt ($curl_handle,CURLOPT_POST, 1); $buffer = curl_exec($curl_handle); curl_close($curl_handle); if (empty($buffer)) { print "Sorry, The booking system appears to be unavailable at this time.<p>"; } else { print $buffer; } ?> I've fiddled the settings and the only three responses I get are; Nothing is loaded and the error message is called A redirect to /asp/home... locally Returns '1' and that's all Thanks for your time!

    Read the article

  • Get remote image using cURL then resample.

    - by Chris
    I want to be able to retrieve a remote image from a webserver, resample it, and then serve it up to the browser AND save it to a file. Here is what I have so far: $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "$rURL"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); // grab URL and pass it to the browser $out = curl_exec($ch); // close cURL resource, and free up system resources curl_close($ch); $imgRes = imagecreatefromstring($out); imagejpeg($imgRes, $filename, 70); header("Content-Type: image/jpg"); header("Content-length: ".filesize($filename)); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($filename)); readfile("$filename"); exit(); Update Updated code to include imjpeg step to save the image as lower quality. But how do I then, efficiently, serve this up to the browser. I currently, later in the code, do this readfile("$filename"); along with some header information but that means I'm reading the file back in again which seems inefficient.

    Read the article

  • Streaming local file from PHP while it's been written to by a CURL process

    - by Fahim
    I am creating a simple Proxy server for my website. Why I am not using mod_proxy and mod_cache is a different discussion. Here's the code: shell_exec("nohup curl --create-dirs -o {$write_path} {$source_url} > /dev/null 2> /dev/null & echo $!"); sleep(1); $read_speed = 65.5; # 65.5 kb/s download rate $handle = fopen($write_path, "rb"); $content_type = select_meta_item($headers, 'Content-Type'); $file_size = select_meta_item($headers, 'Content-Length'); send_headers($content_type, $file_size); flush(); while (!feof($handle)) { echo fread($handle, round($read_speed * 1024)); flush(); sleep(1); } fclose($handle); Streaming an MP3 doesn't work using this method. Plays in Chrome, but not in Firefox. Initially I'll be using this to stream MP3 files through Long Tail's JW Player. If it all works out, I'll also be using this to send ZIP files.

    Read the article

  • PHP and curl for fetching currency rate from Yahoo Finance

    - by gregj
    Hello, I wrote the following php snippet to fetch the currency conversion rate from Yahoo Finance.Im using curl to fetch the data. Suppose, i want to convert from US dollars (USD) to Indian National Rupee (INR),then the url is http://in.finance.yahoo.com/currency/convert?amt=1&from=USD&to=INR&submit= and the Indian Rupee value is shown as 45.225. However,if i run my code, the value im getting is 452.25. Why this discrepancy ? <?php $amount = $_GET['amount']; $from = $_GET['from']; $to = $_GET['to']; $url = "http://in.finance.yahoo.com/currency/convert?amt=".$amount."&from=".$from."&to=".$to; $handle = curl_init($url); curl_setopt ($handle, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($handle); if(preg_match_all('/<td class="yfnc_tabledata1"><b>(?:[1-9]\d+|\d)(?:\.\d\d)?/',$data,$matches)) { print_r($matches[0][1]); } else { echo "Not found !"; } curl_close($handle); ?> Is there something wrong with my regex ? Please help. Thank You.

    Read the article

  • Uploading to S3 using Curl

    - by Carl Crawley
    Hi All, I'm currently using cURL to upload a file from my server to S3 using AJAX to call the script. So I have the following: $fullfilepath = '/server/sitepath/files/' . $_POST['file']; $upload_url = 'https://'.$_POST['buckets'].'.s3.amazonaws.com/'; $params = array( 'key'=>$_POST['key'], 'AWSAccessKeyId'=>$_POST['AWSAccessKeyId'], 'acl'=>$_POST['acl'], 'success_action_status'=>$_POST['success_action_status'], 'policy'=>$_POST['policy'], 'signature'=>$_POST['signature'], 'Content-Type'=>$_POST['Content-Type'], 'file'=>"@$fullfilepath" ); $ch = curl_init(); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_URL, $upload_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $params); $response = curl_exec($ch); curl_close($ch); echo $response; However, I'm getting an S3 error as follows when it posts and I'm unsure why because I'm not passing JSON to it. <?xml version="1.0" encoding="UTF-8"?> <Error><Code>InvalidPolicyDocument</Code><Message>Invalid Policy: Invalid JSON.</Message><RequestId>B29469C6151BE0E8</RequestId><HostId>BFPk6W2kt1b6hTtx0mEq6dWdN/IhO0gNR5bct//7LAOwJxm1C3PrxS4RPv1blzJ8</HostId></Error> I've googled it for the last hour or so and can't seem to figure it out. If I change the order of the Array fields, it gives me a different error - I believe the order of the posted fields is important somehow. any help would be much appreciated! C

    Read the article

  • Using CURL within a loop to download a file, 1st one works, 2nd one times out

    - by kitenski
    Morning all, I am using CURL to download an image file within a loop. The first time it runs fine and I see the image appear in the directory. The second time it fails with a timeout, despite it being a valid URL. Can anyone suggest why it always fails on the 2nd time and how to fix it? The snippet of code is: // download image $extension = "gif"; $ch = curl_init(); curl_setopt($ch, CURLOPT_TIMEOUT, 90); curl_setopt($ch, CURLOPT_URL, $imgurl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); echo $imgurl . " attempting to open URL "; $i = curl_exec($ch); if ( $i==false ) { echo curl_errno($ch).' '.curl_error($ch); } $image_name=time().'.'.$extension; $f = fopen('/fulldirectorypath/' . $image_name ,'w+'); fwrite($f,$i); fclose($f); I have put an echo in there to display the $IMGURL, to check it is valid, and upped the timeout to 90 secs, but it still fails. This is what I see on screen: http://images.eu-xmedia.de/thumbnails/34555861/5676051/pt=pic,lang=2,origfile=yes/image.gif attempting to open URL 28 Operation timed out after 90 seconds with 0 bytes received an empty file is created in my directory. thanks alot, Greg

    Read the article

  • share the same cookie between two website using PHP cURL extension

    - by powerboy
    I want to get the contents of some emails in my gmail account. I would like to use the PHP cURL extension to do this. I followed these steps in my first try: In the PHP code, output the contents of https://www.google.com/accounts/ServiceLoginAuth. In the browser, the user input username and password to login. In the PHP code, save cookies in a file named cookie.txt. In the PHP code, send request to https://mail.google.com/ along with cookies retrieved from cookie.txt and output the contents. The following code does not work: $login_url = 'https://www.google.com/accounts/ServiceLoginAuth'; $gmail_url = 'https://mail.google.com/'; $cookie_file = dirname(__FILE__) . '/cookie.txt'; $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file); curl_setopt($ch, CURLOPT_URL, $login_url); $output = curl_exec($ch); echo $output; curl_setopt($ch, CURLOPT_URL, $gmail_url); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file); $output = curl_exec($ch); echo $output; curl_close($ch);

    Read the article

  • Which is more secure GET or POST sending parameters with cURL at PHP

    - by Steve
    I want to connect in a secure way with an API and I am using cURL to do it using HTTPS and SSL. Now, i was wondering what is better in terms of security, sending the data through GET or POST: $ch = curl_init("http://api.website.com/connect.php?user=xxx&pass=xxxx); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); $result = curl_exec($ch); curl_close($ch); Or $param['user'] = 'xxxx'; $param['pass'] = 'xxxx'; $ch = curl_init("http://api.website.com/connect.php); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $Parameters); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); $result = curl_exec($ch); curl_close($ch); I also realized that POST is much more slower retrieving the data.

    Read the article

  • cURL gets Internal Server Error when posting to aspx page

    - by Mihai
    I have a big problem. I have some applications made on an unix based system, and I use PHP with cURL to post an XML question to an IIS server with asp.net. Every time I ask the server something I get error: HTTP/1.1 500 Internal Server Error Date: Tue, 04 May 2010 07:36:08 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 3032 But if I ask same question on another server, almost identically to this one (BOTH configured by me) I get results like it should and the headers: HTTP/1.1 200 OK Date: Tue, 04 May 2010 07:39:37 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 9169 I tried everything, searched hundreds of forums, but i don't find anything. In IIS logs I only get: 2010-05-04 07:36:08 W3SVC1657587027 80.xx.xx.xx POST /XML_SERV/XmlAPI.aspx - 80 - 80.xx.xx.xx Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1 500 0 0 any ideas where to look what is going on? I forgot to mention! If I use an XML request software, and ask same question, it works.

    Read the article

  • PHP Curl - returned html all messed up

    - by yoda
    I'm trying to fetch some contents about articles in a website via Curl, which I'm doing as follows : $url = 'http://lisboacity.olx.pt/oportunidade-pastor-alemao-7-meses-com-lop-iid-432402267'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322'); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 10); $data = curl_exec($ch); curl_close($ch); echo $data; However, as you can see, the result is this : result For indexation purposes, I'm leaving a small paste of the output here : ‹ÜW_oÛ6N€~F{hD’å?±“ØÜÄm‚&qZ;-Ö¢0h‰–™R¢JR¶Óapcèð}*ö²§)%Vœ&YÚ·†eêî~¿;òx<6×ö{{ƒ_N»èp|„NÏžî!ËvÝו=×Ýìg‚ªSòÐ@àXREyŒ™ëvO,dM”Jv\w6›9³ŠÃEè^º±ªË8—Ä TµW›ú•~À#" #mj“)¶¬=++{p‘ùÙ¨e)2Wmù,$Q­Ã~Ïn4jÛ¶g!÷.¨#‡)‹p‰26«>Í–M·.ƒTŽ8ö©ºp8›;‰r-¤°ÕJÂÆ£¢Š‘v/áB¥1 p@ÖN±T\ #Ñ'Žê("’H ŽÐQïÔ…#ƒ:10•(à £¨Ï%¼D]øá??ñ¦›d‘Å8"-+ Ò4Ñ3_ç:åÓÏÁ†ð’\[‘8]ÿÑëÎà zÕ;AOûý½ƒÞÓþA÷ðxíÑê£Uã»ôvS_pB“M ’aÙq€AŠX"øNa¦bx’;hŸÊäoCÃ0þjB3C@ Rå"™0Ãz€cž&ü{æäjúô '&äö'¤åUªõZ½î5êÀd2Ñø=„µ,Ç<†bÛìž3èGöØj±Ð{9Ø; ýÞÉ«,Æ]©.‘îO!Åb~–Á2 !°'uåÊj_Êÿ„œ=†žç;Æ$"Ó-3–­ I've also tried to load the url contents with PHP's DomDocument class with the same result. What could be causing this? Thanks in advance!

    Read the article

  • How to send XML and other post parameters via cURL in PHP

    - by tomaszs
    Hello. I've used code below to send XML to my REST API. $xml_string_data contains proper XML, and it is passed well to mypi.php: //set POST variables $url = 'http://www.server.cu/mypi.php'; $fields = array( 'data'=>urlencode($xml_string_data) ); //url-ify the data for the POST $fields_string = ""; foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } rtrim($fields_string,'&'); echo $fields_string; //open connection $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch,CURLOPT_POST,count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string); curl_setopt($ch,CURLOPT_HTTPHEADER,array ( "Expect: " )); //execute post $result = @curl_exec($ch); But when I've added other field: $fields = array( 'method' => "methodGoPay", 'data'=>urlencode($xml_string_data) ); It stopped to work. On the mypi.php I don't recieve any more POST parameters at all! Could you you please tell me what to do to send XML and other post parameters in one cURL request? Please don't suggest using any libraries, I wan't to acomplish it in plain PHP.

    Read the article

  • php cURL. preg_match , extract text from xhtml

    - by Michael
    I'm trying to extract the price from the bellow html page/link using php cURL and preg_match . Basically I'm expecting for this code to output 4,550 but for some reasons I get Notice: Undefined offset: 1 in C:\wamp\www\test.php on line 22 I think that the pattern is correct because if I put the html itself in a variable and escape the "" it works ! . Also if I output (echo $result;) it displays the html properly grabbed from foxtons website so I just can't figure it out why the whole thing doesn't work . I need to make this work and also I would appreciate if you would tell me why is that notice generated and why my current script doesn't work. $url = "http://www.foxtons.co.uk/search?bedrooms_from=0&property_id=727717"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); curl_exec($ch); curl_close($ch); $result2 = str_replace('"', '\"', $result); $tagname1= ");<\/script "; $tagname2= "<\/noscript per month<\/a"; $pattern = "/$tagname1(.*?)$tagname2/"; preg_match($pattern, $result, $matches); $prices = $matches[1]; print_r($prices); ?

    Read the article

  • How do I calculate clock speed in multi-core processors?

    - by NReilingh
    Is it correct to say, for example, that a processor with four cores each running at 3GHz is in fact a processor running at 12GHz? I once got into a "Mac vs. PC" argument (which by the way is NOT the focus of this topic... that was back in middle school) with an acquaintance who insisted that Macs were only being advertised as 1Ghz machines because they were dual-processor G4s each running at 500MHz. At the time I knew this to be hogwash for reasons I think are apparent to most people, but I just saw a comment on this website to the effect of "6 cores x 0.2GHz = 1.2Ghz" and that got me thinking again about whether there's a real answer to this. So, this is a more-or-less philosophical/deep technical question about the semantics of clock speed calculation. I see two possibilities: Each core is in fact doing x calculations per second, thus the total number of calculations is x(cores). Clock speed is rather a count of the number of cycles the processor goes through in the space of a second, so as long as all cores are running at the same speed, the speed of each clock cycle stays the same no matter how many cores exist. In other words, Hz = (core1Hz+core2Hz+...)/cores.

    Read the article

  • Multi-touch capabilities for Ubuntu 12.04? How can I configure the system to support it?

    - by dd dong
    I installed Ubuntu 13.10, it supports default multi-touch perfectly! I need Ubuntu 12.04, however, it does not appear to support multi-touch features. I write a touch test program, it supports touch and mouseMove at the same time, but I just need touch function. I know we can set the device to grab bits. But how can I configure the system to support it? It gives me an error when I try to use multi-touch.

    Read the article

  • PHP curl post to login to wordpress

    - by Sadi
    I followed http://stackoverflow.com/questions/724107 to login to wordpress, using php_curl, and it works fine as far I use WAMP, (apache/php). But when it comes to IIS on the dedicated server, it returns nothing. I have wrote the following function which is working fine on my local wamp, but when deployed to client's dedicated windows server 2k3, it doesn't. Please help me function post_url($url, array $query_string) { //$url = http://myhost.com/wptc/sys/wp/wp-login.php /* $query_string = array( 'log'=>'admin', 'pwd'=>'test', 'redirect_to'=>'http://google.com', 'wp-submit'=>'Log%20In', 'testcookie'=>1 ); */ //temp_dir is defined as folder = path/to/a/folder $cookie= temp_dir."cookie.txt"; $c = curl_init($url); if (count($query_string)) { curl_setopt ($c, CURLOPT_POSTFIELDS, http_build_query( $query_string ) ); } curl_setopt($c, CURLOPT_POST, 1); curl_setopt($c, CURLOPT_COOKIEFILE, $cookie); //curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 1); //curl_setopt($c, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"); curl_setopt($c, CURLOPT_TIMEOUT, 60); curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); //return the content curl_setopt($c, CURLOPT_COOKIEJAR, $cookie); //curl_setopt($c, CURLOPT_AUTOREFERER, 1); //curl_setopt($c, CURLOPT_REFERER, wp_admin_url); //curl_setopt($c, CURLOPT_MAXREDIRS, 10); curl_setopt($c, CURLOPT_HEADER, 0); //curl_setopt($c, CURLOPT_CRLF, 1); try { $result = curl_exec($c); } catch (Exception $e) { $result = 'error'; } curl_close ($c); return $result; //it return nothing (empty) } Other Facts curl_error($c); return nothing when header CURLOPT_HEADER is set to ON, it return this header HTTP/1.1 200 OK Cache-Control: no-cache, must-revalidate, max-age=0 Pragma: no-cache Content-Type: text/html; charset=UTF-8 Expires: Wed, 11 Jan 1984 05:00:00 GMT Last-Modified: Thu, 06 May 2010 21:06:30 GMT Server: Microsoft-IIS/7.0 X-Powered-By: PHP/5.2.13 Set-Cookie: wordpress_test_cookie=WP+Cookie+check; path=/wptc/sys/wp/ Set-Cookie: wordpress_b13661ceb5c3eba8b42d383be885d372=admin%7C1273352790%7C7d8ddfb6b1c0875c37c1805ab98f1e7b; path=/wptc/sys/wp/wp-content/plugins; httponly Set-Cookie: wordpress_b13661ceb5c3eba8b42d383be885d372=admin%7C1273352790%7C7d8ddfb6b1c0875c37c1805ab98f1e7b; path=/wptc/sys/wp/wp-admin; httponly Set-Cookie: wordpress_logged_in_b13661ceb5c3eba8b42d383be885d372=admin%7C1273352790%7Cb90825fb4a7d5da9b5dc4d99b4e06049; path=/wptc/sys/wp/; httponly Refresh: 0;url=http://myhost.com/wptc/sys/wp/wp-admin/ X-Powered-By: ASP.NET Date: Thu, 06 May 2010 21:06:30 GMT Content-Length: 0 CURL version info: Array ( [version_number] = 463872 [age] = 3 [features] = 2717 [ssl_version_number] = 0 [version] = 7.20.0 [host] = i386-pc-win32 [ssl_version] = OpenSSL/0.9.8k [libz_version] = 1.2.3 [protocols] = Array ( [0] = dict [1] = file [2] = ftp [3] = ftps [4] = http [5] = https [6] = imap [7] = imaps [8] = ldap [9] = pop3 [10] = pop3s [11] = rtsp [12] = smtp [13] = smtps [14] = telnet [15] = tftp ) ) PHP Version 5.2.13 Windows Server 2K3 IIS 7 Working fine on Apache, PHP 3.0 on my localhost (windows)

    Read the article

  • php curl http 405 error mind body online api

    - by K_G
    I am trying to connect to the Mind Body Online API (their forum is down currently, so I came here). Below is the code I am using. I am receiving this: SERVER ERROR 405 - HTTP verb used to access this page is not allowed. The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt to access. code: //Data, connection, auth $soapUrl = "http://clients.mindbodyonline.com/api/0_5"; // xml post structure $xml_post_string = '<?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://clients.mindbodyonline.com/api/0_5"> <soapenv:Header/> <soapenv:Body> <GetClasses> <Request> <SourceCredentials> <SourceName>username</SourceName> <Password>password</Password> <SiteIDs> <int>site id</int> </SiteIDs> </SourceCredentials> <UserCredentials> <Username>username</Username> <Password>password</Password> <SiteIDs> <int></int> </SiteIDs> </UserCredentials> <Fields> <string>Classes.Resource</string> </Fields> <XMLDetail>Basic</XMLDetail> <PageSize>10</PageSize> <CurrentPageIndex>0</CurrentPageIndex> </Request> </GetClasses> </soapenv:Body> </soapenv:Envelope>'; $headers = array( "Content-type: text/xml;charset=\"utf-8\"", "Accept: text/xml", "Cache-Control: no-cache", "Pragma: no-cache", "SOAPAction: http://clients.mindbodyonline.com/api/0_5", "Content-length: ".strlen($xml_post_string), ); //SOAPAction: your op URL $url = $soapUrl; // PHP cURL for https connection with auth $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // converting $response = curl_exec($ch); curl_close($ch); var_dump($response); // converting //$response1 = str_replace("<soap:Body>","",$response); //$response2 = str_replace("</soap:Body>","",$response1); // convertingc to XML //$parser = simplexml_load_string($response2); // user $parser to get your data out of XML response and to display it. Any help would be great and if anyone has any experience working with their API, my first time ;) Here is the post on stack I am going off of: SOAP request in PHP

    Read the article

  • How can I use curl to login multiple users from one php script

    - by kamal
    Here is the scenario: I have configured multiple users with login names aa1, aa2 .. zz99 , all with the same password, now i want to login to a php based server with these login ID's. I have a working script that logs in one user with a username and password, and using curl, browses to a target page: // Assume php , since somehow the php encapsulation quotes were giving me trouble $sHost = $argv[2]; $sStart = $argv[3]; $sReqId = $argv[4]; $sPage = $argv[5]; $sReqLogFile = $argv[6]; $sRespLogFile = $argv[7]; $sUserName = $argv[8]; $sPassword = $argv[9]; $sExecDelay = $argv[10]; //optional args: if($argc 11) { $sCommonSID = $argv[11]; } //$sXhprofLogFile = ""; $sSysStatsLogFile= ""; $sBaseUrl = 'https://'.$sHost.'/'; $nExecTime = 0; $sCookieFileName = 'cookiejar/'.genRandomString().'.txt'; touch($sCookieFileName); // Set the execution delay: $sStart += $sExecDelay; // Get the PHP Session Id: if(isset($sCommonSID)) { $sSID = $sCommonSID; }else{ $sSID = getSID($sHost,$sBaseUrl, $sUserName, $sPassword); } // Sleep for 100us intervals until we reach the stated execution time: do { usleep(100); }while(getFullMicrotime()$sPage, "pageUrl"=$sBaseUrl, "execStart" =$nExecStart, "execEnd"=$nExecEnd, "respTime"=$nExecTime, "xhprofToken"=$sXhpToken, "xhprofLink"=$sXhpLink, "fiveMinLoad"=$nFiveMinLoad); }else{ $nExecStart = 0; $sUrl = "***ERROR***"; $aReturn = null; } writeReqLog($sReqId, $nExecStart, $sSID, $sUrl, $sReqLogFile); return $aReturn; } function getFullMicrotime() { $fMtime = microtime(true); if(strpos($fMtime, ' ') !== false) { list($nUsec, $nSec) = explode(' ', $fMtime); return $nSec + $nUsec; } return $fMtime; } function writeRespLog($nReqId, $sHost, $sPage, $sSID = "***ERROR***", $nExecStart = 0, $nExecEnd = 0, $nRespTime = 0, $sXhpToken = "", $sXhpLink = "", $nFiveMinLoad = 0, $sRespLogFile) { $sMsg = $nReqId; $sMsg .= "\t".$sHost; $sMsg .= "/".$sPage; $sMsg .= "\t".$sSID; $sMsg .= "\t".$nExecStart; $sMsg .= "\t".$nExecEnd; $sMsg .= "\t".$nRespTime; $sMsg .= "\t".$sXhpToken; $sMsg .= "\t".$nFiveMinLoad; error_log($sMsg."\n",3,$sRespLogFile); } function writeReqLog($nReqId, $nExecStart, $sSID, $sUrl, $sReqLogFile) { $sMsg = $nReqId; $sMsg .= "\t".$sUrl; $sMsg .= "\t".$sSID; $sMsg .= "\t".$nExecStart; error_log($sMsg."\n",3,$sReqLogFile); } function parseSIDValue($sText) { $sSID = ""; preg_match('/SID:(.*)/',$sText, $aSID); if (count($aSID)) { $sSID = $aSID[1]; } return $sSID; } function parseFiveMinLoad($sText) { $nLoad = 0; $aMatch = array(); preg_match('/--5-MIN-LOAD:(.*)--/',$sText, $aMatch); if (count($aMatch)) { $nLoad = $aMatch[1]; } return $nLoad; } function curlRequest($sUrl, $sSID="") { global $sCookieFileName; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $sUrl); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); if($sSID == "") { curl_setopt($ch, CURLOPT_COOKIEJAR, $sCookieFileName); } else { curl_setopt($ch, CURLOPT_COOKIEFILE, $sCookieFileName); } $result =curl_exec ($ch); curl_close ($ch); return $result; } function parseXHProfToken($sPageContent) { //https://ktest.server.net/xhprof/xhprof_html/index.php?run=4d004b280a990&source=mybox $sToken = ""; $sRelLink = ""; $aMatch = array(); $aResp = array(); preg_match('/$sToken, "relLink"=$sRelLink); return $aResp; } function genRandomString() { $length = 10; $characters = '0123456789abcdefghijklmnopqrstuvwxyz'; $string = ''; for ($p = 0; $p

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >