Forum Moderators: coopster
<form method="post" action="http://www.someurl.com"
name="somename">
with my regex
preg_match('/action\s*=\s*"([^"]+)"/i', $result, $actionval);
Now that takes it up to the URL, but if there is a second form on that page above it it does not work.
Is there an easy way to include the
name="somename"
into the regex.
Is this a monster task to complete.
Cheers
Now that takes it up to the URL, but if there is a second form on that page above it it does not work.
preg_match() will stop searching after the first match. May be a job for preg_match_all() [php.net] if you need to match more than one.
Second part, if you want to include the value of the name attribute, and it always follows the action attribute, just add it to your existing regex
'/action\s*=\s*"([^"]+)".*name\s*=\s*"([^"]+)"/is'Note the "s" modifier [php.net] here as well!