我正在工作中从事 CoovaChilli 项目。我有使用 PHP 的经验,但我对 shell 脚本非常陌生。尽管我在 Google 上搜索并阅读了 Coova 支持博客,但它们似乎并没有为初学者提供指导。
我要做的是成功登录后,将用户重定向到新页面。可悲的是,我不知道我在做什么,但我所做的是我试图遵循他们使用的完全相同的路径,将用户引导到按钮点击的注册页面......
他们为注册过程链接了 2 个主要的不同文件扩展名
新用户.chi
新用户.chi.save
newuser_form.tmpl
注册.chi
所以我为我的新文件创建了相同的文件扩展名
middle.tmpl(我想我必须在其中显示用户的余额)
中级chi
在提交按钮的登录页面中,我添加了我的新文件...
<!--
-- The login form
-->
<div id="login-form">
<table>
<tr>
<td>Username</td>
<td><INPUT NAME="username" VALUE="$FORM_username"></td>
</tr>
<tr>
<td>Password</td>
<td><INPUT NAME="password" VALUE="$FORM_password" TYPE="password"></td>
</tr>
<tr>
<td colspan="2" nowrap align="center">
<input type="button" name="signup" value="Sign Up" onClick="window.location='/www/newuser.chi'">
<input type="submit" name="button" value="Login" onClick="window.location='/www/intermediate.chi'">
</td>
</tr>
</table>
</div>
中间件.tmpl:
<div id="intermediate-form">
<table>
<tr>
<td>Reload</td>
<td><input type="button" name="reload" value="Reload" onClick="window.location='/www/recharge.chi'"></td>
</tr>
<tr>
<td>Balance</td>
<td>**---I Need To Display Customer's Balance Here---**</td>
</tr>
<tr>
<td colspan="2" nowrap align="center">
<input type="button" name="continue" value="Continue" onClick="window.location='http://www.earlierSuccessfullPage.com'">
</td>
</tr>
</table>
</div>
中级智:
<? # -*- mode: shell-script -*-
# Copyright (C) 2009-2011 Coova Technologies, LLC. <support@coova.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. ./config.sh
http_header
header "<meta></meta>"
uamfile "login 1"
intermediate /* <= I followed what they did in signup */
footer
?>
在config-local.sh我添加了这个新功能......
intermediate(){
form "intermediate.chi" "$(uamfile intermediate 1)"
}
我无法让它在按钮单击时成功重定向到一个空页面,更不用说在其上显示用户的余额了。