Warning: ereg() [function.ereg]: REG_EMPTY in....

Discussion in 'PHP' started by Browning, Feb 4, 2009.

  1. #1
    .../php/getURL.php on line 10

    
    <?php
    
    if (isset($_GET{'url'})){
    	$url=$_GET{'url'};
    	$url=trim($url);
    
    	if (strstr($_GET['url'],"youtube.com")){
    		$data = @file_get_contents($_GET['url']);
    		@preg_match('#/watch_fullscreen\?video_id=([a-z0-9-_]+)&l=([0-9]+)&t=([a-z0-9-_]+)#i', $data, $matches);
    		if (ereg($matches[1], $_GET['url'])) {
    			Header("Location: http://www.youtube.com/get_video?video_id=$matches[1]&l=$matches[2]&t=$matches[3]");
    		} 
    	}
    
    Code (markup):

    Is there a way to fix this?
     
    Browning, Feb 4, 2009 IP