I need to query a page on another domain and display the results returned by it. But the php
file reports an error.
The url is: http://otherdomain/abc.jsp?p=q&x=y
EDIT: I use file_get_contents…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There can be several reasons:
1) If you’re opening a URI with special characters, such as spaces, you need to encode the URI with urlencode().
2) In your php.ini *allow_url_fopen* is false. Set it true to allow opening urls.
I could help if you provide the error generated by php.
If you are trying to make two or more start points access the same one point, you might consider using .htaccess files with RewriteEngine as it will rewrite the url.
If you want to:
both index.jsp, index.php, index.aspx…. to show the same output that index.jsp shows.
You can use:
.htaccess File with RewriteEngine Support.
Here is the link with some .htaccess tricks
Notice
You must have Apache as the HTTP Server and have mod_rewrite module enabled.