doutou6803 2011-07-19 21:21
浏览 77

你能用php更改文件名吗?

So here's the idea. Can you change/rename the name of the file using php.I was thinkig like this

you have couple of pages all same "template" just different content and name for example you have some file named "portfolio-item-1.php" and if someone click "next" link it goes to "portfolio-item-2.php" so the same file just renamed and different content using ID's ?

It's maybe confusing but .. .

I know you can do this Database but, is there a way without database?

  • 写回答

2条回答 默认 最新

  • douyan6871 2011-07-19 21:26
    关注

    You really don't want to do that! From what you say you're trying to do, a GET / POST would be far better.

    E.g. link to portfolio-item.php?page=2 You can get the page number by:

    $page = isset($_GET['page']) ? $_GET['page'] : 1;
    

    This will set page to the ID in the URL if it's there, otherwise it'll use 1 as the page number.

    评论

报告相同问题?

悬赏问题

  • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题