PHP website When writing an article, how to link the article ID with the article content
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-16 13:16:01
0
3
586

As shown in the picture, I am making a website where I can write articles. On the left, I can create a new article, and on the right is the content of the article. How can I click on the title on the left to link to the content on the right, that is, click on different topics on the left to correspond to different topics on the right? Title, tag, content, and want to send it to the background through ajax. Different IDs are obtained through auto-increment on the left. How can I click the button on the right to send the ID at the same time. Thanks.

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(3)
習慣沉默

描述得不太清楚。右边按钮应该是生成文章或编辑文章,如果是生成,那么数据插入数据库时会自增一个id,如果是编辑,那么就是通过id获取不同的文章内容,此时你已经知道id了,只需要拼接在链接后面,用ajax就把id存在一个自定义变量中。

阿神

文章ID,哪些数据不是存到数据库的吗,点击每一条连接肯定有个参数做区分啊,直接从数据库里查,然后模版引擎赋值就可以了、

Ty80

id可以在标签里自定义一个属性来存储

发送时通过js获取到对应属性一起传递过去

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!