Page 1 of 1

Form processing troubles

Posted: Sat Apr 22, 2006 7:11 am
by Kain Elderan
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Can anyone help me? I'm trying to get this to send an email to me with the information from an "order form". Do you see any errors? I keep getting a Parse error: unexpected $ on the last line.

Code: Select all

<?php

if (isset($_POST['submitButtonName'])){ 

$email= 'dan@silverfalls.org'; // add your email here 

$body=<<<BODY
Hello, 

$Name has submitted a construction contract. Below are the details.
$Name Email is $Customer_Email.

Park  $Park
Fountain  $Fountain
Power Generator  $Power_Generator
Silo  $Silo
Warehouse  $Warehouse
Mine  $Mine
Personal Residence  $Personal_Residence
10 Flat  $Ten_Flat
20 Flat  $Twenty_Flat
30 Flat  $Thirty_Flat
40 Flat  $Fourty_Flat
50 Flat  $Fifty_Flat
60 Flat  $Sixty_Flat
70 Flat  $Seventy_Flat
80 Flat  $Eighty_Flat
90 Flat  $Ninety_Flat
100 Flat  $Hundred_Flat
Worker Compound  $Worker_Compound
Council Flats  $Council_Flats
Garage  $Garage
Hangar  $Hangar
Hotel  $Hotel
Office  $Office
Tavern  $Tavern
Landing_Pad  $Landing_Pad
Holonet Comm Ctr  $Holonet_Com_Ctr
Palace  $Palace
Barracks  $Barracks
Comp Ctrl Ctr  $Comp_Ctrl_Ctr
Crew Quarters  $Crew_Quarters
Training Academy  $Training_Academy
Cathedral  $Cathedral
Chapel  $Chapel
Church  $Church
Temple  $Temple
Casino  $Casino
Civic Center  $Civic_Center
Port  $Port
Starport  $Starport
ATM  $ATM
Bank  $Bank
Library  $Library
Museum  $Museum
Hospital  $Hospital
Factory  $Factory
Recycling Plant  $Recycling_Plant
Dry Dock  $Dry_Dock
Chemi Prcs Fac  $Chemi_Prcs_Fac
Command Ctr  $Command_Ctr
Statue  $Statue
Semi-detached House  $SD_House
Anti-air Battery  $AA_Battery
Golan Laster Battery  $Golan_Battery
Atgar 1.4 FD P-Tower  $Atgar_Tower
KDY v-150 Planet Defender  $KDY_Defender
LNR I Series Turbo Laser Cannon  $LNR_I
LNR II Series Turbo Laser Cannon  $LNR_II
Shield Generator  $Shield_Generator
Prison  $Prison
Shield Projector  $Shield_Projector
Slave Market  $Slave_Market
SAM Launcher  $SAM_Launcher
Naval Shipyard  $Naval_Shipyard
Research Centre  $Research_Centre

Total Base ERM Price  $ERMTotal
Contract 1 Price  $Contract1
Contract 2 Price  $Contract2
Contract 3 Price  $Contract3
Contract 4 Price  $Contract4

Shown below is your total raw materials needed for this order.
Meleenium  $MelTotal
Rudic $RudicTotal
Duracrete  $DuraTotal
Varium  $VarTotal
Lommite $LomTotal
Ardanium  $ArdTotal
Quantum $QTotal
Tibanna_Gas  $TibTotal
BODY; 

mail ($email, 'Construction Contract', $body);

}  ?>

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Sat Apr 22, 2006 9:42 am
by feyd
I would guess that the heredoc is having issues. There is likely some extra spaces or something either before or after the end marker that may be screwing it up.

Posted: Sat Apr 22, 2006 10:14 am
by m0u53m4t
Ive had that a few times. I just rewrite the script and it goes away. Make sure you have no spaces at the ends as well.

Posted: Sat Apr 22, 2006 12:39 pm
by Christopher
As you have no quotes in the text maybe try this to find the errors:

Code: Select all

$body="
... all your text and vars
";