Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Like this:</p> <pre><code>&lt;?php function get($url, $refer, $ch) { curl_setopt ($ch, CURLOPT_URL,$url); curl_setopt ($ch, CURLOPT_POST, 0); curl_setopt ($ch, CURLOPT_COOKIEJAR, realpath('cookie.txt')); // cookie.txt curl_setopt ($ch, CURLOPT_COOKIEFILE, realpath('cookie.txt')); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i586; de; rv:5.0) Gecko/20100101 Firefox/5.0'); curl_setopt ($ch, CURLOPT_REFERER, $refer); $result= curl_exec($ch); return $result; } function post($url, $refer, $parametros, $ch) { curl_setopt ($ch, CURLOPT_URL,$url); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, $parametros); curl_setopt ($ch, CURLOPT_COOKIEJAR, realpath('cookie.txt')); // cookie.txt curl_setopt ($ch, CURLOPT_COOKIEFILE, realpath('cookie.txt')); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i586; de; rv:5.0) Gecko/20100101 Firefox/5.0'); curl_setopt ($ch, CURLOPT_REFERER, $refer); $result= curl_exec($ch); return $result; } function hazlo() { $ch = curl_init(); /* STEP 1. visito la primera pagina para coger sus cookies */ get ("http://www.i2ocr.com/", "http://www.i2ocr.com/", $ch); //STEP 2. Creo un array con los datos del post $data = array( 'i2ocr_options' =&gt; 'url', 'i2ocr_uploadedfile' =&gt; '', 'i2ocr_url' =&gt; 'http://www.murraydata.co.uk/wp-content/uploads/2013/02/ocr-font- 500x220.jpg', 'i2ocr_languages' =&gt; 'gb,eng' ); $data2 = http_build_query($data); //STEP 3. Enviamos el el array en post echo post ("http://www.i2ocr.com/process_form", "http://www.i2ocr.com/", $data2, $ch); } hazlo(); ?&gt; </code></pre> <p>use view source to see the response html, you can see the text of the image (sorry for my english). Works 100% :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload