Php 获取下拉选择以将用户引导到新页面(MySQL&&P4A应用程序框架)
我正在使用P4A应用程序框架,我制作了一个下拉选择框,允许用户选择一个位置,当选择该位置并按下“继续”按钮时,用户将根据选择进入一个新页面。我陷入困境的地方是在数据库中进行查询,以获取位置ID,从而将用户引导到正确的页面,下面是我得到的代码:-Php 获取下拉选择以将用户引导到新页面(MySQL&&P4A应用程序框架),php,mysql,zend-framework,Php,Mysql,Zend Framework,我正在使用P4A应用程序框架,我制作了一个下拉选择框,允许用户选择一个位置,当选择该位置并按下“继续”按钮时,用户将根据选择进入一个新页面。我陷入困境的地方是在数据库中进行查询,以获取位置ID,从而将用户引导到正确的页面,下面是我得到的代码:- $this->build("p4a_db_source", "login") ->setTable("meetingrooms") ->load() ->firstRow(); $this->
$this->build("p4a_db_source", "login")
->setTable("meetingrooms")
->load()
->firstRow();
$this->build('p4a_field','location')
->setSource($this->login)
->setLabel('location')
->setType('select')
->setSourceValueField("ID")
->setSourceDescriptionField("MeetingRoom")
->setWidth(120);
$this->build("p4a_fieldset","Book")
->anchor($this->location)
//->anchor($this->booking)
->anchor($this->continue)
->setLabel('Meeting room bookings');
$this->display("main",$this->Book);
}
public function change()
{
$location = $this->MeetingRoom->getNewValue();
$sql = "SELECT * FROM meetingrooms
WHERE
MeetingRoom = ?";
$row = p4a_db::singleton()->fetchRow($sql, array($location));
if ($row['MeetingRoom'] == "AreaOne")
{
p4a::singleton()->openmask("Area_One");
}
else
{
$this->setTitle("Process Failed");
{
elseif ($location=="AreaTwo")
{
p4a::singleton()->openmask("AreaTwo");
}
elseif ($location=="AreaThree")
{
p4a::singleton()->openmask("AreaThree");
}
我不知所措,因为这是我需要的会议室系统应用程序的最后一部分,没有一些细节。忽略它,它不重要:忽略它,它不重要:我认为这很重要,但是有一种更好的方法让这个系统使用小部件并将它们传输到活动页面,有关详细信息,请查看p4a链接:
阅读文档以获取帮助我认为这很重要,但有一种更好的方法可以让系统使用小部件并将其传输到活动页面,请查看p4a链接以了解详细信息: 阅读文档以获取帮助