Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Remove new line from encoded url string

$
0
0

Hello,

 

 

 

Code:

 

 

<?php
$mylink = $_GET["link"];
$final_link = $mylink;
 
if( strpos($mylink,"test")>0)
{
 $tmp = "mystring1".$mylink."mystring2";
 $final_link = urlencode($tmp);
 $loc = "Location: ". $final_link;
 echo $loc;
 //header($loc); 
 exit();
}
 
?>
 
 

 

I have written above php code, problem is, when i echo "loc" i get this

 

1st line : Location: 

2nd line : http

 

So, when i do header($loc), i adds "/" in between Location and http and page won't be forwaded.

 

Please help.

 

 


Viewing all articles
Browse latest Browse all 13200

Trending Articles