Re: I need help with PHP, cURL, and POST

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, January 2, 2007 8:56 pm, Charley wrote:
> What do you mean about the submit input?  I
> thought that was just a text link to cause
> the form to be submitted when clicked.  I
> didn't know that it sent anything to the
> server.  (As you can tell, I don't know
> anything about asp except what it stands
> for.)

<input type="submit" />

This line in HTML, with variations, *WILL* send another &submit=Submit
as part of the HTTP request.

If you don't send that part, ASP scripts will puke on your pretty blue
suede shoes, more often than not, in my experience.

Never mind that Netscape 2 didn't send this field when you hit "Enter"
instead of actually clicking the button for a one-button form (default
action: submit).  MS never cared about interoperability then, and they
don't now, and I don't expect them to ever care in the future, no
matter how many times they claim to "embrace and extend" (or whatever
their slogan is this week).

> The paymentidfilter is a legitimate field,
> and works in the form and in the GET version
> of the cURL stuff.

Okay -- It just wasn't in the FORM, so wanted to check.

> It seems that e-gold has as its error
> response to send the login page for whatever
> one is asking for.  This is not very helpful
> (at least to me).

Oh, but it's *VERY* helpful.

It tells you that you are not "proving" to the server that you are a
legitimate logged-in user.

Which, in turn, means that somehow you need to do just that -- Fool
their server into accepting and maintaining your login credentials.

What this usually entails is something like this:

$curl = curl_init();

//login:
curl_setopt(CURLOPT_URL, ".../login.asp");
curl_setopt(CURLOPT_POSTDATA, "username=foo&password=bar");
curl_setopt(CURLOPT_COOKIEJAR,
"/full/path/to/php/writable/cookie/storage/file.txt");
curl_setopt(CURLOPT_COOKIEFILE,
"/full/path/to/php/writable/cookie/storage/file.txt");

//get data we actually want
//the script you currently have gets pasted in here

> I'll see if I can get this LiveHTTPheaders
> thing for firefox, since firefox is my main
> browser.
>
> From what I read, the cookie jar and file
> options take the name of the same file as
> their arguments.  Is there any path
> information that is required?  Can I just use
> something like "mycookies.txt" or must it
> have a specific extension?

The only restriction is that it MUST be readable/writable by the User
php runs as, so that PHP can write down the cookies it gets, and spit
them back to "prove" that it is still a valid user.

You also cannot use the COOKIE(JAR|FILE) with the CURLOPT_HEADER
option that lets you see the other headers. :-(  If you need the other
headers, you have to manage the cookies on your own instead of letting
curl do it for you.  This is not all that tricky, really, once you
look at what a Cookie actually looks like in the headers.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux