dua6992 2013-09-24 16:52
浏览 48
已采纳

在PHP中创建公共配置文件和自定义URL

I'm looking to create a user admin area and public profile page with custom URL in PHP. I have found a great tutorial on users creating their own private admin area. However, I'm struggling to find further guidance on the following:

  1. Creating a public custom URL (such as as website.com/username) based on what the user requested on signup.

  2. Using that custom URL to display public profile page with selected information the user entered into their private admin area.

I know this is bread and butter stuff but I'm leaning PHP so any guidance and best practices at this stage are very welcome.

Thanks, Jack.

  • 写回答

1条回答 默认 最新

  • dongpan1365 2013-09-24 17:15
    关注

    You could try the following:

    1. Use mod_rewrite (assuming you have an Apache server) to forward all domain.com/abcde requests that don't match an existing file or directory (see -f condition) to domain.com/user.php?name=abcde
    2. In user.php, get all the data based on the user-chosen name from the database and display it, display an error message if no user is found.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于单片机的靶位控制系统
  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错