My php does not support URL-based value transfer.

Source: Internet
Author: User
Why does my php support URL-based value transfer? Why does my php support URL-based value transfer? How to configure PHP to directly convert address bar parameters to global variables? The code is as follows: & lt ;? Php & nbsp; for ($ I = 1; $ I & lt; = $ a; $ I ++) & nbsp; & nbsp ;{& nbsp; & nbsp; & nbsp; for ($ j = 1; $ j & lt; = $ why does my php not support URL transfer?
Why does my php support URL-based value transfer? How to configure PHP to directly convert address bar parameters to global variables?

The code is as follows:
For ($ I = 1; $ I <= $ a; $ I ++)
{
For ($ j = 1; $ j <= $ a; $ j ++)
{
$ C = $ I * $ j;
Echo "$ I * $ j = $ c ";
}
Echo'

';
}
?>
In the example, enter http: // 127.0.0.1/practice/chengfabiao. php in the address bar? A = 9
We can display the multiplication table. Why does it still appear after I run it:
Notice: Undefined variable: B in d: \ APMXE5 \
Htdocs \ practice \ chengfabiao. php on line 2
It is certain that the value of a is not passed in. why is that? Is it necessary to modify the php configuration file?
Baidu gave an answer, "That's because the PHP configuration did not directly convert the address bar parameter to a global variable. you can modify the PHP configuration or the source program to solve the problem, for example, you can change $ a in the program to $ _ GET ["a"], and change B to be correct."
Now, I want to directly change the option in the configuration file, but I don't know which option to change?
Hope you can give me some advice!

--------------------------------
In the php. ini file, change register_globals = Off to register_globals = on
Remember: after modifying the php. ini file, restart the apache service. It is generally not recommended to modify php. ini to convert it directly to a global variable, which is not safe.

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.