[SOLVED] Syntax Woes

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
matthiasone
Forum Contributor
Posts: 117
Joined: Mon Jul 22, 2002 12:14 pm
Location: Texas, USA
Contact:

[SOLVED] Syntax Woes

Post 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>";
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post 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"'
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

CoderGoblin got it - the missing concenation is the issue.

Mac
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post by djot »

$$temp? --> $temp
matthiasone
Forum Contributor
Posts: 117
Joined: Mon Jul 22, 2002 12:14 pm
Location: Texas, USA
Contact:

Post by matthiasone »

I do believe CoderGoblin was correct.....thanks
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

djot wrote:$$temp? --> $temp
Probably using variable variables...

Mac
matthiasone
Forum Contributor
Posts: 117
Joined: Mon Jul 22, 2002 12:14 pm
Location: Texas, USA
Contact:

Post by matthiasone »

Yes I am using variable variables which I do on line 179
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post by djot »

-

Hi,

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

djot
-
matthiasone
Forum Contributor
Posts: 117
Joined: Mon Jul 22, 2002 12:14 pm
Location: Texas, USA
Contact:

Post 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
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post by djot »

ok, now I saw line 181, sorry.
Post Reply