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

Heim  >  Artikel  >  Backend-Entwicklung  >  jsp如何接受php传来的参数

jsp如何接受php传来的参数

WBOY
WBOYOriginal
2016-06-13 11:48:471026Durchsuche

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,后台分配给页面。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn