Cross-Origin value transfer problems

Source: Internet
Author: User
For cross-origin value transfer problems, there are now A page and B page (on different servers), and the & nbsp; A page needs to get the value passed through B page and insert it to the database on page: file_get_contents( B .html) this is a one-dimensional array returned by page B. However, according to the features of file_get_contents, it is still possible to read the string and return the cross-origin value.
There are now Page A and page B (on different servers ),
On page A, you need to obtain the value passed through on page B and insert it to the database on page A: file_get_contents (B .html)
This is A one-dimensional array returned by page B, but according to the features of file_get_contents, it is still read as A string and returned to page,
So now the question is how to convert the seemingly array string obtained on page B to a real array?


------ Solution --------------------
What is the format of B .html arrays?
If you can set it, serialize the B .html array as a string. Refer to the serialize () function
------ Solution --------------------
PHP code
$ S = <TXTArray ([1] => first [2] => second [3] => third) TXT; preg_match_all ('/\ [(\ w +) \] => (. +) $/M', $ s, $ r); $ ar = array_combine ($ r [1], $ r [2]);

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.