# Complete PHP Noob! Please help with PHP Comment Script!

**URL:** https://forum.kirupa.com/t/complete-php-noob-please-help-with-php-comment-script/224517
**Category:** programming
**Created:** [May 3, 2007, 12:18am UTC](https://forum.kirupa.com/t/complete-php-noob-please-help-with-php-comment-script/224517 "2007-05-03T00:18:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![laterales](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/laterales/32/3572_2.png) [@laterales](https://forum.kirupa.com/u/laterales)
#### Post date: [May 3, 2007, 12:18am UTC](https://forum.kirupa.com/t/complete-php-noob-please-help-with-php-comment-script/224517/1 "2007-05-03T00:18:05Z")

</div>

Hi Everyone :}

I am a complete PHP newbie and I am trying to follow the tutorial here on how to set up a comment form.

I have put together the following PHP for the mailer.php:

\<?php  
if(isset($\_POST[‘submit’])) {

$to = “lesley@aliarts.co.nz”;  
$subject = “Form Submission from BusinessCardBiz”;  
$name = $\_POST[‘name’];  
$qualifications = $\_POST[‘qualifications’];  
$position = $\_POST[‘position’];  
$physicaladdress = $\_POST[‘physicaladdress’];  
$postaladdress = $\_POST[‘postaladdress’];  
$city = $\_POST[‘city’];  
$state = $\_POST[‘state’];  
$zip = $\_POST[‘zip’];  
$phone = $\_POST[‘phone’];  
$fax = $\_POST[‘fax’];  
$email = $\_POST[‘email’];  
$website = $\_POST[‘website’];  
$tagline = $\_POST[‘tagline’];  
$dropdown = $\_POST[‘drop\_down’];  
$backcontent = $\_POST[‘backcontent’];  
$anythingelse = $\_POST[‘anythingelse’];

}

$body = “From: $name  
Qualifications: $qualifications  
Physical Address: $physicaladdress  
Postal Address: $postaladdress  
City: $city  
State: $state  
Zip: $zip  
Phone: $phone  
Fax: $fax  
email: $email  
Website: $website  
Tagline: $tagline  
$check\_msg Option: $option  
Drop-Down: $dropdown  
Back Content:  
$backcontent Anything Else:  
$anythingelse”;

header( “Location: [http://www.businesscardbiz.com/thankyou.html](http://www.businesscardbiz.com/thankyou.html)” )  
echo “Data has been submitted to $to!”;  
mail($to, $subject, $body);  
} else {

echo “blarg!”;

}  
?\>

It could be a complete mess, but I am really not sure as I just tried to follow the tutorial and hope for the best!

When I take:

echo “Data has been submitted to $to!”;  
mail($to, $subject, $body);  
} else {

echo “blarg!”;

}

out, I get redirected to the page that I want to be, but no email. If I leave it on, I get this error:

**Parse error** : parse error, unexpected T\_ECHO in **/mnt/w0400/d45/s03/b0296bf0/www/businesscardbiz.com/mailer.php** on line \*\*30

\*\*I got the redirect from another tutorial as I couldn’t find here how to make it do this.

Please could someone look over my code and tell me what I need to fix, I will be eternally grateful.

Thanks so much in advance

Lesley
