For frontend users, could you tell me a simple php question?
Source: Internet
Author: User
For more information about the frontend, see $ MySQLConnection = mysql_connect (& quot; 192.168.22.1 & quot;, & quot; root & quot;, & quot; 123456 & quot ;); @ mysql_select_db (& q for frontend users, ask a simple php question
$ MySQLConnection = mysql_connect ("192.168.22.1", "root", "123456 ");
@ Mysql_select_db ("first ");
$ Result = mysql_query ("insert into 'first '. 'biao' ('hao') VALUES (' $ xingming ');");
Can I write this on my own page to control writing to the first database of 192.168.22.1? is it called cross-origin in php? How does 192.168.22.1 prevent such operations?
------ Solution --------------------
Php does not have cross-origin problems
By default, mysql only supports local access (127.0.0.1)
Even if 192.168.22.1 is a local IP address, it cannot be accessed without authorization.
------ Solution --------------------
Cross-origin refers to AJAX cross-origin. there is no cross-origin problem here.
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.