Reputation: 11
what's wrong?! line 16 is: header('Location: '.$get_link.'');
<?php
require_once("../libs/proxy.php");
require_once("../libs/config.php");
require_once("../libs/ip.php");
$rnd = intval(rand(1000,9999)); //generate random number
$lnk_lnk = "../$db_name/lnk/$userip.xxx"; //link path
$api_url = "http://btc.ms/?api=$btcms_api&url=$site_url/links/verifier.php?
id=$rnd&format=text";
$get_link = file_get_contents($api_url);
if (!empty($get_link)) {
$m_lnk = fopen($lnk_lnk, "w"); //open link file
fwrite($m_lnk, $rnd); //store random value
fclose($m_lnk);
header('Location: '.$get_link.''); //here is line 16!
} else {
header("Location: ../index.php?lnkmsg=Unknown Error.");
}
?>
thanks for help! . . . . . . . . . . .
Upvotes: 1
Views: 496
Reputation: 1731
Maybe your URL contain multiple lines. You can use the function urlencode()
to correct this error.
Try this,
header('Location: '.urlencode($get_link)); //here is line 16!
Upvotes: 1