douya2982 2011-09-27 23:23
浏览 7
已采纳

如何生成在PHP中获得3次权限的自动URL?

I would like to generate a URL which will have a unique code tail at the and only will be used 3 times. After accessing 3 times from the link. the url will expire. How can I do this? Basically I think I need to create a database and map the permission for the url and have acountdown number? is there any better way of doing this? An example of this is in facebook you can just copy and send a link to the people to see your pictures without going online or being your friends. ?

  • 写回答

1条回答 默认 最新

  • dongleman4760 2011-09-27 23:33
    关注

    You've already thought of your own solution! There is no easier way.

    Lets have a look at what you need:

    1. An url referring to a specific page (or an image in your case)
    2. A limit of times your url can be visited
    3. A count of the amount of visits

    All 3 requirements seem to need a database. You can use an alternative database, such as local xml files but that would be way more work than using a mysql database for instance.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部