<?php
require "db.inc";
require_once "HTML/Template/ITX.php";// Test for user input
if (!empty($_GET["surname"]) &&
!empty($_GET["firstname"]) &&
!empty($_GET["phone"]))
{
if (!($connection = @ mysql_connect("localhost", "root", "pengshifu")))
die("Could not connect to database"); $surname = mysqlclean($_GET, "surname", 50, $connection);
$firstname = mysqlclean($_GET, "firstname", 50, $connection);
$phone = mysqlclean($_GET, "phone", 20, $connection); if (!mysql_select_db("telephone", $connection))
showerror(); // Insert the new phonebook entry
$query = "INSERT INTO phonebook VALUES
(NULL, '{$surname}', '{$firstname}', '{$phone}')"; if (!(@mysql_query ($query, $connection)))
showerror(); $template = new HTML_Template_ITX("./templates");
$template->loadTemplatefile("exa.tpl", true, true);
$template->setCurrentBlock();
$template->setVariable("SURNAME", $surname);
$template->setVariable("FIRSTNAME", $firstname);
$template->setVariable("PHONE", $phone);
$template->parseCurrentBlock(); $template->show();
} // if empty()
else
// Missing data: Go back to the <form>
header("Location: example.8-1.html");
?>我怎么找不到包含文件require_once "HTML/Template/ITX.php";
这个呢。?还有。添加信息和这个啥模板的有什么关系啊?
require "db.inc";
require_once "HTML/Template/ITX.php";// Test for user input
if (!empty($_GET["surname"]) &&
!empty($_GET["firstname"]) &&
!empty($_GET["phone"]))
{
if (!($connection = @ mysql_connect("localhost", "root", "pengshifu")))
die("Could not connect to database"); $surname = mysqlclean($_GET, "surname", 50, $connection);
$firstname = mysqlclean($_GET, "firstname", 50, $connection);
$phone = mysqlclean($_GET, "phone", 20, $connection); if (!mysql_select_db("telephone", $connection))
showerror(); // Insert the new phonebook entry
$query = "INSERT INTO phonebook VALUES
(NULL, '{$surname}', '{$firstname}', '{$phone}')"; if (!(@mysql_query ($query, $connection)))
showerror(); $template = new HTML_Template_ITX("./templates");
$template->loadTemplatefile("exa.tpl", true, true);
$template->setCurrentBlock();
$template->setVariable("SURNAME", $surname);
$template->setVariable("FIRSTNAME", $firstname);
$template->setVariable("PHONE", $phone);
$template->parseCurrentBlock(); $template->show();
} // if empty()
else
// Missing data: Go back to the <form>
header("Location: example.8-1.html");
?>我怎么找不到包含文件require_once "HTML/Template/ITX.php";
这个呢。?还有。添加信息和这个啥模板的有什么关系啊?
解决方案 »
- Magento简体中文版
- 大学了毕业了~工作不好找?我们如何亡羊补牢?
- 求助 zend studio 下删除的项目
- jQuery的问题
- php网站问题
- 双cpu8核处理器 16G内存 httpd-mpm.conf和my.ini里面的参数如何设置??? 由于 设置不好望求大侠指点! windows2003 +ap
- 推荐个不用数据库的留言板
- php中的$$str有两个$符号,起什么作用?
- xampp 安装完后 xampp phpmyadmin 是怎么在 apache里设成同一根目录的。
- 身份证及姓名认证功能??
- 求!!PHP+MYSQL+FLASH 做个极其简单的小游戏 就一关
- 新手学习PHP。遇到问题求教,在线等
你用绝对+相对路径吧。require(dirname(__FILE__).'/相对路径');
表示和当前文件同一目录下的HTML/Template/ITX.php,你确定这个文件路径是对的?
添加信息是php语言,模板是为这个语言提供数据输出的
就和html差不多,要来显示数据和提交数据操作的