Question about passing values between php and html

Source: Internet
Author: User
ViewCode1 $ srv_ip192.168.0.118; your target service address or channel (must not have http :). 2 $ srv_port80; 3 $ errno0; 4 $ errstr; 5 $ timeout10; 67 $ urlPhpAndServicesocketServerSend. aspx; receives your post URL

View Code 1 $ srv_ip = '192.168.0.118 '; // your target service address or channel (you must not have http ://). 2 $ srv_port = 80; 3 $ errno = 0; 4 $ errstr = ''; 5 $ timeout = 10; 6 7 $ url = '/PhpAndService/socketServerSend. aspx '; // receives the URL of your post.

View Code

1 $ srv_ip = '192. 168.0.118 '; // your target service address or channel (you must not have http ://).
2 $ srv_port = 80;
3 $ errno = 0;
4 $ errstr = '';
5 $ timeout = 10;
6
7 $ url = '/PhpAndService/socketServerSend. aspx'; // The specific address for receiving your post URL
8 $ fp = '';
9 $ resp_str = '';
10 $ post_str = $ _ POST ["content"]; // content to be submitted.
11
12 if ($ srv_ip = ''){
13 echo ('IP or dest url empty
');
14}
15
16 $ fp = fsockopen ($ srv_ip, $ srv_port, $ errno, $ errstr, $ timeout );
17 if (! $ Fp ){
18 echo ('fp fail ');
19}
20
21 $ content_length = strlen ($ post_str );
22 $ post_header = "POST $ url HTTP/1.1 \ r \ n ";
23 $ post_header. = "Content-Type: application/x-www-form-urlencoded \ r \ n ";
24 $ post_header. = "User-Agent: MSIE \ r \ n ";
25 $ post_header. = "Host:". $ srv_ip. "\ r \ n ";
26 $ post_header. = "Content-Length:". $ content_length. "\ r \ n ";
27 $ post_header. = "Connection: close \ r \ n ";
28 $ post_header. = $ post_str. "\ r \ n ";
29 fwrite ($ fp, $ post_header );
30
31 while (! Feof ($ fp )){
32 $ resp_str. = fgets ($ fp, 512); // put the returned value into $ resp_str
33}
34 fclose ($ fp );
35 echo ($ resp_str); // process the returned value.


Conditional restrictions: ipad calls PHP (website), PHP calls Aspx (website), and Aspx calls WebSErvice (website)

Php has implemented the call to aspx (post transfer), but how does aspx return data to tell php whether the execution is successful or not?

Php with online copy calls aspx implementation, but I don't know how to write the aspx page to return a data to php. Please advise

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.