Hey there,
I am trying to write a code that accepts user input on one page through a POST method form, then concatenates that data into a url as get variables. I then need to open the page using fopen with the get variables in tact.
Here is what I have, abridged and edited for simplicity. The input form, in a separate file, is functional and has been omitted:
1. $what = $_POST['what'];
2. $where = $_POST['where'];
3. $url = "http://www.example.com/search/listings?what=" . $what . "&where=" . 4. $where;
5.
6. $openedURL = fopen($url, "r");
7. while(!feof($url))
8. {
9. //do something
10. }
When I try to run this script, I get an infinitely looping error message:
Warning: feof() expects parameter 1 to be resource, string given in script.php on line 7
I suppose what I really need to know is: How do I pass get variables into an fopen? Is that even the problem we're dealing with here?