Forum Moderators: coopster

Message Too Old, No Replies

Been staring at it forever!

PHP code for an email form...

         

Sagira

8:14 pm on Jun 24, 2009 (gmt 0)

10+ Year Member



<?php

$from = $_REQUEST['email'] ;
$subject = 'Insurance Verification' ;
$name = $_REQUEST['name'] ;
$phone = $_REQUEST['phone'] ;
$month = $_REQUEST['month'] ;
$date= $_REQUEST['date'] ;
$year = $_REQUEST['year'] ;
$InsName = $_REQUEST['insname'] ;
$policy# = $_REQUEST['policy#'] ;
$groupname = $_REQUEST['groupname'] ;
$group# = $_REQUEST['group#'] ;
$Insnumber = $_REQUEST['insnumber'] ;

$body = "Name: $name
\nPhone Number: $phone
\nDate of birth: $month $date , $year
\nInsurer's name: $insname
\nPolicy Number: $policy#
\nGroup Name: $groupname
\nGroup Number: $group#
\nInsurance Company's phone number: $insnumber";

if (empty($name) ¦¦($phone) ¦¦ ($month) ¦¦ ($date) ¦¦ ($year) ¦¦ ($insname) ¦¦ ($policy#)){
header( "Location: http://www.example.com/Error.html" );

}

else
{
header( "Location: http://www.example.com/Thanks.html" );
mail("a.plus.chiro@gmail.com", $subject, $body, "From: $from");
}

?>

This is my error. I have no clue what's wrong on line 12:

PHP Parse error: syntax error, unexpected T_VARIABLE in /hermes/bosweb/web255/b2558/ipw.stephaniem/public_html/Insurance.php on line 12

Maybe it's just that I've been coding all day and need a fresh eye, but I just don't see it.

[edited by: coopster at 9:07 pm (utc) on June 24, 2009]
[edit reason] please use example.com, thanks! [/edit]

Sagira

8:47 pm on Jun 24, 2009 (gmt 0)

10+ Year Member



Fixed the if statement and added empty to every field. Still getting the same error.

[edited by: Sagira at 8:50 pm (utc) on June 24, 2009]

Little_G

10:10 pm on Jun 24, 2009 (gmt 0)

10+ Year Member



Hi,

You can't have hashes in variable [php.net] names.

Andrew

Sagira

10:15 pm on Jun 24, 2009 (gmt 0)

10+ Year Member



Thanks bunches. :) Works now!