dpxyfa4718 2017-03-14 21:33
浏览 47

通过传递sql密钥创建网站的唯一页面

The title may be a bit awful as I'm really not sure how to describe what I'm trying to achieve without using lots of words.

I'm currently building an events website. This website has the option for users to create their own events which can be added to a big list of upcoming events that other users have submitted.

What I want to do is be able to have a user create an event and have the details of the event stored in an SQL database (which I've successfully done), I want to be able to then have a large list of events on a separate page the details of which are pulled from the server dynamically using PHP and SQL (I've also successfully done this). The part I am struggling with however is being able to create unique pages (or a single dynamic page) that displays a more detailed look at the event, such as age restrictions etc etc, which cannot be displayed on the big list which displays all the available events.

I figured that this could be done using a unique eventID, which is something the SQL database already includes and autoincrements with each new event entry. What I'm really not sure about is how I'd be able to pass that eventID through the link to the more detailed page so that the detailed page can be created displaying all of the details of the event.

I'm not even sure if this idea will work at all. Would having a page with a unique URL that is created on event submission that has a more in-depth look at the details of the event be a better idea? How would I go about creating unique URL webpages that correspond to each event on event submission?

I'm really not sure how I need to go about this at all, so I need some help and pointing in the right direction.

Here's a kind of TLDR:

1) Events website

2) All events on the website are displayed on a single page that has minimal detail about each event (title, date, location) BUT has a link to a page that displays the event in more detail.

3) User can select an event from the list and click on that event's unique HTML link to more detailed page

4) More detailed page displays event in more detail by pulling event's unique information from the database

Feel free to ask any questions at all as I know this probably isn't the easiest idea to get across

  • 写回答

1条回答 默认 最新

  • duanmiaosi0150 2017-03-14 21:44
    关注

    When creating the links from the general listing page to the detail page, simply include the id in the link. For example:

    <A HREF="mysite.com/detail.php?id=3>Big Event</A>
    

    In detail.php then, you'll find the id in $_GET['id'].

    评论

报告相同问题?

悬赏问题

  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?