Computing.Net > Forums > Web Development > PHP: HTML reponse to variable

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

PHP: HTML reponse to variable

Reply to Message Icon

Name: fem
Date: October 8, 2004 at 02:17:36 Pacific
OS: W2k
CPU/Ram: 400/256
Comment:

I have a PHP application that submits a string of data to a partner's server via GET mechanism. As a reponse, partner's server generates an integer (submission ID) and sends it back to me. I can see this integer if I put my outbound string into the browser and execute it, but I do not know how to make my PHP application to capture this value and insert it into my MySQL database automatically. What function should I use?
As you can see I'm a newbi to PHP.
Oleg



Sponsored Link
Ads by Google

Response Number 1
Name: SN
Date: October 8, 2004 at 06:50:34 Pacific
Reply:

I assume by "sends it back to me", you mean you can see it in the browser window when you do it manually.

To do this in PHP, use file_get_contents(). Assuming the partner's server returns only the integer (ie not any HTML), it could work something like:
$submissionID=file_get_contents("http://www.server.com/order.aspx?ordernum=12&items=3&total=22");

Note that you don't have to pass this string to your partner's server anywhere else...Just the line above will do it.

Good luck,
-SN


0

Response Number 2
Name: fem
Date: October 8, 2004 at 10:46:17 Pacific
Reply:

SN,

Thanks a lot for such a prompt reply.
I will try it over the weekend.

Thanks again,
Oleg


0

Response Number 3
Name: fem
Date: October 12, 2004 at 03:34:14 Pacific
Reply:

Interestingly enough I was able to use the same function for passing data to a server using GET method. All I had to do was to concatenate url of the server with my variables, urlencode() the lot and then insert result into file_get_contents() and I had my GET data submission and server response in one go ... thanks a lot for your advise.
Oleg


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Apache2 .htaccess/.htpass... dreamweaver login creatin...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: PHP: HTML reponse to variable

PHP Form saving to mySQL www.computing.net/answers/webdevel/php-form-saving-to-mysql/615.html

HTML code to save document on disk www.computing.net/answers/webdevel/html-code-to-save-document-on-disk/2491.html

PHP and how to call it? www.computing.net/answers/webdevel/php-and-how-to-call-it/3627.html