views:

113

answers:

1

Hello,

I'm adding to a PHProxy script to GET a certain page and fills in required forms with cURL and some R.E. This page is usually submitted with a button. I'm not posting directly to a page because the other server uses an IIS server with an 'viewstate' variable that I can't seem to proxyify correctly without receiving viewstate errors from the remote server due to what I think is the callback javascript function that is passed to it by the client browser's click.

Being that I'm writing a proxy script I want my PHP code to be able to execute the javascript (e.g. pushing the submit button) and send back the result, without ever revealing the intermediate, originally requested page.

Does anyone know how I can go about doing this?

Here is the javascript callback function that I would like to call from within PHProxy:

    <input type="submit" name="ctl02$ctl01$ctl00$btnLogin" value="   Sign In   " onclick="javascript:WebForm_DoPostBackWithOpti
ons(new WebForm_PostBackOptions(&quot;ctl02$ctl01$ctl00$btnLogin&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="ctl02_ctl01_ctl
00_btnLogin" class="LoginButton" />
A: 

Solved it myself, sort of.

You can embed a javascript interpreter into your code like PECL's SpiderMonkey. However, in order to click a button you would need to recreate a DOM from a section of HTML/CSS/Javascript code like a browser does in order to click on of its buttons, and currently there aren't and modules that I can find that do this.

Referenced http://stackoverflow.com/questions/3231444/does-phps-http-class-support-javascript

gnucom