u can also try fsockopen cause curl is required to be compiled with php
http://in.php.net/manual/e
Main Topics
Browse All TopicsHi,
I am trying to connect to a url requesting post variables which produces xml string based on the post variables. I would like to get the xml result and store it into a php variable. I tried CURL but nothing would load. Can somebody put a sample code showing how to connect to a page requesting post variables and store the page content into a php variable ? the following are the post variables the page requires:
LoginID=string&Password=st
Thank you,
Ross
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
u can also try fsockopen cause curl is required to be compiled with php
http://in.php.net/manual/e
Hi all,
Thanks for all your helps so far. I keep on getting the following error no matter which method I try:
//begin error
Warning: fsockopen() [
function.fsockopen
]: php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /home/u6/mkweb/html/file.p
Warning: fsockopen() [
function.fsockopen
]: unable to connect to sub.domain.com/Service/Dat
Fatal error: Call to undefined function: warning_ray() in /home/u6/mkweb/html/file.p
//end error
Even when I add "https" to fsockopen domain, I still get the same error. I have a form on the same page with the following parameters that connects successfully and displays the XML data. The following are the form parameters and the StrRequest parameter of the form is a XML string:
LoginID: ****Test
Password: ~****+
StrRequest: <Data><Request><Function>1
Any help would be greatly appreciated. I have a deadline and need to get this done.
Thanks.
Hi, ucsdmbdm. Show us the script you used that gave the error messages in the post above. Also, do you know how to do CURL? We might have an example there if we can't get fsockopen to work -- but if you can post to a URL, we should be able to go there with fsockopen.
Also, please use the real code, not things with replacements like "my.domain.com - if we can see what is really happening, we can have a better chance at helping out.
Best, ~Ray
Hi,,
Thanks for the help guys,
I really can't put the actual URL because of the confidentiality issues. One thing I tried was using port 443 instead of 80 since it's https. Can anyone submit the complete code working with a known HTTPS website which I can try just by changing the inputs.
Thanks and sorry for not putting the actual address,
Ross
Business Accounts
Answer for Membership
by: kirkheaton25Posted on 2008-07-19 at 15:44:14ID: 22043851
Try the attached code.
Have you tried testing the url by posting from a form, and does the url require a login?
Select allOpen in new window