我在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>
testdb存在并且凭据正在工作。test_db包含northwind内容,这是一个众所周知的用于测试的示例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");