【问题标题】:hard time to make the W3C AppML tutorial example working很难使 W3C AppML 教程示例正常工作
【发布时间】:2014-10-31 17:58:35
【问题描述】:

我尝试 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 包含 Northwind 内容,这是一个众所周知的用于测试的示例 SQL。

appml.js 未被修改。 appml_config.php 没有被修改。

我有customers.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

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

''Access Forbidden'' 字符串来自 appml_config.php 文件

仅此而已……

有没有人能告诉我,我在他们所谓的“教程”中准确复制 w3c 所说的内容时哪里错了?谢谢你。

【问题讨论】:

    标签: javascript php soa


    【解决方案1】:

    尝试改变这一行

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

    把它改成这个

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

    【讨论】:

    • 非常感谢您的回答。不幸的是,我离开了这个话题,因为我非常卡住。但是我会尽快尝试你的解决方案——需要重新安装所有东西——我会在这里分享结果,以便建立关于这个错误的常识。再次感谢
    猜你喜欢
    • 1970-01-01
    • 2013-07-03
    • 1970-01-01
    • 2012-04-23
    • 1970-01-01
    • 1970-01-01
    • 2015-03-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多