创建邮件/联系表单 [英] Create mail/contact form
问题描述
我试图创建一个电子邮件/联系表单,但我被困住了。 (我是一个php-newbie)
让我解释一下(抱歉我的英文不好,这不是我的母语)
我有一个包含必填字段和必要的php代码的表单。
还有一些代码可以验证字段是空的还是无效的
电子邮件地址。
但是如何在这个(相同的)
表格中显示错误消息(例如空字段)。 (例如在页面顶部)
我在前几天搜索但是找不到一个例子。
我很感激一些帮助或者如果可能的话,
斯蒂芬妮
I tried to create an email/contact form but i''am stuck. (i''am a php-newbie)
Let me explain (sorry for my bad english, it''s not my native language)
I have a form with the required fields and the necessary php-code.
There''s also some code to validate if a field is empty or there''s an invalid
email address.
But how can i display error messages (e.g. empty field), in this (same)
form. (e.g. at the top of the page)
I searching fore several day''s but can''t find an example.
I appreciate some help or example if possible,
Stephanie
推荐答案
2005年7月18日星期一13:58:11 +0200,Stephanie写道:
On Mon, 18 Jul 2005 13:58:11 +0200, Stephanie wrote:
我感谢一些帮助或示例,如果可能的话,
I appreciate some help or example if possible,
http://www.rent-a-tutor.com/tools/
尝试使用联系表单生成器与您的联系人创建一个PHP文件
表格。
Marian
-
Barrierefreie Online-Kurse:HTML,PHP,MySQL,Word,Excel
http://www.lernpilot.de/wbt/
Stephanie写道:
Stephanie wrote:
我试图创建一个电子邮件/联系表单,但我我被卡住。 (我是一个php-newbie)
让我解释一下(抱歉我的英文不好,这不是我的母语)
我有一个带有必填字段的表格必要的php代码。
还有一些代码可以验证字段是否为空或是否有无效的电子邮件地址。
但是如何显示错误消息(例如,空场),以这种(相同的)形式。 (例如,在页面顶部)
我在前几天搜索,但找不到一个例子。
I tried to create an email/contact form but i''am stuck. (i''am a php-newbie)
Let me explain (sorry for my bad english, it''s not my native language)
I have a form with the required fields and the necessary php-code.
There''s also some code to validate if a field is empty or there''s an invalid
email address.
But how can i display error messages (e.g. empty field), in this (same)
form. (e.g. at the top of the page)
I searching fore several day''s but can''t find an example.
类似于:
<?php
Something like:
<?php
display_form = true;
函数validate_data()
{
//这是代码验证
//来自帖子的所有数据以及
//有一些错误,那么它正确
//错误消息和/或其他错误标志。
//如果数据有效且
//假如果不是。
}
if(!empty(
display_form = true;
function validate_data()
{
// Here is the code that validates
// all the data from post and if
// there are some errors, then it proper
// error messages and/or other error flags.
// It returns true if data is valid and
// false if not.
}
if (!empty(
这篇关于创建邮件/联系表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!