Page 1 of 1

[SOLVED] Syntax Woes

Posted: Tue Oct 12, 2004 8:05 am
by matthiasone
twigletmac | Help us, help you. Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

I am getting "Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /usr/wwws/users/faog/staffpages/sp_label_maker.php on line 181" error.

the line being pointed at is the if statement.

Code: Select all

$fsize = "<select name='fsize'><option>12</option>";
  for($j=8; $j <= 29; $j++)
  {
    $fsize .= "<option>".$j."</option>";
  }
  $fsize .= "</select>";
  	
  $body = "<tr>\n";
  for($i=1; $i <= 5; $i++)
  {
    $temp = "form_varsї'title".$i."']";
	if($$temp != '')
	  $body .= "<td colspan='3'>Line ".$i.": <input type='text' name='title".$i"' value='".$$temp."'></td>\n</tr>\n<tr>\n".
	  		   "<td>Font: <select name='font'><option>Times</option><option>Arial</option>".
			   "<option>Courier</option>\n</select></td>\n<td>Size: ".$fsize."</td>\n".
	  		   "<td>Weight: <select name='weight' MULTIPLE><option value=''>Normal</option><option value='B'>Bold</option>".
			   "<option value='I'>Italic</option><option value='U'>Underlined</option></td>\n".
	  		   "<td>Alignment: <select name='align'><option value='C'>Center</option><option value='L'>Left</option>".
			   "<option value='R'>Right</option>\n</select>";
  }
  $body .="</tr>";

Posted: Tue Oct 12, 2004 8:26 am
by CoderGoblin
Dont know about the if line. on the next line you are missing a period/full stop after the second $i

Code: Select all

$body .= "<td colspan='3'>Line ".$i.": <input type='text' name='title".$i"'

Posted: Tue Oct 12, 2004 8:29 am
by twigletmac
CoderGoblin got it - the missing concenation is the issue.

Mac

Posted: Tue Oct 12, 2004 8:32 am
by djot
$$temp? --> $temp

Posted: Tue Oct 12, 2004 8:34 am
by matthiasone
I do believe CoderGoblin was correct.....thanks

Posted: Tue Oct 12, 2004 8:35 am
by twigletmac
djot wrote:$$temp? --> $temp
Probably using variable variables...

Mac

Posted: Tue Oct 12, 2004 8:38 am
by matthiasone
Yes I am using variable variables which I do on line 179

Posted: Tue Oct 12, 2004 8:43 am
by djot
-

Hi,

A reference on a temp variable, set and used only one line 179+180?
Why? I don't get it.

djot
-

Posted: Tue Oct 12, 2004 8:47 am
by matthiasone
What don't you get?
I had 5 form field named title1...title5
I wanted to check through them with a For loop
so I used variable variables

Posted: Tue Oct 12, 2004 8:50 am
by djot
ok, now I saw line 181, sorry.