Little regex tweak help please

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 ;-)
-- 
Nick W

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux