作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用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/
我是一名优秀的程序员,十分优秀!