繁体   English   中英

难以使W3C AppML教程示例正常工作

[英]hard time to make the W3C AppML tutorial example working

我在w3c上尝试了教程appml

什么都没用...> <

我在以下网址下载了适用于php的appml: http//www.w3schools.com/appml/appml_download.asp

我将文件放在一个名为“ appml”的文件夹中

drwxr-xr-x  16 g_pierr  wheel    544 31 oct 18:25 Images
-rwxr-xr-x@  1 g_pierr  wheel   7402 26 sep  2013 appml.css
-rwxr-xr-x@  1 g_pierr  wheel  75662  7 jan  2014 appml.js
-rwxr-xr-x@  1 g_pierr  wheel  32956  7 jan  2014 appml.php
-rwxr-xr-x@  1 g_pierr  wheel    389 31 oct 18:43 appml_config.php
-rw-r--r--   1 g_pierr  wheel    142 31 oct 18:42 customers.xml
-rw-r--r--   1 g_pierr  wheel    401 31 oct 18:41 index.htm

appml_config.php是:

<?php echo("Access Forbidden");exit(); ?>

<appml>

<database name="appmldemo">
<host>localhost:3306</host>
<name>test_db</name>
<user>root</user>
<password>root</password>
</database>

<database name="appmlsecurity">
<host>localhost:3306</host>
<name> test_db</name>
<user>root</user>
<password>root</password>
</database>

<dateformat>yyyy-mm-dd</dateformat>

test_db存在并且凭证起作用。 test_db包含罗斯文内容,这是用于测试的众所周知的示例SQL。

appml.js尚未修改。 appml_config.php尚未修改。

我有用于处理数据的customer.xml

<appml>

<datasource>
<database>
  <connection>appmldemo</connection>
  <sql>SELECT * FROM customers</sql>
</database>
</datasource>

</appml>

我在“视图”部分上有index.html

<h1>My First Web Application</h1>

<div id="Place01">
<table id="Template01" class="appmltable">
<tr>
  <th>Customer</th>
  <th>City</th>
 <th>Country</th>
</tr>
<tr id="appml_row">
  <td>#CustomerName#</td>
  <td>#City#</td>
  <td>#Country#</td>
</tr>
</table>
</div>

<script src="appml.js"></script>
<script>
app=new AppML("appml_config.php","customers");
app.run("Place01","Template01");
</script>

最后,我收到了javascript警报,始终保持不变> <

<br />
<b>Deprecated</b>:  Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in <b>Unknown</b> on line <b>0</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent in <b>Unknown</b> on line <b>0</b><br />
Access Forbidden

已弃用只是我现在不在乎的警告。 第二个警告是关于标头已经由发送:它不会阻止脚本执行,然后我都不在乎。

``禁止访问''字符串来自appml_config.php文件

仅此而已...

在我所谓的“教程”的w3c内容的精确复制中,有人能告诉我哪里错了吗? 谢谢你

尝试更改此行

app=new AppML("appml_config.php","customers");

并将其更改为此

app=new AppML("appml.php","customers");

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM