简体   繁体   English

如何在HTML Div中将值传递给PHP

[英]How to Pass Values within HTML Div To PHP

I am developing a forum in php. 我正在用php开发一个论坛。 I have made a " Reply With Quote " button under each post and When User Clicks this button, It runs a JQuery Function that gets the text of that post and Put It into the CKEditor and Wrap the Text with a Div having an id="quote" . 我在每个帖子下都做了一个“ 带引号的回复 ”按钮,当用户单击该按钮时,它运行一个JQuery函数,该函数获取该帖子的文本并将其放入CKEditor中,并用id="quote"id="quote"的Div包裹文本id="quote" The Text Looks like this after inserting to CKEditor 插入CKEditor后,文本看起来像这样

<div id="quote">This is the quoted Text"</div>  

Normally In Forums the Values are passed in quotes like this 通常,在论坛中,值用这样的引号传递

[QUOTE=user_name;post_id]This is Quoted Text[/QUOTE]

But I am not using BBCode in my forum. 但是我没有在论坛中使用BBCode。 So, How can I Pass user_name and post_id values within my <div id="quote"> to PHP?? 因此,如何将<div id="quote"> user_namepost_id值传递给PHP?

在将该引号div插入页面之前,该按钮应运行ajax查询以将表单值传递给服务器。

在将div插入到页面中之前,使用Ajax添加一个隐藏字段,然后使用会话或cookie生成用户凭证

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM