gpt4 book ai didi

php - 获取下拉选择以将用户定向到新页面(MySQL && P4A 应用程序框架)

转载 作者:行者123 更新时间:2023-11-29 04:49:58 24 4
gpt4 key购买 nike

我正在使用P4A应用程序框架,并且我制作了一个下拉的选择框,允许用户选择一个位置(按下继续按钮)将用户带到新页面(取决于选择)。我卡住的地方是在数据库中进行查询以获取位置的 ID 以将用户定向到正确的页面,这是我得到的代码:-

$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");
}

我不知所措,因为这是我需要的 session 室系统应用程序的最后一部分(减去一些非常小的细节。)

最佳答案

我认为这很重要,但是有更好的方法让这个系统使用小部件并将它们传输到事件页面,查看 p4a 链接了解详细信息:)

p4a阅读文档寻求帮助

关于php - 获取下拉选择以将用户定向到新页面(MySQL && P4A 应用程序框架),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13088946/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com