Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need a function. $60 (regex needed)

    This function I need will need some knowledge about regex.

    The input for the function will be a url to a webpage. That webpage may have one or more forms in it. (or no forms) What I want the function to do, is grab that page, parse the html, and return the forms in an array with all the field names and field types

    function findForms($url_to_page){

    }

    return:
    an array with all the forms on that page, the array will include the form action, method (post/get), field names, and field types. Preferably if one of the input fields is a select, then also an array of the select options.

    It is important that it is able to detect multiple forms and not mix the fields together.
    Code:
    array(
     [0] => array(
         ['action'] => "http://www.urltoformaction"
         ['method'] => "post"
         ['fields'] => array( // first field
                         ['name'] => id, 
                         ['type'] => hidden,
                         ['value'] => 23
                      ),
                      array( // second field
           )
     [1] => array(... //second form

    PM or email me if this sounds possible for you. or if anything is unclear.
    Can pay with epassporte or paypal

  • #2
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    PM Sent


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •