用PHP做了一个POST方式提交数据的表单,从一个API网址中获取数据,返回总提示“please set Content-Type to application/x-www-form-urlencoded”,我该在网页中如何设置,谢谢!代码如下:<?php此处省去部代代码 if ($_POST['rate']!="")
{
var_dump(buy('pay_cny', '10', '10'));
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body><form action="" method="post" id="Form10" name="Form10" enctype="application/x-www-form-urlencoded">
<table width="1" border="1" cellspacing="1" cellpadding="1">
<tr>
<td>币种</td>
<td><input name="currencyPair" type="text" value="pay_cny" /></td>
</tr>
<tr>
<td>rate价格</td>
<td><input name="rate" type="text" value="" /></td>
</tr>
<tr>
<td>amount数量</td>
<td><input name="amount" type="text" value="" /></td>
</tr>
</table>
<input type="submit" name="Submit" value="提交"></form>
</body>
</html>
{
var_dump(buy('pay_cny', '10', '10'));
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body><form action="" method="post" id="Form10" name="Form10" enctype="application/x-www-form-urlencoded">
<table width="1" border="1" cellspacing="1" cellpadding="1">
<tr>
<td>币种</td>
<td><input name="currencyPair" type="text" value="pay_cny" /></td>
</tr>
<tr>
<td>rate价格</td>
<td><input name="rate" type="text" value="" /></td>
</tr>
<tr>
<td>amount数量</td>
<td><input name="amount" type="text" value="" /></td>
</tr>
</table>
<input type="submit" name="Submit" value="提交"></form>
</body>
</html>
解决方案 »
- php实现在线编辑xml,获得节点索引的问题
- php邮件发送,服务器拒接连接
- 谁用php+mysql做过工作流啊?请留下联系方式,最好在北京
- 新手,制作留言版,但是提交之后数据库没有新增数据。帮忙看看什么原因,谢谢。
- PHP问题(7.17)在线给分!
- 关于pear中的问题: DB_AUTOQUERY_UPDATE 怎么执行不成功,页面一片空白,什么消息也没有?
- 怎么字符串怎么截取"<内容>"里面的字符串
- php 在web中主要用于那些方面?掌握到什么程度可以找一个普通php程序员的工作?
- 如何在LINUX安装GD库?
- 为什么显示传回的信息是:underfined
- 关于数据库连接出错的问题~~~万分感谢
- 从数据库拿出多条数据,但是在不同的位置输出不同的数据怎么查?
也就是说你的提交数据以这样的形式发送给服务器 urlencode(currencyPair=pay_cny&rate=0.8&amount=100)看看你的后端是否接收到数据
{
var_dump($_POST);
}