i am new with php i think that my problem is simple http://www.facebook.com/share.php?u=PERMALINK&t=TITLE $info[0] in the title $_SERVER['HTTP_REFERER'] in the u i want your help my code <?php // Get Site Title function getSiteTitle(){ $RefURL = (is_null($_SERVER['HTTP_REFERER'])) ? 'Un know' : $_SERVER['HTTP_REFERER']; if($RefURL != 'Un know'){ $con = file_get_contents($RefURL) or die (" can't open URL referer "); $pattern = "/<title>(.+)<\/title>/i"; preg_match($pattern,$con,$match); $result = array($match[1],$RefURL); return $result; } else{ return false; } } $info = getSiteTitle(); ?> <?php echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>'.$info[0].'</title> <meta http-equiv="Content-type" content="text/html; charset=UTF-8" /> <meta name="robots" content="noodp,noydir" /> <link type="text/css" rel="stylesheet" href="/wp-content/plugins/hunk-external-links/redirect.css" /> </head> <body class="UIFramedPage"> <table style="height: 100%;" id="page_table" class="page_table unknown_page" cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="content_cell" id="content_cell"> <div class="content_cell_inner_shadow"> </div> <iframe id="content_iframe" class="content_iframe" name="content_iframe" src="'.$_GET['hr'].'" scrolling="auto" frameborder="0"></iframe> </td> </tr> <tr> <td class="header_cell" id="header_cell"> <div class="url_bar unknown_url"> <a title="Remove frame and go to this web address." class="url_fragment" href="'.$_SERVER['HTTP_REFERER'].'">'.$info[0].'</a> العودة الى [COLOR="#FF0000"][SIZE=5] <a href="http://www.facebook.com/share.php?u=PERMALINK&t=TITLE">share</a> [/SIZE][/COLOR] </div> </td> </tr> </tbody> </table> </body> </html>'; ?> Code (markup):
Dunno if this will help, but you could use a heredoc instead of trying to put that big string in single quotes. That would help you avoid any syntax errors being caused by quotes. Here's an example: $var = array("MEMEME"); ECHO<<<EOF Hello, I am $var[0] EOF;
Hy, Try replace (is_null($_SERVER['HTTP_REFERER'])) ? 'Un know' : $_SERVER['HTTP_REFERER']; with a valid url and see what you get with var_dump($info). I tested the code and it works fine.