hello everybody, I need ur help
i have created a simple Form with just a few fields to collect messages from my clients. I have included a checkbox which when clicked causes a copy of the same message sent to me to be sent to my client. How can i customise my code to realise the function of this checkbox. Below is the code that processes my form
Thanks a lot for your response. I think i did not explain my problem well before. I will try again. When my clients opens the form, he fills in the fields labelled, Name/Vorname, Betreff, Email and Nachricht(which is the message). Then there is a check box asking if the client wants to recieve a copy of the email, (this checkbox is the variable $field_5_opts in the process file). If he marks or ticks the chechbox then he is suppossed to recieve the same message i recieve. This is what i do not know how to realise. I tried what you suggested but it didn't work. I tried using an if statement but kept getting errors. I would really appreciate more help
tnteveret1 thanks though for the help. I appreciate very much.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It is impossible to give you exact code without seeing your process.php and form. I can help but you will have to send me your code and a link to your form. Otherwise there are many examples of php code that you can make use of on the internet.
You have the right idea and you are communicating well enough for me to know what you need but exact code is left to the person who owns the code. The phpFormGenerator is a great head start. customization is left to the user. I offer my help becuase I have benefited from the use of this SW myself.
So if you still need help send your code and links in an email.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am not sure if you need to see the install.php field but i will add it below anyway
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Kontaktieren Sie uns</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><link href="style.css" rel="stylesheet" type="text/css">
<!-- calendar stuff -->
<link rel="stylesheet" type="text/css" href="calendar/calendar-blue2.css" />
<script type="text/javascript" src="calendar/calendar.js"></script>
<script type="text/javascript" src="calendar/calendar-en.js"></script>
<script type="text/javascript" src="calendar/calendar-setup.js"></script>
<!-- END calendar stuff -->
<!-- expand/collapse function -->
<SCRIPT type=text/javascript>
<!--
function collapseElem(obj)
{
var el = document.getElementById(obj);
el.style.display = 'none';
}
function expandElem(obj)
{
var el = document.getElementById(obj);
el.style.display = '';
}
//-->
</SCRIPT>
<!-- expand/collapse function -->
<!-- expand/collapse function -->
<SCRIPT type=text/javascript>
<!--
// collapse all elements, except the first one
function collapseAll()
{
var numFormPages = 1;
hello everybody, I need ur help
i have created a simple Form with just a few fields to collect messages from my clients. I have included a checkbox which when clicked causes a copy of the same message sent to me to be sent to my client. How can i customise my code to realise the function of this checkbox. Below is the code that processes my form
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
session_start();
if( ($_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) ) {
// Checkbox handling
$field_5_opts = $_POST['field_5'][0];
mail("vibanterence@yahoo.com","phpFormGenerator - Form submission","Form data:
");
include("confirm.html");
}
else {
echo "Invalid Captcha String.";
}
?>
I will appreciate your help very much
mail("vibanterence@yahoo.com",
mail("vibanterence@yahoo.com;emailaddress@someurl.com",
or
somewhere before the mail function:
$to="vibanterence@yahoo.com".$form_variable_email;
mail($to,
Thanks a lot for your response. I think i did not explain my problem well before. I will try again. When my clients opens the form, he fills in the fields labelled, Name/Vorname, Betreff, Email and Nachricht(which is the message). Then there is a check box asking if the client wants to recieve a copy of the email, (this checkbox is the variable $field_5_opts in the process file). If he marks or ticks the chechbox then he is suppossed to recieve the same message i recieve. This is what i do not know how to realise. I tried what you suggested but it didn't work. I tried using an if statement but kept getting errors. I would really appreciate more help
tnteveret1 thanks though for the help. I appreciate very much.
It is impossible to give you exact code without seeing your process.php and form. I can help but you will have to send me your code and a link to your form. Otherwise there are many examples of php code that you can make use of on the internet.
You have the right idea and you are communicating well enough for me to know what you need but exact code is left to the person who owns the code. The phpFormGenerator is a great head start. customization is left to the user. I offer my help becuase I have benefited from the use of this SW myself.
So if you still need help send your code and links in an email.
Hello there, thanks oncemore. Here is a link to my Form
http://www.sql.domainprov.de/form1/form.html
and my process.php looks like this
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
session_start();
if( ($_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) ) {
// Checkbox handling
$field_5_opts = $_POST['field_5'][0];
$to="vibanterence@yahoo.com".$field_3;
mail($to,"phpFormGenerator - Form submission","Form data:
");
include("confirm.html");
}
else {
echo "Invalid Captcha String.";
}
?>
I am not sure if you need to see the install.php field but i will add it below anyway
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Kontaktieren Sie uns</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><link href="style.css" rel="stylesheet" type="text/css">
<!-- calendar stuff -->
<link rel="stylesheet" type="text/css" href="calendar/calendar-blue2.css" />
<script type="text/javascript" src="calendar/calendar.js"></script>
<script type="text/javascript" src="calendar/calendar-en.js"></script>
<script type="text/javascript" src="calendar/calendar-setup.js"></script>
<!-- END calendar stuff -->
<!-- expand/collapse function -->
<SCRIPT type=text/javascript>
<!--
function collapseElem(obj)
{
var el = document.getElementById(obj);
el.style.display = 'none';
}
function expandElem(obj)
{
var el = document.getElementById(obj);
el.style.display = '';
}
//-->
</SCRIPT>
<!-- expand/collapse function -->
<!-- expand/collapse function -->
<SCRIPT type=text/javascript>
<!--
// collapse all elements, except the first one
function collapseAll()
{
var numFormPages = 1;
for(i=2; i <= numFormPages; i++)
{
currPageId = ('mainForm_' + i);
collapseElem(currPageId);
}
}
//-->
</SCRIPT>
<!-- expand/collapse function -->
<!-- validate -->
<SCRIPT type=text/javascript>
<!--
function validateField(fieldId, fieldBoxId, fieldType, required)
{
fieldBox = document.getElementById(fieldBoxId);
fieldObj = document.getElementById(fieldId);
if(fieldType == 'text' || fieldType == 'textarea' || fieldType == 'password' || fieldType == 'file' || fieldType == 'phone' || fieldType == 'website')
{
if(required == 1 && fieldObj.value == '')
{
fieldObj.setAttribute("class","mainFormError");
fieldObj.setAttribute("className","mainFormError");
fieldObj.focus();
return false;
}
}
else if(fieldType == 'menu' || fieldType == 'country' || fieldType == 'state')
{
if(required == 1 && fieldObj.selectedIndex == 0)
{
fieldObj.setAttribute("class","mainFormError");
fieldObj.setAttribute("className","mainFormError");
fieldObj.focus();
return false;
}
}
else if(fieldType == 'email')
{
if((required == 1 && fieldObj.value=='') || (fieldObj.value!='' && !validate_email(fieldObj.value)))
{
fieldObj.setAttribute("class","mainFormError");
fieldObj.setAttribute("className","mainFormError");
fieldObj.focus();
return false;
}
}
}
function validate_email(emailStr)
{
apos=emailStr.indexOf("@");
dotpos=emailStr.lastIndexOf(".");
if (apos<1||dotpos-apos<2)
{
return false;
}
else
{
return true;
}
}
function validateDate(fieldId, fieldBoxId, fieldType, required, minDateStr, maxDateStr)
{
retValue = true;
fieldBox = document.getElementById(fieldBoxId);
fieldObj = document.getElementById(fieldId);
dateStr = fieldObj.value;
if(required == 0 && dateStr == '')
{
return true;
}
if(dateStr.charAt(2) != '/' || dateStr.charAt(5) != '/' || dateStr.length != 10)
{
retValue = false;
}
else // format's okay; check max, min
{
currDays = parseInt(dateStr.substr(0,2),10) + parseInt(dateStr.substr(3,2),10)*30 + parseInt(dateStr.substr(6,4),10)*365;
//alert(currDays);
if(maxDateStr != '')
{
maxDays = parseInt(maxDateStr.substr(0,2),10) + parseInt(maxDateStr.substr(3,2),10)*30 + parseInt(maxDateStr.substr(6,4),10)*365;
//alert(maxDays);
if(currDays > maxDays)
retValue = false;
}
if(minDateStr != '')
{
minDays = parseInt(minDateStr.substr(0,2),10) + parseInt(minDateStr.substr(3,2),10)*30 + parseInt(minDateStr.substr(6,4),10)*365;
//alert(minDays);
if(currDays < minDays)
retValue = false;
}
}
if(retValue == false)
{
fieldObj.setAttribute("class","mainFormError");
fieldObj.setAttribute("className","mainFormError");
fieldObj.focus();
return false;
}
}
//-->
</SCRIPT>
<!-- end validate -->
</head>
<body onLoad="collapseAll()">
<div id="mainForm">
<div id="formHeader">
<h2 class="formInfo">Kontaktieren Sie uns</h2>
</div>
<BR/><div id="footer"><p class="footer"><a class=footer href=http://phpformgen.sourceforge.net></a></p></div>
</body>
</html>
I am new on this forum and still learning to use it efficiently. Oncemore thanks for the help