【发布时间】:2012-01-21 07:34:09
【问题描述】:
我正在尝试在网站中嵌入专家系统。
我的专家系统代码是一个 Jess 脚本 (1.clp),例如:
(defrule ask_input
(initial-fact)
=>
(printout t "Welcome " ?*answer* crlf)
)
我在 php 中使用了一个表单,当我按下提交按钮时我想要 通过 jess 运行 1.clp,并将表单中的变量 fname 保存在 ?answer 中。
例如 1.html
<html>
<body>
<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
<input type="submit" />
</form>
</body>
</html>
欢迎.php
<?php
$name = $_POST["fname"];
// connect with 1.clp
?>
有什么想法吗?
我还能以其他方式做同样的事情吗? 提前致谢
【问题讨论】: