tinker Posted December 22, 2007 Share Posted December 22, 2007 i got a string, 'C++.html', on the first usage when it comes out of database it ok, but then it not, i try lots of things such as, echo htmlspecialchars('C++.html')."<br>"; echo htmlentities("C++.html")."<br>"; $sret .= "<br>:".bin2hex("+").":".urlencode("+").":".rawurlencode("+").":".utf8_encode("+").":<br>"; also i try decode counterparts for each case... when it appear in page or url it comes out as two spaces, when i run one through 'ord' it say 32, but + is 43 ascii anybody know why or how to fix please? Quote Link to comment https://forums.phpfreaks.com/topic/82820-probs/ Share on other sites More sharing options...
papaface Posted December 22, 2007 Share Posted December 22, 2007 So whats the problem? Quote Link to comment https://forums.phpfreaks.com/topic/82820-probs/#findComment-421201 Share on other sites More sharing options...
tinker Posted December 22, 2007 Author Share Posted December 22, 2007 the +'s are replaced by space's, which when checked with ord are 32 not 43, therefore how to encode to stay as +'s Quote Link to comment https://forums.phpfreaks.com/topic/82820-probs/#findComment-421234 Share on other sites More sharing options...
papaface Posted December 22, 2007 Share Posted December 22, 2007 You're not supposed to have special characters in your file names thats why. Remove the '+''s or chose something other than +'s Quote Link to comment https://forums.phpfreaks.com/topic/82820-probs/#findComment-421235 Share on other sites More sharing options...
tinker Posted December 22, 2007 Author Share Posted December 22, 2007 it works without complaint elsewhere and it's a client input thing. Also i have no probs from bash and it something id like to continue using, so im still looking for solution, cheers Quote Link to comment https://forums.phpfreaks.com/topic/82820-probs/#findComment-421237 Share on other sites More sharing options...
Barand Posted December 22, 2007 Share Posted December 22, 2007 try <?php if (isset($_GET['title'])) { echo 'Title is : ' . $_GET['title'] . '<br>'; } $str = 'C++.html'; $str = urlencode($str); echo "<a href='?title=$str'>Click here</a>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/82820-probs/#findComment-421240 Share on other sites More sharing options...
tinker Posted December 22, 2007 Author Share Posted December 22, 2007 it's probably already doing that because it runs through mod_rewrite Quote Link to comment https://forums.phpfreaks.com/topic/82820-probs/#findComment-421242 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.