Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Senior Member Stylise's Avatar
    Join Date
    Jul 2005
    Location
    Mount Martha, Australia
    Posts
    229
    Member #
    10679
    I'm trying to get the html of a page, using either file() or fsockopen() but the page redirects to the login page in you're not logged in. I'm guessing you can send POST VARS to the form on that page and pass it thru? Either using the fsocketopen() function or even cURL?

    Any help/comments would be great,
    Cheers

  2.  

  3. #2
    Senior Member visualAd's Avatar
    Join Date
    Jan 2003
    Location
    Slough, UK
    Posts
    201
    Member #
    434
    I recommend that you do some research into how the site logs the user in. If it requires a secure connection or sets session cookies then I would recommend that you use cUrl as it handles all this for you.

    CUrl is quite easy to use, but does need to be installed on the server to work. Extending the example from the PHP site, to send a post request you would dio the following:
    PHP Code:
    <?php
    // create a new CURL resource
    $ch curl_init();

    // set URL and other appropriate options
    curl_setopt($chCURLOPT_URL"http://www.example.com/form.php");
    curl_setopt($chCURLOPT_HEADERfalse);
    curl_setopt($chCURLOPT_POSTtrue);
    curl_setopt($chCURLOPT_POSTFIELDS'var1=value&var2=vlaue&var2=value');

    // grab URL and pass it to the browser
    curl_exec($ch);

    // close CURL resource, and free up system resources
    curl_close($ch);
    ?>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:31 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com