I am using a PHP script to generate a javascript with various options depending on users requirements. The generated javascript is generating url's like http%3A%2F%2Fwww.mysite.com%2Ftestpage.php&chan=n&num=0 instead of <!-- m --><a class="postlink" href="http://www.mysite.com/testpage.php?chan=n&n=0">http://www.mysite.com/testpage.php?chan=n&n=0</a><!-- m -->. The script im using is feed2js which provides rss feeds through javascript. Any one know how to fix it? The line of code which apparently is the problem reads:
$rss_str = "$my_dir/feed2js.php?src=http://www.htmlforums.com/archive/index.php/" . urlencode($src) . "&chan=$chan&num=$num&desc=$desc&date=$date&targ=$targ";
and the documentation states that changing it to the following should fix it but it didn't
$rss_str = "$my_dir/feed2js.php?src=http://www.htmlforums.com/archive/index.php/" .htmlspecialchars(urlencode($src)) .
htmlspecialchars("&chan=$chan&num=$num&desc=$desc&date=$date&targ=$targ");
I hope some one can help!I forgot to attach the build.php file.when you urlencode you will add the %2f and stuff. take it out of urlencode and it will work. that is what urlencode is for is to change the slashes and stuff to ascii value.
$rss_str = "$my_dir/feed2js.php?src=http://www.htmlforums.com/archive/index.php/" . urlencode($src) . "&chan=$chan&num=$num&desc=$desc&date=$date&targ=$targ";
and the documentation states that changing it to the following should fix it but it didn't
$rss_str = "$my_dir/feed2js.php?src=http://www.htmlforums.com/archive/index.php/" .htmlspecialchars(urlencode($src)) .
htmlspecialchars("&chan=$chan&num=$num&desc=$desc&date=$date&targ=$targ");
I hope some one can help!I forgot to attach the build.php file.when you urlencode you will add the %2f and stuff. take it out of urlencode and it will work. that is what urlencode is for is to change the slashes and stuff to ascii value.