#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    2
    Rep Power
    0

    Extract url from action="" using regex


    I am trying to develop a plugin for site clicksee.co.uk for multiclicker2. it needs url from action to be retrievd using regex. below is the code from a website

    form id="loginform" name="loginform" action="" method="post"
    and

    form action="" method="post"

    As there is no action in the the from , How can i retrive action url path using regex.

    I am using the following regex to retrieve action, but it returns empty.

    <form action="(.*?)"
    someone told me that its relative url not absolute url.

    Can some one pls help me in this. Thanks
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    I don't really understand your thought process.

    You already saw that the action attribute is empty. Yet still you tried to extract something(?) from it -- just to realize that it is in fact empty. Does that surprise you? What did you expect to get from an empty string?

    Regexes cannot extract nonexistent characters. An empty string is empty, there's nothing you can do about that.

    Yes, an empty action attribute does point to the current URL. So the form target is the same URL you used to access the document.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    2
    Rep Power
    0
    I wanted to get login.php (the page where form sends it data), but u mentioned , that the target will be the same page. i will check it .....

IMN logo majestic logo threadwatch logo seochat tools logo