如何yii getPost和分析post参数?

如何yii getPost和分析post参数?,yii,Yii,我有许多客户机向服务器发送post。 这是post-url: localhost/checkpost.php parms: id = "xxxx-xxxx-xxxx-xxxx" <contents><name>user</name><detail>test<detail></contents> localhost/checkpost.php 帕尔姆斯: id=“xxxx xxxx xxxx xxxx” 用户测试 我想检查

我有许多客户机向服务器发送post。 这是post-url:

localhost/checkpost.php
parms:
id = "xxxx-xxxx-xxxx-xxxx"
<contents><name>user</name><detail>test<detail></contents>
localhost/checkpost.php
帕尔姆斯:
id=“xxxx xxxx xxxx xxxx”
用户测试
我想检查我的数据库中的id和名称,并将详细信息保存到我的数据库中。我该怎么做?
帮助我我是Yii的新手?

您可以使用访问获取/发布数据。这可以通过以下方式访问:

$id = Yii::app()->request->getParam('id');    // Either GET or POST
$id = Yii::app()->request->getPost('id');     // POST only
$id = Yii::app()->request->getQuery('id');    // GET only

如果您想使用数据库,最简单的方法是实现一个派生类,并将其用于与数据库的接口。

您可以使用访问get/post数据。这可以通过以下方式访问:

$id = Yii::app()->request->getParam('id');    // Either GET or POST
$id = Yii::app()->request->getPost('id');     // POST only
$id = Yii::app()->request->getQuery('id');    // GET only

如果您想使用数据库,最简单的方法是实现一个派生类,并将其用于与数据库的接口。

我认为我的问题是错误的。我会编辑它。不是一个客户端、多个客户端和每个客户端1个id。我想我必须有一个getpost的协议。我的答案在编辑后保持不变,getParam/Post返回的是已经发布到checkpost.php的内容。我将添加更多关于数据库部分的信息。我认为我的问题是错误的。我会编辑它。不是一个客户端、多个客户端和每个客户端1个id。我想我必须有一个getpost的协议。我的答案在编辑后保持不变,getParam/Post返回的是已经发布到checkpost.php的内容。我将添加有关数据库部分的更多信息。