why is there an error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bubs
Forum Newbie
Posts: 11
Joined: Wed Aug 16, 2006 12:19 pm

why is there an error

Post by bubs »

why is this giving me an error when I try to view go to it. at first I thought it was the double quotes so I change most of them to singles. then it said that the & in   was giving an error. but I just want to sent this in an e-mail from a form. it SEEMS to be set up right but me beeing a noob I could very well have something wrong.

Code: Select all

$message = "

<html>
<head>
<title>Untitled Document</title>
</head>

<body>
<table border='1'>
  <tr>
    <td>Today's date:</td>
    <td>".$date."</td>
  </tr>
  <tr>
    <td>Event Name:</td>
    <td> ".$Ename."</td>
  </tr>
  <tr>
    <td>Host Organization:</td>
    <td>".$Horg."</td>
  </tr>
  <tr>
    <td>Meet Director:</td>
    <td>".$Mdir."</td>
  </tr>
  <tr>
    <td>Address:</td>
    <td>".$addr."</td>
  </tr>
  <tr>
    <td>line2:</td>
    <td>".$line2."</td>
  </tr>
  <tr>
    <td>City:</td>
    <td> ".$city."</td>
  </tr>
  <tr>
    <td>State:</td>
    <td>".$state."</td>
  </tr>
  <tr>
    <td>Zip:</td>
    <td>".$zip."</td>
  </tr>
  <tr>
    <td>Fax:</td>
    <td>".$fax."</td>
  </tr>
  <tr>
    <td>Home Phone:</td>
    <td>".$Hphone."</td>
  </tr>
  <tr>
    <td>Work Phone:</td>
    <td>".$Wphone."</td>
  </tr>
  <td>E-mail:</td>
    <td>".$email."</td>
  </tr>
</table>
<p>&nbsp;</p>
<p>[".$Tfinal."] Timed Final &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [".$Pfinal."] 
  Prelim/Final</p>
<p>&nbsp;</p>
<table width='75%' border='1'>
  <tr> 
    <td rowspan='2'>Date</td>
    <td colspan='4'>Timed Final Session #1 or Prelims</td>
    <td colspan='3'>Timed Final session #2 or Finals</td>
  </tr>
  <tr> 
    <td>Entry</td>
    <td>Warm up</td>
    <td>Start</td>
    <td>Finish</td>
    <td>Warm up</td>
    <td>Start</td>
    <td>Finish</td>
  </tr>
  <tr> 
    <td>".$date1."</td>
    <td>".$entry1."</td>
    <td>".$wu1."</td>
    <td>".$start1."</td>
    <td>".$fin1."</td>
    <td>".$fwu1."</td>
    <td>".$fstart1."</td>
    <td>".$Ffin1."</td>
  </tr>
  <tr> 
    <td>".$date2."</td>
    <td>".$entry2."</td>
    <td>".$wu2."</td>
    <td>".$start2."</td>
    <td>".$fin2."</td>
    <td>".$fwu2."</td>
    <td>".$fstart2."</td>
    <td>".$Ffin2."</td>
  </tr>
  <tr> 
    <td>".$date3."</td>
    <td>".$entry3."</td>
    <td>".$wu3."</td>
    <td>".$start3."</td>
    <td>".$fin3."</td>
    <td>".$fwu3."</td>
    <td>".$fstart3."</td>
    <td>".$Ffin3."</td>
  </tr>
  <tr> 
    <td>".$date4."</td>
    <td>".$entry4."</td>
    <td>".$wu4."</td>
    <td>".$start4."</td>
    <td>".$fin4."</td>
    <td>".$fwu4."</td>
    <td>".$fstart4."</td>
    <td>".$Ffin4."</td>
  </tr>
  <tr> 
    <td>".$date5."</td>
    <td>".$entry5."</td>
    <td>".$wu5."</td>
    <td>".$start5."</td>
    <td>".$fin5."</td>
    <td>".$fwu5."</td>
    <td>".$fstart5."</td>
    <td>".$Ffin5."</td>
  </tr>
  <tr> 
    <td>".$date6."</td>
    <td>".$entry6."</td>
    <td>".$wu6."</td>
    <td>".$start6."</td>
    <td>".$fin6."</td>
    <td>".$fwu6."</td>
    <td>".$fstart6."</td>
    <td>".$Ffin6."</td>
  </tr>
</table>
<p>[".$comp."] Competition Pool</p>
<p>&nbsp; &nbsp; &nbsp; [".$lc."] Long Course &nbsp; [".$sc."] 
  Short Course &nbsp; # of lanes: ".$#lanes." <br />
 
  ".$YM."</p>
</body>
</html>
 ";
the error code is indint.com/forms/form.php
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: why is there an error

Post by Luke »

Code: Select all

Short Course &nbsp; # of lanes: ".$#lanes." <br />
Is this line 152?
bubs
Forum Newbie
Posts: 11
Joined: Wed Aug 16, 2006 12:19 pm

Post by bubs »

no this is

Code: Select all

".$YM."</p>
bubs
Forum Newbie
Posts: 11
Joined: Wed Aug 16, 2006 12:19 pm

Post by bubs »

this is the error it give me
Parse error: syntax error, unexpected '"', expecting T_VARIABLE or '$' in /home/indihow8/public_html/forms/form.php on line 152
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

why do you have the # in $#lanes?
bubs
Forum Newbie
Posts: 11
Joined: Wed Aug 16, 2006 12:19 pm

Post by bubs »

that fixed it I took out the #

it was just what I named it in the form. so I need to be more carefull when naming things
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

yes... for reference:
http://fr3.php.net/manual/en/language.variables.php
the manual wrote:"Variable names follow the same rules as other labels in PHP. A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'"
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

bubs wrote:that fixed it I took out the #

it was just what I named it in the form. so I need to be more carefull when naming things
Are your vars created assuming register_globals = On? That is a dangerous proposition if so.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

bubs wrote:no this is

Code: Select all

".$YM."</p>
Obviously not because that wasn't where the error was. Make sure you are looking at the line numbers in the PHP code not the HTML output.
Post Reply