Re: help with cURL + PHP

Scott Battersby <[email protected]> Tue, 4 Nov 2014 20:39:27 +1030
Newsgroups gmane.comp.web.curl.php
Message-ID <CACv0zNqRsJfPq0L1DR6Fjs21n2AfdzjOSQLiGTRivb2g4=4+Rw@mail.gmail.com>
--===============0331579791==
Content-Type: multipart/alternative; boundary=089e014942108acc3c050705a8cd

--089e014942108acc3c050705a8cd
Content-Type: text/plain; charset=UTF-8

Yes, that's my understanding.  PHP can't fill those inputs because PHP is
running on the webserver but the inputs are inside the browser.  PHP can't
reach them.

On Tuesday, 4 November 2014, Mladen Jovic <[email protected]> wrote:

> So if i understand there is no easy way to fill up those inputs throught
> php even if i fill up manually CAPTCHA? :(
>
> > From: [email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>
> > Date: Tue, 4 Nov 2014 19:01:10 +1030
> > Subject: Re: help with cURL + PHP
> > To: [email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>
> >
> > I think the problem is more fundamental. cURL isn't useful for
> > filling in forms. What cURL could do for you is to simulate sending
> > ("POSTing") a completed form to the form target... ie simulate what
> > happens after a human fills in the fields and then clicks the "Isci"
> > button. You can read about the POST process here... it's a
> > fundamental part of the internet :
> > http://en.wikipedia.org/wiki/POST_(HTTP)
> >
> > So, can we do this with cURL in your application? Turns out to be
> > pretty hard... it's not just a "normal" POST.
> >
> > If you examine the page source at
> > https://raz.zav-zdruzenje.si/infocenter/Search.aspx you'll see that
> > clicking the Isci button runs some javascript.... so you could dig
> > into that javascript and see how it works, then simulate THAT with
> > cURL. The javascript most likely carries out a POST, and probably
> > some other processing... so you'd have to simulate the other
> > processing in PHP and then do the POST with cURL. Of course you'd
> > also need to get the captcha solved somehow... perhaps with a service
> > like http://www.deathbycaptcha.com/
> >
> > An alternative approach, if you are happy to solve the captcha
> > yourself and just want to save time filling in the other fields is to
> > use a windows machine and control Internet Explorer through vb or vba.
> > Here's a rough example to get you started :
> > http://www.excely.com/excel-vba/ie-automation.shtml
> >
> > Good luck :)
> >
> > Scott
>
>

--089e014942108acc3c050705a8cd
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Yes, that&#39;s my understanding.=C2=A0 PHP can&#39;t fill those inputs bec=
ause PHP is running on the webserver but the inputs are inside the browser.=
=C2=A0 PHP can&#39;t reach them. =C2=A0<br><br>On Tuesday, 4 November 2014,=
 Mladen Jovic &lt;<a href=3D"mailto:[email protected]">mladen.jovic@=
hotmail.com</a>&gt; wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div dir=3D"ltr">So if i understand there is no easy way to fill up th=
ose inputs throught php even if i fill up manually CAPTCHA? :(<br><br><div>=
&gt; From: <a href=3D"javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;scott@stopth=
atsnoring.com.au&#39;);" target=3D"_blank">[email protected]</a>=
<br>&gt; Date: Tue, 4 Nov 2014 19:01:10 +1030<br>&gt; Subject: Re: help wit=
h cURL + PHP<br>&gt; To: <a href=3D"javascript:_e(%7B%7D,&#39;cvml&#39;,&#3=
9;[email protected]&#39;);" target=3D"_blank">[email protected]=
x.se</a><br>&gt; <br>&gt; I think the problem is more fundamental.  cURL is=
n&#39;t useful for<br>&gt; filling in forms.  What cURL could do for you is=
 to simulate sending<br>&gt; (&quot;POSTing&quot;) a completed form to the =
form target... ie simulate what<br>&gt; happens after a human fills in the =
fields and then clicks the &quot;Isci&quot;<br>&gt; button.  You can read a=
bout the POST process here... it&#39;s a<br>&gt; fundamental part of the in=
ternet :<br>&gt; <a href=3D"http://en.wikipedia.org/wiki/POST_(HTTP)" targe=
t=3D"_blank">http://en.wikipedia.org/wiki/POST_(HTTP)</a><br>&gt; <br>&gt; =
So, can we do this with cURL in your application?  Turns out to be<br>&gt; =
pretty hard... it&#39;s not just a &quot;normal&quot; POST.<br>&gt; <br>&gt=
; If you examine the page source at<br>&gt; <a href=3D"https://raz.zav-zdru=
zenje.si/infocenter/Search.aspx" target=3D"_blank">https://raz.zav-zdruzenj=
e.si/infocenter/Search.aspx</a> you&#39;ll see that<br>&gt; clicking the Is=
ci button runs some javascript.... so you could dig<br>&gt; into that javas=
cript and see how it works, then simulate THAT with<br>&gt; cURL.  The java=
script most likely carries out a POST, and probably<br>&gt; some other proc=
essing... so you&#39;d have to simulate the other<br>&gt; processing in PHP=
 and then do the POST with cURL.  Of course you&#39;d<br>&gt; also need to =
get the captcha solved somehow... perhaps with a service<br>&gt; like <a hr=
ef=3D"http://www.deathbycaptcha.com/" target=3D"_blank">http://www.deathbyc=
aptcha.com/</a><br>&gt; <br>&gt; An alternative approach, if you are happy =
to solve the captcha<br>&gt; yourself and just want to save time filling in=
 the other fields is to<br>&gt; use a windows machine and control Internet =
Explorer through vb or vba.<br>&gt; Here&#39;s a rough example to get you s=
tarted :<br>&gt; <a href=3D"http://www.excely.com/excel-vba/ie-automation.s=
html" target=3D"_blank">http://www.excely.com/excel-vba/ie-automation.shtml=
</a><br>&gt; <br>&gt; Good luck :)<br>&gt; <br>&gt; Scott<br><br></div> 		 =
	   		  </div></div>
</blockquote>

--089e014942108acc3c050705a8cd--

--===============0331579791==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaHR0cDovL2Nv
b2wuaGF4eC5zZS9jZ2ktYmluL21haWxtYW4vbGlzdGluZm8vY3VybC1hbmQtcGhwCg==

--===============0331579791==--