hello all,
I am using preg_match() to find the action attribute on a form. This regex works very well:
preg_match('/action\s*=\s*"([^"]+)"/i', $result, $actionval);
However, if my user has put another form above the one im looking for, (like a search box) it fails to grab the correct action attr.
The html *always* looks like this:
<form method="post" action="http://example.com/someForm.cgi" name="user_notification" [some other stuff here]>
This is my attempt to find the correct one so far:
'/action\s*=\s*"([^"]+)".*name\s*=\s*"([^"]+)"/is'
im having trouble putting the 'user_notification' bit in...
This does not work:
'/action\s*=\s*"([^"]+)".*name\s*=user_notification\s*"([^"]+)"/is'
Can anyone help? - much thanks ;-)
You missed the quotes around user_notification, and also possible white chars
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php