Results 1 to 5 of 5

Thread: Using cURL

  1. #1
    Join Date
    Apr 2002
    Posts
    221

    Using cURL

    When using cURL, how is it possible (or is it possible at all) to connect to a web server, submit a log in form, then load a page from within.

    For example, say you have Ensim on your server. Ensim requires you to log in via the web then perform administration on a server. Say I wanted to run a PHP script that created a new account. How could I go about submitting that?

    Thanks in advance!

    *I've checked the cURL and the PHP.net references.

    James

  2. #2
    Join Date
    Oct 2001
    Posts
    307
    I suppose it's using a cookie for session tracking? In that case you'd probably use cURL to post the login name and password, which will return a page and also a session cookie. Then, make a second cURL request to post whatever function you need, and include the cookie you received in the first response.

    So first find out if it uses cookies. (Turn off cookies in your browser) also watch for big random strings in the URL... could be passed that way.
    Adam
    GetWebSpace.com
    Personal Life Timed Out Due To Inactivity

  3. #3
    Join Date
    May 2002
    Posts
    69
    Personally, I've never had much luck with cURL. IMO, Wget seems easier to use.
    http://evilpuppy.com
    where developers gather...

  4. #4
    Join Date
    Oct 2001
    Posts
    307
    Wget's great for command-line but I've also had great success with using the PHP cURL functions to post SSL eCommerce transactions. Maybe both would be equally suited, really.
    Adam
    GetWebSpace.com
    Personal Life Timed Out Due To Inactivity

  5. #5
    Join Date
    May 2002
    Posts
    69
    Quite right!
    cURL strikes me as something that would probably make more sense on a linux box. The thing I found intruiging about both programs is how they interact with scripting languages. It's a great concept really.

    In regard to the origenal question though, what if you go about it from a different angle? For example, you could do a direct insert through a query string (assuming you can control the remote server). This way you may not neccessarily need to submit a form in order to achieve the desired result.

    Just a thought.


    Just a thought.
    http://evilpuppy.com
    where developers gather...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •