显示从 XML 读取的信息
(我在这方面是个新手,答案让我更加困惑。我需要一个直接、准确的解决方案来解决这个问题,一步一步地向我阐明)
我有 2 个文档,<代码>test.php和test.xml
。 test.php
将显示部门内教师的姓名。就是这样,只是一个列表。例如,对于基于 XML 文档的 AT,如下所示:
John J. Doe
Jill J. Doe
在上一页中,我使用查询字符串来获取 id;示例: test.php?id=AT
我需要显示他们选择的部门内的所有员工姓名。下面是我的 XML 文档的片段。
<SOT>
<DEPARTMENT name="Aviation Technology" id="AT">
<EMPLOYEE type="Faculty">
<LOGIN>bdbowen</LOGIN>
<PASSWORD>bdbowen</PASSWORD>
<NAME>John J. Doe</NAME>
<IMAGE>images/faculty/bdbown.jpg</IMAGE>
<OFFICE>Knoy</OFFICE>
<PHONE>765.494.2884</PHONE>
<EMAIL>[email protected]</EMAIL>
</EMPLOYEE>
<EMPLOYEE type="Faculty">
<LOGIN>bdbowen</LOGIN>
<PASSWORD>bdbowen</PASSWORD>
<NAME>Jill J. Doe</NAME>
<IMAGE>images/faculty/bdbown.jpg</IMAGE>
<OFFICE>Knoy</OFFICE>
<PHONE>765.494.2884</PHONE>
<EMAIL>[email protected]</EMAIL>
</EMPLOYEE>
</DEPARTMENT>
<DEPARTMENT name="Mechanical Engineering Technology" id="MET">
<EMPLOYEE type="Faculty">
<LOGIN>bdbowen</LOGIN>
<PASSWORD>bdbowen</PASSWORD>
<NAME>John J. Doe</NAME>
<IMAGE>images/faculty/bdbown.jpg</IMAGE>
<OFFICE>Knoy</OFFICE>
<PHONE>765.494.2884</PHONE>
<EMAIL>[email protected]</EMAIL>
</EMPLOYEE>
</DEPARTMENT>
</SOT>
例如,如果他们选择使用 GET 提取 AT id 的链接,我想在页面上显示以下内容:
John J. Doe
Jill J. Doe
我该怎么做?
(I'm such a newbie at this that the answers just confuse me more. I need a direct, exact, solution to this problem, spelled out to me step by step)
I have 2 documents, test.php
and test.xml
. test.php
will display the names of the faculty within a department. That's it, just a list. For example, for AT based on the XML document shown below:
John J. Doe
Jill J. Doe
From a previous page I use query strings to get an id; example: test.php?id=AT
I need to display all the employee names within the department that they select. Below is a snippet of my XML document.
<SOT>
<DEPARTMENT name="Aviation Technology" id="AT">
<EMPLOYEE type="Faculty">
<LOGIN>bdbowen</LOGIN>
<PASSWORD>bdbowen</PASSWORD>
<NAME>John J. Doe</NAME>
<IMAGE>images/faculty/bdbown.jpg</IMAGE>
<OFFICE>Knoy</OFFICE>
<PHONE>765.494.2884</PHONE>
<EMAIL>[email protected]</EMAIL>
</EMPLOYEE>
<EMPLOYEE type="Faculty">
<LOGIN>bdbowen</LOGIN>
<PASSWORD>bdbowen</PASSWORD>
<NAME>Jill J. Doe</NAME>
<IMAGE>images/faculty/bdbown.jpg</IMAGE>
<OFFICE>Knoy</OFFICE>
<PHONE>765.494.2884</PHONE>
<EMAIL>[email protected]</EMAIL>
</EMPLOYEE>
</DEPARTMENT>
<DEPARTMENT name="Mechanical Engineering Technology" id="MET">
<EMPLOYEE type="Faculty">
<LOGIN>bdbowen</LOGIN>
<PASSWORD>bdbowen</PASSWORD>
<NAME>John J. Doe</NAME>
<IMAGE>images/faculty/bdbown.jpg</IMAGE>
<OFFICE>Knoy</OFFICE>
<PHONE>765.494.2884</PHONE>
<EMAIL>[email protected]</EMAIL>
</EMPLOYEE>
</DEPARTMENT>
</SOT>
For instance, if they select the link that uses a GET to pull in the AT id, I want to display the following on the page:
John J. Doe
Jill J. Doe
How can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论