简体   繁体   English

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

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

I try the tutorial appml on w3c 我在w3c上尝试了教程appml

Nothing is working... >< 什么都没用...> <

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

I put files in a folder called "appml" 我将文件放在一个名为“ 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

the appml_config.php is : 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 exists and credentials working. test_db存在并且凭证起作用。 test_db contains the northwind content, which is a well-known sample SQL used for tests. test_db包含罗斯文内容,这是用于测试的众所周知的示例SQL。

The appml.js has not been modified. appml.js尚未修改。 The appml_config.php has not been modified. appml_config.php尚未修改。

I have customers.xml for handle data 我有用于处理数据的customer.xml

<appml>

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

</appml>

and I have index.html on the 'view' part 我在“视图”部分上有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>

At the end, I got a javascript alert , always the same >< 最后,我收到了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

The deprecated is just a warning I dont care about now. 已弃用只是我现在不在乎的警告。 The second warning is about header already sent by : it doesnt block script execution, then I dont care neither. 第二个警告是关于标头已经由发送:它不会阻止脚本执行,然后我都不在乎。

The ''Access Forbidden'' string comes from the appml_config.php file ``禁止访问''字符串来自appml_config.php文件

And nothing more... 仅此而已...

Does anyone could tell me where I'm wrong in my exact reproduction of what w3c is saying, in what they called 'a tutorial' ? 在我所谓的“教程”的w3c内容的精确复制中,有人能告诉我哪里错了吗? thx you. 谢谢你

Try to change this line 尝试更改此行

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

and change it to this 并将其更改为此

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

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

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