how would i:

1) goto a webpage:

www.testsite.com/WelcomeAct.do

2) login by passing credentials to:

<form name="logonForm" method="post" action="LogonSubmit.do">
<input type="text" name="username" maxlength="85" value="">
<input type="password" name="password" maxlength="32" value="">
</form>

3) navigate to another page

www.testsite.com/menuFormAction.do

4) parse that page for certain text using preg_match

5) perform an action if theres a match and do nothing if there isnt (debug output would tell me tho if something was there or not with an echo)

    [man]curl[/man] is your answer.
    Go straight to LogonSubmit.do with POST data set in curl. As far as I remember you have to give to curl some cookie file where it can save cookies it gets (e.g. session cookies). Then use curl once again for 3rd task and then do 4th and 5th (without curl 😉 )

      so...

      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, 'http://www.testsite.com/LogonSubmit.do');
      curl_setopt($ch, CURLOPT_POST, 1);
      curl_setopt($ch, CURLOPT_POSTFIELDS,'username=USER&password=PASS');
      curl_exec($ch);
      curl_close($ch);
      
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, 'http://www.testsite.com/menuFormAction.do');
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_exec($ch);
      $page = curl_getinfo($ch);
      curl_close($ch);
      
      //do regex stuff here
      

      ???

        Do not close the session and open it again. It will destroy cookie information.
        I may be mistaken, but return transfer should be set in the first one too, if you don't want output to the browser.

        I rarely used curl, so I mainly guess here.

          ok... code:

          <?php
          
          $ch = curl_init();
          curl_setopt($ch, CURLOPT_URL, 'http://www.testsite.com/LogonSubmit.do');
          curl_setopt($ch, CURLOPT_POST, 1);
          curl_setopt($ch, CURLOPT_POSTFIELDS,'username=USER&password=PASS');
          curl_exec($ch);
          curl_setopt($ch, CURLOPT_URL, 'https://www.testsite.com/menuFormAction.do');
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
          curl_exec($ch);
          $page = curl_getinfo($ch);
          curl_close($ch);
          
          print_r( $page );
          
          //do regex stuff here
          
          ?>
          

          this is what i get back:

          Array ( [url] => http://www.testsite.com/menuFormAction.do [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0 [namelookup_time] => 0 [connect_time] => 0.078 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => 0 [upload_content_length] => 0 [starttransfer_time] => 0 [redirect_time] => 0 )
          

          im not sure what the heck is going on, but im definitely not getting html back

            id guess thats b/c the function i use to set page doesnt return the html of the menuFormAction.do page... thats what i need..

              It's curl_exec that is supposed to return your page

              $page = curl_exec ( $ch );
              

                gah... so now im struggling with a cookies/sessions issue

                since ive already visited the site ive already choosen a "division" from a select field... then it would bring me to the login... now when i go back it just asks me to login

                but with curl, the page output is the page that is asking for the division

                "please select a division b4 you login"

                so i tried passing the value of the select i need like i did with the other post vars and it kicks back double on the output... that is the page is shown twice

                i know this isnt very clear or explicitive... if any users here are using roadrunner i could definitely get more help from you... im trying to monitor my account through their webmail panel

                https://provselfcare.nyroc.rr.com/subselfcare/

                the division i want is the first:

                option value="700000000000000021|alb-Albany Division (Capital Region)">alb-Albany Division (Capital Region)</option>
                

                so now heres my updated code... help!

                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL,'https://provselfcare.nyroc.rr.com/subselfcare/Division.do');
                curl_setopt($ch, CURLOPT_POST, 1);
                curl_setopt($ch, CURLOPT_POSTFIELDS,'division=700000000000000021|alb-Albany Division (Capital Region)');
                curl_exec($ch);
                curl_setopt($ch, CURLOPT_URL, 'https://provselfcare.nyroc.rr.com/subselfcare/LogonSubmit.do');
                curl_setopt($ch, CURLOPT_POST, 1);
                curl_setopt($ch, CURLOPT_POSTFIELDS,"username=$username&password=$password");
                curl_exec($ch);
                curl_setopt($ch, CURLOPT_URL, 'https://provselfcare.nyroc.rr.com/subselfcare/menuFormAction.do');
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                $page = curl_exec($ch);
                curl_close($ch);
                
                echo $page;
                

                  ok... im able to login.... but i cant browse to the next page:

                  $ch = curl_init();
                  curl_setopt($ch, CURLOPT_URL,'https://provselfcare.nyroc.rr.com/subselfcare/LogonSubmit.do');
                  curl_setopt($ch, CURLOPT_POST, 1);
                  curl_setopt($ch, CURLOPT_POSTFIELDS,"username=$username&password=$password&siteId=700000000000000021&divisionName=alb-Albany%20Division%20(Capital Region)");
                  //curl_setopt($ch, CURLOPT_URL, 'https://provselfcare.nyroc.rr.com/subselfcare/menuFormAction.do');
                  $page = curl_exec($ch);
                  curl_close($ch);
                  
                  echo $page;
                  

                  when i try to pass the commented line it blows up on their server

                    got it!!!

                    $ch = curl_init();
                    
                    curl_setopt($ch, CURLOPT_URL,'https://provselfcare.nyroc.rr.com/subselfcare/LogonSubmit.do');
                    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
                    curl_setopt($ch, CURLOPT_POSTFIELDS,"siteId=700000000000000021&divisionName=alb-Albany%20Division%20(Capital Region)&username=$username&password=$password");
                    $page = curl_exec($ch);
                    
                    preg_match('/;(.*)\"/',$page,$matches);
                    
                    curl_setopt($ch, CURLOPT_URL,'https://provselfcare.nyroc.rr.com/subselfcare/LogonSubmit.do;'.$matches[1]);
                    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
                    curl_setopt($ch, CURLOPT_POSTFIELDS,"siteId=700000000000000021&divisionName=alb-Albany%20Division%20(Capital Region)&username=$username&password=$password&methodToCall=");
                    curl_exec($ch);
                    
                    curl_setopt($ch, CURLOPT_URL,'https://provselfcare.nyroc.rr.com/subselfcare/menuFormAction.do;'.$matches[1]);
                    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
                    curl_setopt($ch, CURLOPT_POSTFIELDS,"siteId=700000000000000021&divisionName=alb-Albany%20Division%20(Capital Region)&username=$username&password=$password&methodToCall=userManagement");
                    $page = curl_exec($ch);
                    
                      Write a Reply...