chasethemetal Posted September 28, 2011 Share Posted September 28, 2011 Hey everyone! I have a script someone on the forum helped me with awhile back that takes the contents of src="" from an embedded video. It works fine with I run this script in a while loop. But I am trying to get the match to work on the fly with $_POST method instead now, and it's not working. Here's the code... and I'm confused as to why it doesnt work by getting the content from a $_POST but gets it when its pulling it from a database in a while loop. the working script while($info = mysql_fetch_array( $data )) {$pattern[1] = '/src="([^"]+)"/i';preg_match($pattern[1], $info['file'], $match);echo $match[1];} $info['file'] is video embed info like...<iframe src="http://player.vimeo.com/video/00000000?title=0&byline=0&portrait=0" width="400" height="225" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe> and $match[1] will return me "http://player.vimeo.com/video/00000000?title=0&byline=0&portrait=0" BUT now I want it to work like this, but it doesn't seem to work... $pattern[1] = '/src="([^"]+)"/i';preg_match($pattern[1], $_POST['file'], $match);echo $match[1]; Thanks any help would be AWESOME! Link to comment Share on other sites More sharing options...
Ingolme Posted September 28, 2011 Share Posted September 28, 2011 Have you checked to see if $_POST['file'] is what you expected it to be? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.