Php and javascript

Links for php scripts

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Mon Jul 14, 2014 1:36 pm

Php and javascript

Postby Lupigando » Mon Jul 14, 2014 1:53 pm

I am writing a code with php to autologin to a website with cUrl , i did that successfully , but my aim not to login only , i want to navigate through some pages in the site and print data , it's not a problem it can be done with cUrl , but in my case , there is an .aspx page containing combobox , with javascript _dopostback , so i need to excute a javascript to bypass it and it's impossible with curl ....
The login page is
Page with combobox

Any ideas :) ?

php-forum Active User
php-forum Active User
Posts: 376
Joined: Thu Mar 15, 2012 3:59 pm

Re: Php and javascript

Postby landi » Wed Aug 06, 2014 2:50 am

I've only used curl a couple of times and so I don't know about any tricks to call javascript, but IHMO it is unlikely since js is executed by the browser, and curl does not emulate a browser, it just retrieves data using http etc.

I'm not sure WHY you want to do this, so it is difficult to think of alternatives but assuming you are trying to print a report that you can get after selecting multiple parameters from the drop downs, then one of these ideas might help:

1) If you only need one set of values, set the drop downs manually to those values and look at the final url that is called. It's probably something like run_report.aspx?acedemic_year=2012&semester=fall. You could then use curl to call that directly.

2) Or: If you need to change the parameters, then find out where jquery is getting the values from, and get them yourself and then do (1)

3) Or: Write a php page to run the javascript and call that from the browser that is runing the page you write (maybe in an iframe).

Hope that helps

Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 3 guests