Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US :: FAQ
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE DREAMWEAVER:HomeDreamweaver ForumDreamweaver TutorialsFAQAdobe FlashWeb Design

Contact Form not sending all the information to the email

COW Forums : Adobe Dreamweaver

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook
Jessa WilcoxenContact Form not sending all the information to the email
by on Feb 11, 2009 at 4:36:16 pm

I am receiving an error that says "Parse error: syntax error, unexpected T_VARIABLE in /home/wilcoxen/public_html/mailer.php on line 14" and can't figure it out. I'm pasting my code from home.php file and the one from my new action file mailer.php.

Line 14 is this line:
$body = "From:n$namen$company_namennE-Mail:n$emailnnPhone:n$phonen nProject:n$projectnnHear About:n$hear_aboutnnEmail Phone:n$email_phone";

Here is the home.php code:

<div class="AccordionPanel">
<div class="AccordionPanelTab">contact</div>
<div class="AccordionPanelContent">
<div id="accordian_textholder">
<form method="POST" action="mailer.php">
<table width="860" border="0" cellpadding="4">
<tr>
<td width="130">name*</td>
<td width="194"><span id="sprytextfield1">
<label>
<input type="text" name="name" id="name2" />
</label>
<span class="textfieldRequiredMsg">A value is required.</span></span> </td>
<td width="27">&nbsp;</td>
<td width="193">project description</td>
<td width="264"><span id="sprytextarea2">
<label>
<textarea name="project" id="project" cols="30" rows="4"></textarea>
</label>
</span> </td>
</tr>
<tr>
<td>company name</td>
<td><span id="sprytextfield2">
<label>
<input type="text" name="company_name" id="company_name" />
</label>
</span> </td>
<td width="27">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>e-mail address*</td>
<td><span id="sprytextfield3">
<label>
<input type="text" name="email" id="email" />
</label>
<span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span> </td>
<td width="27">&nbsp;</td>
<td>how did you hear about creative spark?</td>
<td><span id="sprytextarea3">
<label>
<textarea name="hear_about" id="hear_about" cols="30" rows="4"></textarea>
</label>
</span> </td>
</tr>
<tr>
<td>phone number</td>
<td><span id="sprytextfield4">
<label>
<input type="text" name="phone" id="phone" />
</label>
</span> </td>
<td width="27">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>best method to reach you</td>
<td><span id="spryselect1">
<label>
<select name="email_phone" id="email_phone">
<option value="email" selected="selected">email</option>
<option value="phone">phone</option>
</select>
</label>
</span></td>
<td width="27">&nbsp;</td>
<td>&nbsp;</td>
<td><label>
<input type="submit" name="submit" id="submit" value="send request" />
</label>
</td>
</tr>
</table>
</form>
<p><br />
Email me directly at <a href="mailto:jessa.wilcoxen@gmail.com">jessa.wilcoxen@gmail.com</a></p>
</div>
</div>
</div>





Here is the mailer.php code:

<?php
//if(isset($_POST['submit'])) {
$to = "jessa.wilcoxen@gmail.com";
$subject = "Contact from website";

$name = $_POST['name'];
$company_name = $_POST['company_name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$project = $_POST['project'];
$hear_about = $_POST['hear_about'];
$email_phone = $_POST['email_phone'];

$body = "From:\n$name\n$company_name\n\nE-Mail:\n$email\n\nPhone:\n$phone\n \nProject:\n$project\n\nHear About:\n$hear_about\n\nEmail Phone:\n$email_phone";

//echo "Data has been submitted to $to!";
mail($to, $subject, $body);
//} else {
//echo "Sorry there was an error!";
//}
?>

Any ideas would be greatly appreciated.


Return to posts index
Reply   Like  

Jessa WilcoxenRe: Contact Form not sending all the information to the email
by on Feb 11, 2009 at 6:18:49 pm

I forgot to mention that the website I'm referring to is http://www.jessaportfolio.com/home.php . Click on contact to see the form.



Return to posts index
Reply   Like  

Fernando MolRe: Contact Form not sending all the information to the email
by on Feb 13, 2009 at 12:12:25 am

When are you receiving the error?



Return to posts index
Reply   Like  


Fernando MolRe: Contact Form not sending all the information to the email
by on Feb 13, 2009 at 12:27:39 am

You'll receive an error if you access the mailer.php directly because your code is expecting the variables from your form.



Return to posts index
Reply   Like  

Jessa WilcoxenRe: Contact Form not sending all the information to the email
by on Feb 13, 2009 at 3:34:38 am

I added this code to the send_results.php page:

$body = "From:n$namen$company_namennE-Mail:n$emailnnPhone:n$phonennProject:n$projectnnHear
About:n$hear_aboutnnEmail Phone:n$email_phone";
}

I hadn't put any code telling it to send the body information. It
works fine now. Thanks for all of your help.





Return to posts index
Reply   Like  

Fernando MolRe: Contact Form not sending all the information to the email
by on Feb 13, 2009 at 3:56:43 am

Not very much help, but a lot of good intentions =)



Return to posts index
Reply   Like  

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook


FORUMSTUTORIALSFEATURESVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2014 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]