"bob","key" => "12345");$ch = "/>  "bob","key" => "12345");$ch = ">

jsp如何接受php传来的参数

WBOY
Release: 2016-06-13 11:48:47
Original
1037 people have browsed it

jsp怎么接受php传来的参数
这是php里
$url = "http://localhost:8089/jsp.jsp";
$post_data = array("username" => "bob","key" => "12345");
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);

$output=curl_exec($ch);

curl_close($ch);

print_r($output);
然后jsp中应该怎么去接受php中$post_data
再然后怎么去显示出来?
跪求。。。。。。
------解决方案--------------------
表单提交,该怎么做就怎么做
------解决方案--------------------
这个和php无关啊,你可以用get http://xxxx/xx?a=1&b=2 或者post (你的例子),jsp该怎么拿怎么拿
------解决方案--------------------
你如果不在页面用php代码的话,直接用$_POST或$_GET接受echo就出来了,如果代码和页面分离就得用smarty,后台分配给页面。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
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!