日期:2014-05-16  浏览次数:20696 次

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