用户名urls如twitter和facebook [英] username urls like twitter and facebook

查看:129
本文介绍了用户名urls如twitter和facebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

twitter和facebook如何做独特的url例如。 twitter.com/billgates



如果我想这样做(给我的用户唯一的URL用户名),是一个应用程序,或者你为每个



感谢

$

b $ b

解决方案

更广泛地说,这些在线服务(Facebook,Twitter,任何存储用户名的网站)都使用数据库并测试用户名是否唯一在创作的时候。通常通过在允许创建新帐户之前查询名称(许多在用户以注册表单输入名称时使用ajax请求)。



一旦帐户,那么服务器可以设置为在接收到URL请求时处理路径名(使用类似mod_rewrite的东西),并将信息传递到脚本,然后脚本访问数据库中的该用户的信息并呈现页面。 / p>

blogpost&视频似乎很有帮助,但由于我不知道你的设置是什么,至少应该指向正确的方向...也Coldfusion害怕我。


how does twitter and facebook etc. make unique url eg. twitter.com/billgates

if i would like to do the same (give my users unique urls with username), is it a application or do you crate a directory for each user with a index page??

by the way im using coldfusion.

thanks

解决方案

More generally these online services (Facebook, Twitter, any site that stores a username) use a database and tests for so see if the username is unique at the time of creation. Usually by querying the name before allowing the new account to be created (many do this with ajax requests as the user enters the name in the signup form).

Once the account is created then the server can be set up to handle the path name (using something like mod_rewrite) when a URL request is received, and pass along the information to a script that then accesses that user's information in the database and renders the page.

This blogpost & video seem to be pretty helpful but since I'm not sure what your setup is it should at least point you in the right direction... Also Coldfusion scares me.

这篇关于用户名urls如twitter和facebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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