如何在PHP中发送jQuery Ajax Post参数

编程入门 行业动态 更新时间:2024-10-09 19:13:50
本文介绍了如何在PHP中发送jQuery Ajax Post参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个场景: 1.必须在新标签中显示数据。 2.必须传递Post参数。 我可以使用超链接完成此操作并使用_blank设置目标。 问题是当我发送参数时,它采用GET格式,参数可在浏览器中看到。 任何以Post格式发送数据和返回数据的解决方案都显示在新标签中。 我使用过的片段,我在POST参数中需要相同的内容。我已经取代了< with(以便显示标签。 (a)href =mmtasks_update_task.php?type = view_hdr_rep&task =(?php echo $ tid;?) target =_ blank>查看HDR(a)

I have a scenario: 1. Have to show the data in the new tab. 2. Have to pass a Post parameter. I can do this with hyperlink and also setting the target with _blank. The problem is when i send the parameter, it is in GET format and the parameters are seen in the browser. Any solution for sending the data in the Post format and the returning data to show in new tab. Snippet I used, I need the same in the POST parameters. I have replaced < with ( so that tags gets displayed. (a) href="mmtasks_update_task.php?type=view_hdr_rep&task="(?php echo $tid;?)" target="_blank">View HDR (a)

推荐答案

tid;?) target =_ blank>查看HDR (a) tid;?)" target="_blank">View HDR (a)

我想你想要的是表格。只需一个链接就无法发送POST数据。 创建一个包含(或多个)隐藏字段的表单,并且 target =_ blank,应该完成这项工作。 I guess what you want would be a form. Just with a link you can't send POST data. Create a form with a (or multiple) hidden field(s), and a target="_blank", that should do the job.

更多推荐

如何在PHP中发送jQuery Ajax Post参数

本文发布于:2023-10-10 22:03:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1479883.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:参数   如何在   PHP   jQuery   Ajax

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!