如何在PHP中发送jQuery Ajax Post参数 [英] How to Send jQuery Ajax Post Parameter in PHP

查看:105
本文介绍了如何在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参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆