每日一题(18)

上一篇 / 下一篇  2007-10-29 22:50:03 / 个人分类:每日一题

13. When you write a cookie with an expiration date in the future to a particular machine, the cookie never seem to be set. The technique usually works with other computers, and you have checked that the time on the machine corresponds to the time on the server within a reasonable margin by verifying the date reported by the operating system on the client computers desktop. The browser on the client machine seems to otherwise work fine on most other websites. What could be likely causes of this problem? (Choose 2)

A. The browsers binaries are corrupt

B. The client machines time zone is not set properly

C. The user has a virus-scanning program that is blocking all secure cookies

D. The browser is set to refuse all cookies

E. The cookie uses characters that are discarded all data from your server

Answer:

Answers A and D both describe likely causes of this type of problem and warrant further investigation on your part. Since the browser seems to work fine, its unlikely that its binaries have suffered corruption such that only your site has stopped working, and virusscanning programs do not normally stop secure cookies selectively (although some block all cookies). On the other hand, the browser might have been explicitly set to refuse all cookies, which is probably the first source of trouble you should check for. By the same token, the computers time zone might have been set incorrectly and, since cookie expiration dates are coordinated through GMT, cause the cookie to expire as soon as it was set and never be returned to your scrīpts.

 

14. Assuming that the client browser is never restarted, how long after the last access will a sessionexpireand be subject to garbage collection?

A. After exactly 1,440 seconds

B. After the number of seconds specified in the session.gc_maxlifetime INI setting

C. It will never expire unless it is manually deleted

D. It will only expire when the browser is restarted

E. None of the above

Answer:

The session.gc_maxlifetime INI setting regulates the amount of time since the last access after which the session handler considers a session data filegarbageand marks it for deletion by the garbage handler. Once this has happened, any subsequent access to the session will be considered invalid, even if the data file still exists. Coincidentally, the session.gc_maxlifetime is set to 1,440 seconds, but you canturely on that number as it might have been changed without your knowledge by the system administrator. Answer B is, therefore, correct.

 

 

15. The ___________ function automatically transforms newline characters into HTML <br /> tags

Your Answer: ____________________________

Answer:

This identifies the nl2br function, which can be used precisely for this purpose.

note:

We have completed work on this section and will begin next section 'Working with Arrays' next time. Enjoy it! Enjoy PHP!

TAG: 每日一题

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

数据统计

  • 访问量: 16944
  • 日志数: 87
  • 建立时间: 2007-09-29
  • 更新时间: 2008-04-15

RSS订阅

Open Toolbar