You are here: Re: Having Trouble With CURL Function, Please Help « PHP Programming Language « IT news, forums, messages
Re: Having Trouble With CURL Function, Please Help

Posted by devranger on 12/15/06 08:23

Jerry Stuckle wrote:
> devranger wrote:
> > Rik wrote:
> >
> >>Andy Hassall wrote:
> >>
> >>>On 13 Dec 2006 10:44:06 -0800, "devranger" <knee-dragger@hotmail.com>
> >>>wrote:
> >>>
> >>>
> >>$data="MasterTemplate:_PageTemplate:cphCenterContent:CenterContent:fcDropDo
> >>wnList=ATVs&MasterTemplate:_PageTemplate:cphCenterContent:CenterContent:zip
> >>TextBox=77090";
> >>
> >>>>[snip] curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
> >>>
> >>> What's with the colons in the data? That doesn't look like the sort
> >>>of data
> >>>that you'd normally send in a POST.
> >>
> >>Yup, AFAIK it stil should e ampersands.
> >>Let cURL handle it though:
> >>$topost = array(
> >> 'key1' => 'value',
> >> 'key2' => 'value2'
> >> //etc...
> >>);
> >>curl_setopt($ch, CURLOPT_POSTFIELDS, $topost );
> >>
> >>--
> >>Rik Wasmus
> >
> >
> > Rik -
> >
> > So you are suggesting I use an array but what do you mean by e
> > ampersads? Does that mean the ":" should be and &?
> >
> > The reason I placed the colons is that they are just part of the field
> > input name I thought was necessary for the post. For instance, one
> > field on the form is called
> > MasterTemplate:_PageTemplate:cphCenterContent:CenterContent:zipTextBox.
> > Looks real weird to me as well but I do not know any other way to post
> > to the field than to call it as specified in the input name of the form
> > i.e. <input
> > name="MasterTemplate:_PageTemplate:cphCenterContent:CenterContent:zipTextBox"
> > type="text" maxlength="5"
> > id="MasterTemplate__PageTemplate_cphCenterContent_CenterContent_zipTextBox"
> > tabindex="1" class="dealertext" style="width:100px;" size="20" />
> >
> > Is this incorrect?
> >
> > Thank you.
> >
>
> It looks like your data is correct, but there could be all kinds of
> other reasons. For instance, they might be checking the HTTP_REFERER to
> ensure it comes from their own page. Or they could have started a
> session on the first page and check for it on the second. Or any of
> several other things.
>
> And I agree with Andy. It looks like maybe you're trying to scrape
> something from their page. They may not like it, but perhaps if you ask
> nicely they'll give it to you.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstucklex@attglobal.net
> ==================

Jerry / Andy

I am just doing this CURL as a test example. See I am new to
programming and I am learning php programming through a book called php
web development. I am catching on and in the book I was reading about
all the cool things you can do with CURL, so I started to do some
testing becasue this is how I learn. I have been sucessful with
posting to a few pages on different sites, but this one gave me trouble
and is kind of driving me crazy on why. I really have no use for the
data just getting it to work or figuring out why it may not work.

Now I see and have learned a couple things. You mentioned HTTP_REFERER
or they could have started a session. See I have learned through you
response becasue I had no idea these were limitation to CURL. That is
the book never mention it. Thank you.

Just for my reference is there any other limitation of CURL I should be
aware of?

Thank you.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация