I want to pull information from ASP site/database, no api or server access

Discussion in 'Programming' started by Anveto, Oct 6, 2011.

Thread Status:
Not open for further replies.
  1. #1
    I don't have access to server or api, I can make a search and see the results, the information is open to the public.

    I have a site in php and I need to verify that the information entered on my site when users register matches what is on the above site. I would also like to update information from the database when they update it, so it would be good if I could check it automatically.

    Any ideas on how to do this, is it possible, what is the best way to do it? Any ideas or tips?
     
    Anveto, Oct 6, 2011 IP
  2. mrmuggles

    mrmuggles Greenhorn

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #2
    The only way to do it if you don't have direct access to the DB, is to parse the HTML the Website is sending in it's response when you query it.
    Use CURL to make a HTTP query from your PHP page to the Website and then parse the results.
     
    mrmuggles, Oct 7, 2011 IP
  3. sarahk

    sarahk iTamer Staff

    Messages:
    28,832
    Likes Received:
    4,541
    Best Answers:
    123
    Trophy Points:
    665
    #3
    Look at php.net for information on how to submit the form using curl too, it will help :)

    For the sake of your site's performance save the results in a database and use that to build your pages.
     
    sarahk, Oct 8, 2011 IP
  4. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #4
    Ok, I have looked at curl and I will try an example later tonight, but submitting it via post does not seem like it will work, first of all the name of the input fields have variables in them?

    If i type this then the form does not come up with anything

    I have tried using the full name of the input and it didnt work either.

    Since this is an aspx site and it seems to be using javascript for the results will curl still be a good option?

    Thanks!
     
    Anveto, Oct 8, 2011 IP
  5. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #5
    Enter valid information on the site and submit it (click the button, I guess - I don't read Swedish). Then copy the URL from your browser's address bar and paste it here. (That's the URL you have to go to in order to get the information about that person/item/whatever.) You're probably missing something in "DropDownListCounty=Blekinge".
     
    Rukbat, Oct 8, 2011 IP
  6. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #6
    Thats my problem :) there is nothing in the url, you only have to type in one letter in any field and it will return results, there is no validation. So i go to distrikt and select Blekinge which is like a county in sweden for example and it takes a while but finally it will give me about 1600 results of players in that county. but the url has nothing added to it?

    It seems to be getting the results via javascript or ajax, well im guessing both are combined?
    so if the form is submitted and returned via ajax or javascript can i still use curl?

    Thanks for the help so far!
     
    Anveto, Oct 8, 2011 IP
  7. nemanja.todic

    nemanja.todic Well-Known Member

    Messages:
    69
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    130
    #7
    Hi,

    There is nothing in the url because parameters are sent using POST method instead of GET. You can still find out what parameter names are by using tool like Firebug( for firefox) or, if you are using Chrome, just open pre-installed Developer tool by pressing CTRL + SHIFT + i. In both cases you need to observe "Network" tab. Google it a bit, it's highly usable tool for web development.

    Additional problem is that this site is using ASP.NET, so most of form data is sent through "viewstate". To "decode" viewstate you can use tools like this one: http://lachlankeown.blogspot.com/2008/05/online-viewstate-viewer-decoder.html

    At first sight, it looks like you need to pass this parameters:

    ctl00%24MainContentPlaceHolder%24MaintainLicences1%24TextBoxLicNbr:Licensnr
    ctl00%24MainContentPlaceHolder%24MaintainLicences1%24TextBoxFirstName:nemanja
    ctl00%24MainContentPlaceHolder%24MaintainLicences1%24TextBoxSurName:todic
    ctl00%24MainContentPlaceHolder%24MaintainLicences1%24TextboxClub:DigitalPoint
    ctl00%24MainContentPlaceHolder%24MaintainLicences1%24DropDownListCounty:
     
    nemanja.todic, Oct 9, 2011 IP
    sarahk likes this.
  8. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #8
    Thanks, the decoder* wont do it, seems like its encrypted was the error i got, here is the viewstate i found on the page

     
    Anveto, Oct 9, 2011 IP
Thread Status:
Not open for further replies.