Re: help with cURL + PHP
Mladen Jovic <[email protected]> Tue, 4 Nov 2014 08:14:27 +0100
| Newsgroups | gmane.comp.web.curl.php |
|---|---|
| Message-ID | <[email protected]> |
--===============1159572114== Content-Type: multipart/related; boundary="_a838369e-f3f7-4008-8bb9-ec0bda240aaa_" --_a838369e-f3f7-4008-8bb9-ec0bda240aaa_ Content-Type: multipart/alternative; boundary="--_com.android.email_261398428164150" ----_com.android.email_261398428164150 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hmm=2C thanks for your answer. I'm not sure if i was clear enought. My idea was to put data in first and s= econd input=2C and then manually write captcha and manually submit the form= . Br Mladen <div>-------- Original message --------</div><div>From: Stephen Pynenburg <= [email protected]> </div><div>Date:04/11/2014 07:32 (GMT+01:00) </div>= <div>To: curl with PHP <[email protected]> </div><div>Cc: </div><d= iv>Subject: Re: help with cURL + PHP </div><div> </div> I think your problem is with the web site and not with cURL (there is nothing really wrong with your code as it is). I can't read Slovenian=2C but it looks like below where it says: "Prosimo=2C prepi=C5=A1ite varnostno kodo v spodnje vnosno polje (velikost = =C4=8Drk se ne upo=C5=A1teva)." It is asking you to input a CAPTCHA/verification code. This kind of measure=2C unfortunately=2C is designed to prevent exactly what you're tryi= ng to do. Stephen On Mon=2C Nov 3=2C 2014 at 5:30 PM=2C Mladen Jovic <[email protected]= m> wrote: > Hello=2C > > i saw this example code for cURL on: > http://curl.haxx.se/libcurl/php/examples/httpfileupload.html > > i want to ask you if you can help me how i can use this for remote forms? > > > For example: https://raz.zav-zdruzenje.si/infocenter/Search.aspx > > in this form i would like to fill up first and second input=2C but with y= our > example looks like this is not possible for remote forms. > > > > My code now looks like: <?php $ch =3D curl_init(" > https://raz.zav-zdruzenje.si/infocenter/Search.aspx")=3B curl_setopt($ch= =2C > CURLOPT_POSTFIELDS=2C > array('ctl00$ICContentPlaceHolder$dBoxFrom'=3D>"24.10.2014"=2C > 'ctl00$ICContentPlaceHolder$tbVehicleRegistrationNumber'=3D>'LJ FF 350'))= =3B > curl_setopt($ch=2C CURLOPT_RETURNTRANSFER=2C 1)=3B $postResult =3D curl_e= xec($ch)=3B > curl_close($ch)=3B print "$postResult"=3B > > ?> > > but no success with this code for now > > > i hope you will have time to help me with this=2C cuz i spent almost 5hou= rs > with no success > > > P.S: I'm not programer so i would like some help for beginner :) I'm sory > if i didn't do something right=2C because i'm using first time mail lists= . > > > > Thanks=2C Mladen > > _______________________________________________ > http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php > > ----_com.android.email_261398428164150 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8" <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html=3B charset=3Dutf-8"> </head> <body> <div>Hmm=2C thanks for your answer. =3B</div> <div><br> </div> <div>I'm not sure if i was clear enought. My idea was to put data in first = and second input=2C and then manually write captcha and manually submit the= form.</div> <div><br> </div> <div>Br Mladen</div> <br> <br> <div>-------- Original message --------</div> <div>From: Stephen Pynenburg &[email protected]>=3B </div> <div>Date:04/11/2014 07:32 (GMT+=3B01:00) </div> <div>To: curl with PHP &[email protected]>=3B </div> <div>Cc: </div> <div>Subject: Re: help with cURL +=3B PHP </div> <div><br> </div> <div> <div dir=3D"ltr"> <div> <div> <div>I think your problem is with the web site and not with cURL (there is = nothing really wrong with your code as it is).<br> </div> I can't read Slovenian=2C but it looks like below where it says:<br> "=3B<span id=3D"x_ctl00_ICContentPlaceHolder_lblCaptcha">Prosimo=2C pre= pi=C5=A1ite varnostno kodo v spodnje vnosno polje (velikost =C4=8Drk se ne = upo=C5=A1teva)."=3B<br> </span></div> <span id=3D"x_ctl00_ICContentPlaceHolder_lblCaptcha">It is asking you to in= put a CAPTCHA/verification code. This kind of measure=2C unfortunately=2C i= s designed to prevent exactly what you're trying to do.<br> <br> </span></div> <span id=3D"x_ctl00_ICContentPlaceHolder_lblCaptcha">Stephen<br> </span></div> <div class=3D"x_gmail_extra"><br> <div class=3D"x_gmail_quote">On Mon=2C Nov 3=2C 2014 at 5:30 PM=2C Mladen J= ovic <span dir=3D"ltr"> <=3B<a href=3D"mailto:[email protected]" target=3D"_blank">mladen.= [email protected]</a>>=3B</span> wrote:<br> <blockquote class=3D"x_gmail_quote" style=3D"margin:0 0 0 .8ex=3B border-le= ft:1px #ccc solid=3B padding-left:1ex"> <div> <div dir=3D"ltr"> <p style=3D"white-space:pre-wrap=3B color:rgb(20=2C24=2C35)=3B font-family:= Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana=2Carial=2Csans-serif= =3B font-size:13px=3B line-height:17.9400005340576px=3B background-color:rg= b(255=2C255=2C255)"> Hello=2C</p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> i saw this example code for cURL on: <a href=3D"http://curl.haxx.se/libcurl= /php/examples/httpfileupload.html" rel=3D"nofollow" target=3D"_blank" style= =3D"color:rgb(59=2C89=2C152)=3B text-decoration:none"> http://curl.haxx.se/libcurl/php/examples/httpfileupload.html</a></p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> i want to ask you if you can help me how i can use this for remote forms? <= /p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> <br> </p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> For example: <a href=3D"https://raz.zav-zdruzenje.si/infocenter/Search.aspx= " rel=3D"nofollow" target=3D"_blank" style=3D"color:rgb(59=2C89=2C152)=3B t= ext-decoration:none"> https://raz.zav-zdruzenje.si/infocenter/Search.aspx</a></p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> in this form i would like to fill up first and second input=2C but with you= r example looks like this is not possible for remote forms.</p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> <br> </p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> <br> </p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> My code now looks like: <=3B?php $ch =3D curl_init("=3B<a href=3D"htt= ps://raz.zav-zdruzenje.si/infocenter/Search.aspx" rel=3D"nofollow" target= =3D"_blank" style=3D"color:rgb(59=2C89=2C152)=3B text-decoration:none">http= s://raz.zav-zdruzenje.si/infocenter/Search.aspx</a>"=3B)=3B curl_setopt= ($ch=2C CURLOPT_POSTFIELDS=2C array('ctl00$ICContentPlaceHolder$dBoxFrom'=3D>=3B= "=3B24.10.2014"=3B=2C 'ctl00$ICContentPlaceHolder$tbVehicleRegistra= tionNumber'=3D>=3B'LJ FF 350'))=3B curl_setopt($ch=2C CURLOPT_RETURNTRANS= FER=2C 1)=3B $postResult =3D curl_exec($ch)=3B curl_close($ch)=3B print &qu= ot=3B$postResult"=3B=3B</p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> ?>=3B</p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> but no success with this code for now <span title=3D":(" style=3D"width:16p= x=3B min-height:16px=3B display:inline-block=3B vertical-align:top"> </span></p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> <br> </p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> i hope you will have time to help me with this=2C cuz i spent almost 5hours= with no success <span title=3D":)" style=3D"width:16px=3B min-height:16px=3B display:inline= -block=3B vertical-align:top"> </span></p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> <br> </p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> P.S: I'm not programer so i would like some help for beginner :) I'm sory i= f i didn't do something right=2C because i'm using first time mail lists.</= p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> <br> </p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> <br> </p> <p style=3D"margin-top:10px=3B white-space:pre-wrap=3B color:rgb(20=2C24=2C= 35)=3B font-family:Helvetica=2CArial=2C'lucida grande'=2Ctahoma=2Cverdana= =2Carial=2Csans-serif=3B font-size:13px=3B line-height:17.9400005340576px= =3B background-color:rgb(255=2C255=2C255)"> Thanks=2C Mladen</p> </div> </div> <br> _______________________________________________<br> <a href=3D"http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php" targe= t=3D"_blank">http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php</a><= br> <br> </blockquote> </div> <br> </div> </div> </body> </html> ----_com.android.email_261398428164150-- --_a838369e-f3f7-4008-8bb9-ec0bda240aaa_ Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaHR0cDovL2Nv b2wuaGF4eC5zZS9jZ2ktYmluL21haWxtYW4vbGlzdGluZm8vY3VybC1hbmQtcGhwCg== --_a838369e-f3f7-4008-8bb9-ec0bda240aaa_-- --===============1159572114== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaHR0cDovL2Nv b2wuaGF4eC5zZS9jZ2ktYmluL21haWxtYW4vbGlzdGluZm8vY3VybC1hbmQtcGhwCg== --===============1159572114==--