会议... [英] Sessions...

查看:75
本文介绍了会议...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然我在这...我应该使用PHP的内置会话,或者使用我自己的功能我已经从各种来源和

利用也验证IP地址???


我不喜欢只是因为他们在那里使用东西。我目前

将网络前端重写为服务台。旧的用ASP

编写,非常糟糕的结构和编程。我非常擅长使用PHP

,不幸的是SQL Server和我已经完成了大约50%的工作,大概是

2天......


当然,他们不会让我构建任何额外的位,而且他们不会

愿意让我把它扩展成所有人都在跳舞,尽管我是/>
自愿参加我自己的时间...... grrr grrr grr ...


仍然存在着令人怀疑的问题,即我可能做得不对,
会话就是其中之一......如何正确地拆分模板和

给予足够的灵活性以便返回错误消息......等等......


Cya

Simon

And while Im at it... should I be using PHP''s built in sessions, or use
my own functions that I''ve chobbled together from various sources and
takes advantage of also validating IP Addresses???

I don''t like to use things just because they''re there. Im currently
rewriting a web front end to a helpdesk. The old one was written in ASP
and very very poorly structured and programmed. Im blazing in with PHP
and unfortunately SQL Server and I''ve got about 50% of it done in about
2 days...

Of course, they won''t let me build any extra bits in, and they''re not
willing let me expand it into all singing all dancing despite me
volunteering my own time... grrr grrr grr...

Still there''s the nagging doubt that Im probably not doing things right,
Sessions being one of them.... how to split templates out properly and
giving enough flexibility to enable Error Messages to be returned... etc...

Cya
Simon

推荐答案

PHP会话处理非常出色IMOP但这只是我的看法:-)

PHP session handling is excellent IMOP but thats just my take :-)


>而我正在使用它...我应该使用PHP的内置会话,还是使用
>And while Im at it... should I be using PHP''s built in sessions, or use
我自己的功能,我已经从va好消息来源和
利用也验证IP地址???


使用会话并不禁止您也验证IP

地址。在会话中记录IP地址并将其与稍后的
进行比较。您应该知道,验证IP地址可能会使您的网站无法使用循环代理,因为这可能会导致对同一页面的部分内容的请求从

几个不同的IP地址。也许你不关心这个

(如果它是一个私人网站,可以在办公室局域网中使用,你很可能不会这么好)。 />
我不喜欢因为他们在那里而使用东西。我目前是


但是如果你把所有的时间花在发明

ASCII字符集或HTML的替代品上,那么你将永远无法完成任何有用的工作。 />
将Web前端重写为帮助台。旧版本是用ASP编写的,结构非常差,编程也很差。我非常喜欢PHP
而且不幸的是SQL Server和我已经完成了大约50%的工作...
2天...
当然,他们不会让我建立任何额外的位,并且他们不愿意让我把它扩展到所有的歌唱所有的舞蹈尽管我
志愿我自己的时间... grrr grrr grr ...
仍然有一种令人唠叨的疑问,我可能做得不对,
会话就是其中之一......如何正确地拆分模板,并提供足够的灵活性来启用错误消息。 ......等......
my own functions that I''ve chobbled together from various sources and
takes advantage of also validating IP Addresses???
Using sessions does not prohibit you from also validating IP
addresses. Record the IP address in the session and compare it to
later ones. You should be aware that validating IP addresses can
make your site unusable for people using round-robin proxies, which
may make requests for parts of the same page appear to come from
several different IP addresses. Perhaps you don''t care about this
(if it''s a private web site for use from the office LAN, you very
well might not).
I don''t like to use things just because they''re there. Im currently
But if you spend all your time inventing a replacement for the
ASCII character set or HTML, you will never get much useful done.
rewriting a web front end to a helpdesk. The old one was written in ASP
and very very poorly structured and programmed. Im blazing in with PHP
and unfortunately SQL Server and I''ve got about 50% of it done in about
2 days... Of course, they won''t let me build any extra bits in, and they''re not
willing let me expand it into all singing all dancing despite me
volunteering my own time... grrr grrr grr... Still there''s the nagging doubt that Im probably not doing things right,
Sessions being one of them.... how to split templates out properly and
giving enough flexibility to enable Error Messages to be returned... etc...




Gordon L. Burditt



Gordon L. Burditt


Simon Dean写道:
Simon Dean wrote:
虽然我在这里...我应该使用PHP的内置会话,或者使用我自己的功能,我已经从各种来源混合在一起并且
利用了还验证IP地址???
我不喜欢只是因为他们在那里使用东西。
And while Im at it... should I be using PHP''s built in sessions, or use
my own functions that I''ve chobbled together from various sources and
takes advantage of also validating IP Addresses??? I don''t like to use things just because they''re there.




我知道你的意思,但如果它在那里并且它运行良好,然后使用它。


PHP会话可以很好地工作 - 除了我发现的一个问题。


MS IE为它请求的每个页面保持使用不同的会话ID!


我通过创建自己的会话ID并将其存储在cookie中来解决这个问题,

所以我可以把它拿回来并且每次强制使用相同的会话ID。


当然,现在你需要用户启用cookie。


所以我现在使用会话数据进行''这次访问''的东西,以及用于

长期''用户信息''的cookie数据。


如果您需要任何代码,请告诉我......


John。



I know what you mean, but if it''s there and it''s working well, then use it.

PHP sessions do work very well - except for one problem I found.

MS IE kept using a different session ID for every page it requested !

I solved this by creating my own session ID and storing it in a cookie,
so I could get it back and force the same session ID each time.

Of course, now you need the user to have cookies enabled.

So I now use session data for ''this visit'' stuff, and cookie data for
longer term ''user info'' stuff.

Let me know if you want any code...

John.


这篇关于会议...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆