Hello,
My problem is not complicated.
My form page is not a registration form is a ticket, that is sent to me when ever a person requests my services. Now as of right now, i have that ticket sending me an email with all their details. All i want to do is email them back and let them know that i did get their ticket and i will be getting back to them asap.
Now i have an action when the submit button is pressed on the form. But that action leads to my page that sends the email to ME. I attempted to send another email in that same scipt withthe mail($to,$subject,ect......) but apparently im only allowed to send one email per script. This is very time consuming trying my very best to script this right. I need to know where to put the email to the client script in. And i need to know if i should add it in the actual form page and change that to a PHP, or should i add it somewhere in my send.php page?. The coads of both pages as i have entered the sending to the client on each are added below.
Ticket.php page (The actual form)
<style type="text/css">
<!--
#secondary {
color: #FFF;
background-color: #000;
text-align: left;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_validateForm() { //v4.0
if (document.getElementById){
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
} }
//-->
</script>
<?php
if (_$POST['submit_form'])
{
//get form data
$first_lastname = $_POST['First_last'];
$client_email = $_POST['email'];
if (!$client_email)
echo "please make sure that you enter an email!"
else
{
//send email
$to = $email;
$subject = "Ticket recived!";
$headers = "From: example@example.com"
$body = "Hello $first_lastname, \n\n Your ticket has been sent to our mailbox, this email is to let you, our valued customer know that we will get back to you in 5-7 days. If you do not get an email in that time, something has gone wrong with your ticket. If this occurs, we urge you to call us at 705-752-2516 and report your problem, and we will help you get your ticket to our mailbox and your website on its way to the world wide web\n\n We thank you for submiting your ticket, please stand by while we review your ticket and construct a quote for you.\n\n Sincerely\n\n Your Click Art Team!";
if (!mail($to,$subject,$body,$headers))
echo "For somereason our emailing service is down please try later or email us at example@example.com. Thank you";
else
{
echo "Your ticket has now been sent in, To make sure that your ticket has made it to our mail box please check your email at: $email and make sure you recived an email from us. Thank you";
}
}
}
}
else
}
?>
<html>
<div id="secondary">
<p><span style="color:#F00">Ticket Fill out Form</span> <br />
-Do you already have a website and just want updates? Email us now <a href="mailto:www.example@example.com" style="color:#FFF">example@example.com</a><br />
-This Ticket is a <strong>no Oblication FREE quote</strong>. By pressing the submit button you donot commit yourself to any agreement.<br />
-All the elements with a " * " beside them are REQUIRED!
<br />
</p>
<form action="ticketsend.php" method="post" name="form1" target="_blank">
<table width="700" border="1" cellpadding="6">
<tr>
<td><label style="color:#FFF">First and Last names
</label></td>
<td><input name="First_last" type="text" id="First_last" onblur="MM_validateForm('First_last','','R');return document.MM_returnValue" maxlength="30" /> <span style="color:#FFF">*</span></td>
</tr>
<tr>
<td><label style="color:#FFF">Contact Email</label></td>
<td><input name="email" type="text" id="email" onblur="MM_validateForm('First_last','','R','email','','RisEmail');return document.MM_returnValue" /> <span style="color:#FFF">*</span></td>
</tr>
<tr>
<td><label style="color:#FFF">What is your Market Focus?</label></td>
<td><input type="text" name="market" id="market" /></td>
</tr>
<tr>
<td><label style="color:#FFF">Type of page (modern,basic,ect)
</label></td>
<td><select name="type_page" id="type_page">
<option value="none" selected="selected">Select...</option>
<option value="modern">Modern</option>
<option value="basic">Basic</option>
<option value="Flash">Flashy</option>
<option value="Ads">Advertisements</option>
</select></td>
</tr>
<tr>
<td><label style="color:#FFF">Would you like us to design graphics?</label></td>
<td><select name="graphics" id="graphics">
<option value="none" selected="selected">Select...</option>
<option value="yes">Yes please do it</option>
<option value="no">No we do that ourselves</option>
</select></td>
</tr>
<tr>
<td><p style="color:#FFF">Extras For your page? If you dont see all you want here, dont worry we have more email us at <a href"mailto:example@example.com" style="color:#FFF">example@example.com</a><br />
</p></td>
<td><label style="color:#FFF">
<input type="checkbox" name="Extrasforyourpage_2" value="forms" id="Extrasforyourpage_1" />
Flash banner</label>
<br />
<label style="color:#FFF">
<input type="checkbox" name="Extrasforyourpage_" value="banner" id="Extrasforyourpage_0" />
Forms (sign up pages)</label>
<br />
<label style="color:#FFF">
<input type="checkbox" name="Extras for your page?" value="nav bar" id="Extrasforyourpage_2" />
Navigation Bar</label>
<br />
<label style="color:#FFF">
<input type="checkbox" name="Extras for your page?" value="email me more" id="Extrasforyourpage_3" />
not sure, we have more get them by email</label>
<br />
<label style="color:#FFF">
<input type="checkbox" name="Extras for your page?" value="interactive images" id="Extrasforyourpage_4" />
Interactive Images</label></td>
</tr>
<tr>
<td><label style="color:#FFF">You know what you want? Tell us</label></td>
<td><textarea name="Want" cols="45" rows="5" id="Want">Tell us what you want in your web page!</textarea></td>
</tr>
<tr>
<td style="color:#FFF">To cancel the ticket and return to our homepage <a href="html/index.html" style="color:#FFF">click here</a></td>
<td>
<label>Submit
<input name="submit_form" type="submit" id="submit_form" onclick="MM_validateForm('first_name','','R','last_name','','R','line1_address','','R','phone_home','','R','email_address','','RisEmail');return document.MM_returnValue" value="Submit" />
</label></td>
</tr>
</table>
</form>
</div>
</html>
Ticketsend.php(The action php script after the submit button has been pressed)
<?php
/* This page and coad were created by Click Art contact us TEMP step_henk [nospam AT nospam] hotmail [nospam DOT nospam] com*/
/* Subject and Email Variables*/
$emailS = 'Ticket Submition/Quote';
$webMaster = 'example@example.com';
/*gathering data variables*/
$First_last = $_POST ['First_last'];
$email = $_POST ['email'];
$market = $_POST ['market'];
$type_page = $_POST ['type_page'];
$graphics = $_POST ['graphics'];
$extras1 = $_POST ['Extrasforyourpage_1'];
$extras0 = $_POST ['Extrasforyourpage_0'];
$extras2 = $_POST ['Extrasforyourpage_2'];
$extras3 = $_POST ['Extrasforyourpage_3'];
$extras4 = $_POST ['Extrasforyourpage_4'];
$want = $_POST ['Want'];
$body = <<<EOD
<br><hr><br>
First_lastnames: $First_last <br>
Email: $email <br>
Market_style: $market <br>
type_of_page: $type_page <br>
graphics_yes_no: $graphics <br>
extras_1: $extras1 <br>
extras_0: $extras0 <br>
extras_2: $extras2 <br>
extras_3: $extras3 <br>
extras_4: $extras4 <br>
want: $want <br>
EOD;
$headers = "From:$EmailAddress\r\n";
$headers .= "Content-Type: text/html\r\n";
$Success = mail($webMaster, $emailS, $body, $headers);
?>
NOTE, if it needs to be in the ticketsend.php script can you tell me where?...
Thank you so much