help with cURL + PHP
Mladen Jovic <[email protected]> Mon, 3 Nov 2014 23:30:31 +0100
| Newsgroups | gmane.comp.web.curl.php |
|---|---|
| Message-ID | <[email protected]> |
--===============1895478695==
Content-Type: multipart/alternative;
boundary="_707c4ed0-5d94-48b1-9314-b7b7977b370a_"
--_707c4ed0-5d94-48b1-9314-b7b7977b370a_
Content-Type: text/plain; charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
Hello=2Ci saw this example code for cURL on:=0A=
http://curl.haxx.se/libcurl/php/examples/httpfileupload.htmli want to ask y=
ou if you can help me how i can use this for remote forms?=20
For example:=0A=
https://raz.zav-zdruzenje.si/infocenter/Search.aspxin this form i would lik=
e to fill up first and second input=2C but with your example looks like thi=
s is not possible for remote forms.
My code now looks like:=0A=
<?php=0A=
$ch =3D curl_init("https://raz.zav-zdruzenje.si/infocenter/Search.aspx")=
=3B =0A=
curl_setopt($ch=2C CURLOPT_POSTFIELDS=2C=0A=
array('ctl00$ICContentPlaceHolder$dBoxFrom'=3D>"24.10.2014"=
=2C=0A=
'ctl00$ICContentPlaceHolder$tbVehicleRegistrationNumbe=
r'=3D>'LJ FF 350'))=3B=0A=
curl_setopt($ch=2C CURLOPT_RETURNTRANSFER=2C 1)=3B=0A=
$postResult =3D curl_exec($ch)=3B=0A=
curl_close($ch)=3B=0A=
print "$postResult"=3B?>but no success with this code for now=20
i hope you will have time to help me with this=2C cuz i spent almost 5hours=
with no success=20
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.
Thanks=2C Mladen =
--_707c4ed0-5d94-48b1-9314-b7b7977b370a_
Content-Type: text/html; charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<style><!--
.hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
font-size: 12pt=3B
font-family:Calibri
}
--></style></head>
<body class=3D'hmmessage'><div dir=3D'ltr'><p style=3D"white-space: pre-wra=
p=3B color: rgb(20=2C 24=2C 35)=3B font-family: Helvetica=2C Arial=2C 'luci=
da grande'=2C tahoma=2C verdana=2C arial=2C sans-serif=3B font-size: 13px=
=3B line-height: 17.9400005340576px=3B background-color: rgb(255=2C 255=2C =
255)=3B">Hello=2C</p><p style=3D"margin-top: 10px=3B white-space: pre-wrap=
=3B color: rgb(20=2C 24=2C 35)=3B font-family: Helvetica=2C Arial=2C 'lucid=
a grande'=2C tahoma=2C verdana=2C arial=2C sans-serif=3B font-size: 13px=3B=
line-height: 17.9400005340576px=3B background-color: rgb(255=2C 255=2C 255=
)=3B">i saw this example code for cURL on:=0A=
<a class=3D"_553k" href=3D"http://curl.haxx.se/libcurl/php/examples/httpfil=
eupload.html" target=3D"_blank" rel=3D"nofollow" style=3D"color: rgb(59=2C =
89=2C 152)=3B cursor: pointer=3B text-decoration: none=3B">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=2C 24=2C 35)=3B font-family=
: Helvetica=2C Arial=2C 'lucida grande'=2C tahoma=2C verdana=2C arial=2C sa=
ns-serif=3B font-size: 13px=3B line-height: 17.9400005340576px=3B backgroun=
d-color: rgb(255=2C 255=2C 255)=3B">i want to ask you if you can help me ho=
w i can use this for remote forms? </p><p style=3D"margin-top: 10px=3B whit=
e-space: pre-wrap=3B color: rgb(20=2C 24=2C 35)=3B font-family: Helvetica=
=2C Arial=2C 'lucida grande'=2C tahoma=2C verdana=2C arial=2C sans-serif=3B=
font-size: 13px=3B line-height: 17.9400005340576px=3B background-color: rg=
b(255=2C 255=2C 255)=3B"><br></p><p style=3D"margin-top: 10px=3B white-spac=
e: pre-wrap=3B color: rgb(20=2C 24=2C 35)=3B font-family: Helvetica=2C Aria=
l=2C 'lucida grande'=2C tahoma=2C verdana=2C arial=2C sans-serif=3B font-si=
ze: 13px=3B line-height: 17.9400005340576px=3B background-color: rgb(255=2C=
255=2C 255)=3B">For example:=0A=
<a class=3D"_553k" href=3D"https://raz.zav-zdruzenje.si/infocenter/Search.a=
spx" target=3D"_blank" rel=3D"nofollow" style=3D"color: rgb(59=2C 89=2C 152=
)=3B cursor: pointer=3B text-decoration: none=3B">https://raz.zav-zdruzenje=
.si/infocenter/Search.aspx</a></p><p style=3D"margin-top: 10px=3B white-spa=
ce: pre-wrap=3B color: rgb(20=2C 24=2C 35)=3B font-family: Helvetica=2C Ari=
al=2C 'lucida grande'=2C tahoma=2C verdana=2C arial=2C sans-serif=3B font-s=
ize: 13px=3B line-height: 17.9400005340576px=3B background-color: rgb(255=
=2C 255=2C 255)=3B">in this form i would like to fill up first and second i=
nput=2C but with your example looks like this is not possible for remote fo=
rms.</p><p style=3D"margin-top: 10px=3B white-space: pre-wrap=3B color: rgb=
(20=2C 24=2C 35)=3B font-family: Helvetica=2C Arial=2C 'lucida grande'=2C t=
ahoma=2C verdana=2C arial=2C sans-serif=3B font-size: 13px=3B line-height: =
17.9400005340576px=3B background-color: rgb(255=2C 255=2C 255)=3B"><br></p>=
<p style=3D"margin-top: 10px=3B white-space: pre-wrap=3B color: rgb(20=2C 2=
4=2C 35)=3B font-family: Helvetica=2C Arial=2C 'lucida grande'=2C tahoma=2C=
verdana=2C arial=2C sans-serif=3B font-size: 13px=3B line-height: 17.94000=
05340576px=3B background-color: rgb(255=2C 255=2C 255)=3B"><br></p><p style=
=3D"margin-top: 10px=3B white-space: pre-wrap=3B color: rgb(20=2C 24=2C 35)=
=3B font-family: Helvetica=2C Arial=2C 'lucida grande'=2C tahoma=2C verdana=
=2C arial=2C sans-serif=3B font-size: 13px=3B line-height: 17.9400005340576=
px=3B background-color: rgb(255=2C 255=2C 255)=3B">My code now looks like:=
=0A=
<=3B?php=0A=
$ch =3D curl_init("<a class=3D"_553k" href=3D"https://raz.zav-zdruzenje.=
si/infocenter/Search.aspx" target=3D"_blank" rel=3D"nofollow" style=3D"colo=
r: rgb(59=2C 89=2C 152)=3B cursor: pointer=3B text-decoration: none=3B">htt=
ps://raz.zav-zdruzenje.si/infocenter/Search.aspx</a>")=3B =0A=
curl_setopt($ch=2C CURLOPT_POSTFIELDS=2C=0A=
array('ctl00$ICContentPlaceHolder$dBoxFrom'=3D>=3B"24.10.2=
014"=2C=0A=
'ctl00$ICContentPlaceHolder$tbVehicleRegistrationNumbe=
r'=3D>=3B'LJ FF 350'))=3B=0A=
curl_setopt($ch=2C CURLOPT_RETURNTRANSFER=2C 1)=3B=0A=
$postResult =3D curl_exec($ch)=3B=0A=
curl_close($ch)=3B=0A=
print "$postResult"=3B</p><p style=3D"margin-top: 10px=3B white-space: p=
re-wrap=3B color: rgb(20=2C 24=2C 35)=3B font-family: Helvetica=2C Arial=2C=
'lucida grande'=2C tahoma=2C verdana=2C arial=2C sans-serif=3B font-size: =
13px=3B line-height: 17.9400005340576px=3B background-color: rgb(255=2C 255=
=2C 255)=3B">?>=3B</p><p style=3D"margin-top: 10px=3B white-space: pre-wr=
ap=3B color: rgb(20=2C 24=2C 35)=3B font-family: Helvetica=2C Arial=2C 'luc=
ida grande'=2C tahoma=2C verdana=2C arial=2C sans-serif=3B font-size: 13px=
=3B line-height: 17.9400005340576px=3B background-color: rgb(255=2C 255=2C =
255)=3B">but no success with this code for now <span title=3D":(" class=3D"=
emoticon emoticon_frown" style=3D"width: 16px=3B height: 16px=3B display: i=
nline-block=3B vertical-align: top=3B background-image: url(https://fbstati=
c-a.akamaihd.net/rsrc.php/v2/yP/r/90b8T5aM1AH.png)=3B background-size: auto=
=3B background-position: 0px -7765px=3B background-repeat: no-repeat=3B"></=
span></p><p style=3D"margin-top: 10px=3B white-space: pre-wrap=3B color: rg=
b(20=2C 24=2C 35)=3B font-family: Helvetica=2C Arial=2C 'lucida grande'=2C =
tahoma=2C verdana=2C arial=2C sans-serif=3B font-size: 13px=3B line-height:=
17.9400005340576px=3B background-color: rgb(255=2C 255=2C 255)=3B"><br></p=
><p style=3D"margin-top: 10px=3B white-space: pre-wrap=3B color: rgb(20=2C =
24=2C 35)=3B font-family: Helvetica=2C Arial=2C 'lucida grande'=2C tahoma=
=2C verdana=2C arial=2C sans-serif=3B font-size: 13px=3B line-height: 17.94=
00005340576px=3B background-color: rgb(255=2C 255=2C 255)=3B">i hope you wi=
ll have time to help me with this=2C cuz i spent almost 5hours with no succ=
ess <span title=3D":)" class=3D"emoticon emoticon_smile" style=3D"width: 16=
px=3B height: 16px=3B display: inline-block=3B vertical-align: top=3B backg=
round-image: url(https://fbstatic-a.akamaihd.net/rsrc.php/v2/yP/r/90b8T5aM1=
AH.png)=3B background-size: auto=3B background-position: 0px -7986px=3B bac=
kground-repeat: no-repeat=3B"></span></p><p style=3D"margin-top: 10px=3B wh=
ite-space: pre-wrap=3B color: rgb(20=2C 24=2C 35)=3B font-family: Helvetica=
=2C Arial=2C 'lucida grande'=2C tahoma=2C verdana=2C arial=2C sans-serif=3B=
font-size: 13px=3B line-height: 17.9400005340576px=3B background-color: rg=
b(255=2C 255=2C 255)=3B"><br></p><p style=3D"margin-top: 10px=3B white-spac=
e: pre-wrap=3B color: rgb(20=2C 24=2C 35)=3B font-family: Helvetica=2C Aria=
l=2C 'lucida grande'=2C tahoma=2C verdana=2C arial=2C sans-serif=3B font-si=
ze: 13px=3B line-height: 17.9400005340576px=3B background-color: rgb(255=2C=
255=2C 255)=3B">P.S: I'm not programer so i would like some help for begin=
ner :) I'm sory if i didn't do something right=2C because i'm using first t=
ime mail lists.</p><p style=3D"margin-top: 10px=3B white-space: pre-wrap=3B=
color: rgb(20=2C 24=2C 35)=3B font-family: Helvetica=2C Arial=2C 'lucida g=
rande'=2C tahoma=2C verdana=2C arial=2C sans-serif=3B font-size: 13px=3B li=
ne-height: 17.9400005340576px=3B background-color: rgb(255=2C 255=2C 255)=
=3B"><br></p><p style=3D"margin-top: 10px=3B white-space: pre-wrap=3B color=
: rgb(20=2C 24=2C 35)=3B font-family: Helvetica=2C Arial=2C 'lucida grande'=
=2C tahoma=2C verdana=2C arial=2C sans-serif=3B font-size: 13px=3B line-hei=
ght: 17.9400005340576px=3B background-color: rgb(255=2C 255=2C 255)=3B"><br=
></p><p style=3D"margin-top: 10px=3B white-space: pre-wrap=3B color: rgb(20=
=2C 24=2C 35)=3B font-family: Helvetica=2C Arial=2C 'lucida grande'=2C taho=
ma=2C verdana=2C arial=2C sans-serif=3B font-size: 13px=3B line-height: 17.=
9400005340576px=3B background-color: rgb(255=2C 255=2C 255)=3B">Thanks=2C M=
laden</p> </div></body>
</html>=
--_707c4ed0-5d94-48b1-9314-b7b7977b370a_--
--===============1895478695==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaHR0cDovL2Nv
b2wuaGF4eC5zZS9jZ2ktYmluL21haWxtYW4vbGlzdGluZm8vY3VybC1hbmQtcGhwCg==
--===============1895478695==--