要防止受到XSS攻击,只要变量的值将被打印到输出中,就需要通过htmlentities()函数过滤输入。
To guard yourself against XSS attacks, filter your input through the htmlentities() function whenever the value of a variable is printed to the output.
如果变量是在初始化之前使用的,那就会产生语义错误,使用值为0来创建这个变量,并打印一条消息。
If a variable is used before it is initialized, a semantic error is generated, the variable is created with a value of zero, and a message is printed.
显然,由于它们是变量中的值,您可以轻松地将result对象的内容记录入日志,或者在GUI中显示,不管怎么样,不是仅仅打印到STDOUT。
Obviously, since they are values in variables, you could easily log the contents of the result object, send them as e-mail, display them in a GUI, or whatever, rather than simply print to STDOUT.
我们还设置变量以记住与该选项相关联的所有数据的值,例如,有“-l”选项时记下页长,有“-f”时则记下打印目的地。
We also set variables to remember the values of any data associated with the option, such as the page length in the case of the "-l" option and the print destination in the case of "-f".
现在,目录中将有一个可执行程序,它在运行时将打印EDITOR环境变量的值(如果有值的话)。
Now, there will be an executable program in your directory that, when run, will print the value of the EDITOR environment variable, if any. This is what happens when I run it on my machine.
一旦代码已经迭代了tuple中的所有元素,它将进入for循环的else子句,打印count变量的值。
Once the code has iterated over all the elements in the tuple, it enters the else clause of the for loop, which prints out the value of the count variable.
一旦代码已经迭代了tuple中的所有元素,它将进入for循环的else子句,打印count变量的值。
Once the code has iterated over all the elements in the tuple, it enters the else clause of the for loop, which prints out the value of the count variable.
应用推荐