我知道标题听起来很简单,我希望答案是,但我是ASP的新手,无法想出这个。我正在制作一个表单,用于将用户名提交给access.asp
<form name="input" action="access.asp" user="" method="get">
Username: <input name="user" type="text" />
<input value="Submit" type="submit" /></form>
我想要实际实现的是当有人在表单中键入用户名并单击提交时,我希望表单将它们移动到具有该用户名的下一个子目录。
ie. username=thomas then they are redirected to a folder http://www.whatever.com/thomas/
ie. username=samantha then they are redirected to a folder http://www.whatever.com/samantha/
等等。如果输入的用户名目录不存在,则该文件夹将默认为index.html文件或404文件。我试图不创建数据库文件,除非这是必需的。我完成后,我将只有5-10个用户名目录。
任何帮助将不胜感激。
谢谢, 埃里克
答案 0 :(得分:0)
虽然这可以在JavaScript中完成。我会继续在ASP中做到这一点。在服务器上执行此操作将允许您检查以确保用户名有效,如果没有,则执行其他操作。
使用ASP.Net,您需要使用Response.Redirect
Microsoft的MSDN http://msdn.microsoft.com/en-us/library/ms524309%28v=VS.90%29.aspx
上有几个不同语言的示例基本上你只需要
<% Response.Redirect "/" + Request.QueryString("username") %>