[Système] fwrite et variable
bonjour
comment faire pour qu'une variable ne soit pas exécutée dans un script
en effet j'ai unhebergement dreamhost et il autorise pas les include distant il faut donc que je passe par un bazard pas possible pour contourner le probleme
voici le morceau de script original
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
$keywords_dashes[$counter] = rtrim($keywords_dashes[$counter]);
$siteip = "<?php \$clientip = \$_SERVER['REMOTE_ADDR']; ?>";
$site_inc = $siteip."<?php include('$site/".$rssgmfoldername."/$template_pages?keyword=$keywords_dashes[$counter]&yourip='.\$clientip); ?>";
$filename = "../".$keywords_dashes[$counter].".php";
$handle = fopen($filename,"w");
chmod($filename, 0777);
fwrite($handle, $site_inc);
} |
voici le que j'essais de faire
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
$keywords_dashes[$counter] = rtrim($keywords_dashes[$counter]);
$siteip = "<?php \$clientip = \$_SERVER['REMOTE_ADDR']; ?>";
$site_inc = $siteip."<?php
$ch0 = curl_init();
\$timeout = 5; // set to zero for no timeout
curl_setopt ($ch0, CURLOPT_URL, '$site/".$rssgmfoldername."/$template_pages?keyword=$keywords_dashes[$counter]&yourip='.\$clientip);
curl_setopt ($ch0, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch0, CURLOPT_CONNECTTIMEOUT, $timeout);
$xml = curl_exec($ch0);
curl_close($ch0);?>";
$filename = "../".$keywords_dashes[$counter].".php";
$handle = fopen($filename,"w");
chmod($filename, 0777);
fwrite($handle, $site_inc);
} |
le but est d'ecrire sur une page html un script de redirection
ce que le premier script ecrit:
Code:
1 2
|
<?php $clientip = $_SERVER['REMOTE_ADDR']; ?><?php include('http://mon-domain.com/monfolder/theindex.php?yourip='.$clientip); ?> |
ce que je voudrais que le second script écrive:
Code:
1 2 3 4 5 6 7 8 9 10
|
<?php $clientip = $_SERVER['REMOTE_ADDR']; ?>
<?php
$ch0 = curl_init();
\$timeout = 5; // set to zero for no timeout
curl_setopt ($ch0, CURLOPT_URL, '$site/".$rssgmfoldername."/$template_pages?keyword=$keywords_dashes[$counter]&yourip='.\$clientip);
curl_setopt ($ch0, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch0, CURLOPT_CONNECTTIMEOUT, $timeout);
$xml = curl_exec($ch0);
curl_close($ch0);?> |
désolé pour la longueur de ce post
merci de votre éventuelle aide