wat is er mis met deze php formulier:
Ik ben nu met deze formulier bezig, bestaat uit drie delen:
1- config.inc
2- contact.php
3- contactform.php
dit zijn de code van 1- config.inc
<?
#########################################################
# ContactForm #
#########################################################
# #
# Created by: Doni Ronquillo #
# Modified by: CodeMunkyX #
# #
# This script and all included functions, images, #
# and documentation are copyright 2003 #
# free-php.net (http://free-php.net) unless #
# otherwise stated in the module. #
# #
# Any copying, distribution, modification with #
# intent to distribute as new code will result #
# in immediate loss of your rights to use this #
# program as well as possible legal action. #
# #
#########################################################
# script name
$scriptname = "Contact Form";
# use full paths
# not using full paths could prevent the script from functioning properly
# script directory # no trailing slash
$script_dir = "";
# script url (url to script directory above)
# no trailing slash
$script_url = "http://www.free-php.net/demo/ContactForm";
# variables below corresponds to the Email to * in your contact form
# match the numbers to the value for which option maps to a specific email
# you can add more as long as you keep them in sync
$adminemail[1] = "mijnmail@hccnet.nl";
$adminemail[2] = "mijnmail@casema.nl";
$adminemail[3] = "minmail@casema.nl";
# preceeds the subject the user puts in on the contact form
$subjectheader = "Dank U wel voor uw aanvraag";
# url the form will redirect to after sending email
$redirecturl = "";
# text that will display if you leave above variable blank
$finishedtext = "Dank voor u aanvraag, wij nemen zsm mogelijk contact met u op.";
# how the message will show in the email
# you can reorder these how you wish or modify the message itself to your liking
# just be sure and leave the $variables in tact
$msg2 = "
Name: $name
Email: $email
Company: $company
Phone: $phone
Website: $website
Message:$msg
";
?>
=====================================================
en dit zijn deze code 2- contact.php
<?
#########################################################
# ContactForm #
#########################################################
# #
# Created by: Doni Ronquillo #
# Modified by: CodeMunkyX #
# #
# This script and all included functions, images, #
# and documentation are copyright 2003 #
# free-php.net (http://free-php.net) unless #
# otherwise stated in the module. #
# #
# Any copying, distribution, modification with #
# intent to distribute as new code will result #
# in immediate loss of your rights to use this #
# program as well as possible legal action. #
# #
#########################################################
include('config.inc');
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$name = $_POST[name];
$email = $_POST;
$company = $_POST[company];
$phone = $_POST[phone];
$website = $_POST[website];
$msg = $_POST[msg];
$subject = $_POST[subject];
$email = "m.nejad@hccnet.nl";
echo "$msg2";
echo "<br><center>$adminemail[$who] </center><br>";
opmerking: deze variabele is leeggggggggggg...........
// $msg2 is set in config.inc which formats the body of the message
mail("$adminemail[$who]", "$subjectheader $subject", "$msg2", "From: $email \nReply-To: $email");
if ($redirecturl != "") {
header("Location: $redirecturl");
echo "<br><center> de request is POST </center><br>";
} else {
echo "<br><center>$finishedtext</center><br>";
}
} else {
include('header.php');
include('contactform.php');
include('footer.php');
}
?>
=====================================================
3- contactform.php
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide code from non-js browsers
function validate()
{
formObj = document.contact;
if ((formObj.name.value == "") ||
(formObj.email.value == "") ||
(formObj.subject.value == "") ||
(formObj.msg.value == ""))
{
alert("U hebt niet alle velden ingevuld");
return false;
}
else {
alert('<? echo $finishedtext; ?>');
return true;
}
}
// end hiding -->
</SCRIPT>
<TABLE BORDER=0 cellpadding=5 cellspacing=0>
<TR>
<TD>
<TABLE BORDER=0 cellpadding=2 cellspacing=0>
<form action="<? echo $script_url; ?>contact.php" method="post" name="contact" onSubmit="return validate()">
<TR>
<TD>
<BR>
<DIV>
Naam
<input type=text value='mijn naam' size=50 maxlength=50 name=name class='txtfield'><BR>
Email Adress
<input type='text' value='m.nejad@hccnet.nl' size='50' maxlength='60' name='email'><BR>
Bedrijf
<input type='text' value='nejad company' size='50' maxlength='50' name='company'><BR>
Telefoon
<input type='text' value='06-000000' size='50' maxlength='32' name='phone'><BR>
Website
<input type='text' value='www.xxxxx.nl' size='50' maxlength='60' name='website'><BR>
Onderdeel
<select name='who'>
<option value='1'>Offerte aanvraag</option>
<option value='2'>Contact opnemen</option>
<option value='3'>Extra informatie</option>
</select><BR>
Onderwerp
<input type='text' value='offerte aanvraag' size='50' maxlength='60' name='subject'><BR>
Beschrijving
<textarea name='msg' rows='7' cols='50'></textarea><BR>
</DIV>
<input type='submit' value='submit'> <BR>
</TD>
</tR>
</FORM>
</tABLE>
</TD>
</TR>
</tABLE>
Ik ben nu met deze formulier bezig, bestaat uit drie delen:
1- config.inc
2- contact.php
3- contactform.php
dit zijn de code van 1- config.inc
<?
#########################################################
# ContactForm #
#########################################################
# #
# Created by: Doni Ronquillo #
# Modified by: CodeMunkyX #
# #
# This script and all included functions, images, #
# and documentation are copyright 2003 #
# free-php.net (http://free-php.net) unless #
# otherwise stated in the module. #
# #
# Any copying, distribution, modification with #
# intent to distribute as new code will result #
# in immediate loss of your rights to use this #
# program as well as possible legal action. #
# #
#########################################################
# script name
$scriptname = "Contact Form";
# use full paths
# not using full paths could prevent the script from functioning properly
# script directory # no trailing slash
$script_dir = "";
# script url (url to script directory above)
# no trailing slash
$script_url = "http://www.free-php.net/demo/ContactForm";
# variables below corresponds to the Email to * in your contact form
# match the numbers to the value for which option maps to a specific email
# you can add more as long as you keep them in sync
$adminemail[1] = "mijnmail@hccnet.nl";
$adminemail[2] = "mijnmail@casema.nl";
$adminemail[3] = "minmail@casema.nl";
# preceeds the subject the user puts in on the contact form
$subjectheader = "Dank U wel voor uw aanvraag";
# url the form will redirect to after sending email
$redirecturl = "";
# text that will display if you leave above variable blank
$finishedtext = "Dank voor u aanvraag, wij nemen zsm mogelijk contact met u op.";
# how the message will show in the email
# you can reorder these how you wish or modify the message itself to your liking
# just be sure and leave the $variables in tact
$msg2 = "
Name: $name
Email: $email
Company: $company
Phone: $phone
Website: $website
Message:$msg
";
?>
=====================================================
en dit zijn deze code 2- contact.php
<?
#########################################################
# ContactForm #
#########################################################
# #
# Created by: Doni Ronquillo #
# Modified by: CodeMunkyX #
# #
# This script and all included functions, images, #
# and documentation are copyright 2003 #
# free-php.net (http://free-php.net) unless #
# otherwise stated in the module. #
# #
# Any copying, distribution, modification with #
# intent to distribute as new code will result #
# in immediate loss of your rights to use this #
# program as well as possible legal action. #
# #
#########################################################
include('config.inc');
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$name = $_POST[name];
$email = $_POST;
$company = $_POST[company];
$phone = $_POST[phone];
$website = $_POST[website];
$msg = $_POST[msg];
$subject = $_POST[subject];
$email = "m.nejad@hccnet.nl";
echo "$msg2";
echo "<br><center>$adminemail[$who] </center><br>";
opmerking: deze variabele is leeggggggggggg...........
// $msg2 is set in config.inc which formats the body of the message
mail("$adminemail[$who]", "$subjectheader $subject", "$msg2", "From: $email \nReply-To: $email");
if ($redirecturl != "") {
header("Location: $redirecturl");
echo "<br><center> de request is POST </center><br>";
} else {
echo "<br><center>$finishedtext</center><br>";
}
} else {
include('header.php');
include('contactform.php');
include('footer.php');
}
?>
=====================================================
3- contactform.php
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide code from non-js browsers
function validate()
{
formObj = document.contact;
if ((formObj.name.value == "") ||
(formObj.email.value == "") ||
(formObj.subject.value == "") ||
(formObj.msg.value == ""))
{
alert("U hebt niet alle velden ingevuld");
return false;
}
else {
alert('<? echo $finishedtext; ?>');
return true;
}
}
// end hiding -->
</SCRIPT>
<TABLE BORDER=0 cellpadding=5 cellspacing=0>
<TR>
<TD>
<TABLE BORDER=0 cellpadding=2 cellspacing=0>
<form action="<? echo $script_url; ?>contact.php" method="post" name="contact" onSubmit="return validate()">
<TR>
<TD>
<BR>
<DIV>
Naam
<input type=text value='mijn naam' size=50 maxlength=50 name=name class='txtfield'><BR>
Email Adress
<input type='text' value='m.nejad@hccnet.nl' size='50' maxlength='60' name='email'><BR>
Bedrijf
<input type='text' value='nejad company' size='50' maxlength='50' name='company'><BR>
Telefoon
<input type='text' value='06-000000' size='50' maxlength='32' name='phone'><BR>
Website
<input type='text' value='www.xxxxx.nl' size='50' maxlength='60' name='website'><BR>
Onderdeel
<select name='who'>
<option value='1'>Offerte aanvraag</option>
<option value='2'>Contact opnemen</option>
<option value='3'>Extra informatie</option>
</select><BR>
Onderwerp
<input type='text' value='offerte aanvraag' size='50' maxlength='60' name='subject'><BR>
Beschrijving
<textarea name='msg' rows='7' cols='50'></textarea><BR>
</DIV>
<input type='submit' value='submit'> <BR>
</TD>
</tR>
</FORM>
</tABLE>
</TD>
</TR>
</tABLE>
Laatst bewerkt: