PHP Classes

Double Redirect

Recommend this page to a friend!

      PHP HTTP protocol client  >  All threads  >  Double Redirect  >  (Un) Subscribe thread alerts  
Subject:Double Redirect
Summary:Send Post iframe
Messages:14
Author:SaruzzU
Date:2009-03-15 09:55:46
Update:2009-03-19 19:20:24
 
  1 - 10   11 - 14  

  1. Double Redirect   Reply   Report abuse  
Picture of SaruzzU SaruzzU - 2009-03-15 09:55:46
Hi,
congratulations for the class

I have a small problem during use, the scenario is this:

HTTPS login page (works ok) -> Iframe Redirect page (ok.. follow_redirect) -> send a request("post") to a page of the Frame (not working)

How can I send post variables on iframe after second step?

  2. Re: Double Redirect   Reply   Report abuse  
Picture of SaruzzU SaruzzU - 2009-03-15 10:12:12 - In reply to message 1 from SaruzzU
Error: 2 can not send request in the current connection state

  3. Re: Double Redirect   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-03-15 19:46:36 - In reply to message 1 from SaruzzU
HTTP redirects are always sent via GET method.

  4. Re: Double Redirect   Reply   Report abuse  
Picture of SaruzzU SaruzzU - 2009-03-15 21:31:28 - In reply to message 3 from Manuel Lemos
thanks for reply.

after login successfully perform the redirect.
The problem stems from the fact that the page has 2 frames, and the field where I have to run the new POST is sent to a page frame.

How can I force the redirect to that page(url iframe) and then send the POST variable?

  5. Re: Double Redirect   Reply   Report abuse  
Picture of SaruzzU SaruzzU - 2009-03-15 22:12:04 - In reply to message 4 from SaruzzU
Great Now follow other redirect... thx

  6. Re: Double Redirect   Reply   Report abuse  
Picture of SaruzzU SaruzzU - 2009-03-16 11:52:39 - In reply to message 5 from SaruzzU
other problem, now after last request print this error

<h1>Bad Request (Invalid Verb)</h1>

i see the form request and ADD all fields

  7. Re: Double Redirect   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-03-16 14:54:55 - In reply to message 5 from SaruzzU
I need to see what kind of request are you sending to figure why it is returning that message.

  8. Re: Double Redirect   Reply   Report abuse  
Picture of SaruzzU SaruzzU - 2009-03-16 16:56:15 - In reply to message 7 from Manuel Lemos

The previous step(Login->redirect FramePage) function properly
This is the last portion of code that don't response


the form on site is

The form consists of 1 field hidden (SSL KEY) 1 field of research and 1 button

the code
$url="https://PAGE_FRAME.aspx
$error3=$http->GetRequestArguments($url,$arguments3);
$arguments3["RequestMethod"]="POST";
$arguments3["PostValues"]=array(
'__VIEWSTATE' => $key2,
'txtSearch' => 'MY_SEARCH',
'cmdButton' => 'Button'
);

$arguments3["Referer"]=$ref;

$error3=$http->Open($arguments3);


$error3=$http->SendRequest($arguments3);


$header_name=Key($http->request_headers);


$headers=array();
$error3=$http->ReadReplyHeaders($headers);
$header_name=Key($headers);


$error3=$http->ReadReplyBody($body3,51000);

echo "<p>".HtmlSpecialChars($body3)."</p>";



  9. Re: Double Redirect   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-03-16 21:35:22 - In reply to message 8 from SaruzzU
Can you enable debug support and show the output of the class when you send that request?

  10. Re: Double Redirect   Reply   Report abuse  
Picture of SaruzzU SaruzzU - 2009-03-16 23:01:34 - In reply to message 9 from Manuel Lemos
i have enabled

var $debug=1;
var $debug_response_body=1;
var $html_debug=1;

where is the call for printing the debug message?

 
  1 - 10   11 - 14