non sono molto pratico
allora ho un file links.php che ha una tabella con il seguente codice
Codice PHP:
//Retriving informations from database mysql_connect(*****); mysql_select_db("*****"); $result = mysql_query(******); print "<table style='table-layout:fixed' border='0' > <col width=130> <col width=200> <col width=260><style> td {overflow:hidden;} </style> "; while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $ref=$row['ref']; print " <tr> <td><div style= 'text-align:center;height: 150px;padding: 5px 5px 5px 5px;overflow:hidden;'>[url='$ref']<font color='#090'>$title </font>[/url]</div></td> </tr>"; } print"</table>"; ?>
questo file viene caricato in un iframe in un blog cliccando sui link generati in questa tabella ovviamente come referrer ottengo quello del server che ospita il file links.php invece io vorrei ottenere come referrer l'indirizzo del blog
ho visto un po in giro alla fine ho trovato delle funzioni tipo
Codice PHP:
<?php // THIS CREATES A FAKE USER AGENT ini_set('user_agent','My Fake Browser'); // THIS CREATES A FAKE REFERRER $host = "www.syntaxmaster.info"; $referrer = "www.fake_referrer.com"; $file = "test.php"; $hdrs = array( 'http' => array( 'header' => "accept-language: en\r\n" . "Host: $host\r\n" . "Referer: [url]http://[/url]$referrer\r\n" . "Content-Type: text/plain\r\n" ) ); $context = stream_context_create($hdrs); $fp = fopen("http://" . $host . "/" . $file, 'r', false, $context); fpassthru($fp); fclose($fp); ?>
ma non saprei come applicarla mi date una mano? oppure se usando qualche trucco tipo redirect o altro non so ditemi voi grazie