fopen on a file/url with blanks/whitespaces
Posted: Fri Jul 18, 2008 5:42 am
Hi 
I just stumbled upon this:
search.php:
test.php:
test.php outputs:
I can live with the fact that _this_is_how_it_is_ and do some query replace on whitespaces, but before I implement that scheme I just wanted to check if anyone know if there is a way to make this work directly? (I have seen %20 used alot for whitespaces, without really understanding why, is this why?)
I just stumbled upon this:
search.php:
Code: Select all
<?php
print $_GET['arg'];
?>Code: Select all
<?php
print "a) " . file_get_contents("http://server/search.php?arg=oneword", "r");
print "b) " . file_get_contents("http://server/search.php?arg=two words", "r");
?>Code: Select all
a) oneword
b) Warning: file_get_contents(http://server/search.php?arg=two words) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in ...