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
matthiasone
Forum Contributor
Posts: 117 Joined: Mon Jul 22, 2002 12:14 pm
Location: Texas, USA
Contact:
Post
by matthiasone » Tue Oct 12, 2004 8:05 am
twigletmac | Help us, help you. Please use 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>";
CoderGoblin
DevNet Resident
Posts: 1425 Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany
Post
by CoderGoblin » Tue Oct 12, 2004 8:26 am
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"'
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Tue Oct 12, 2004 8:29 am
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 » Tue Oct 12, 2004 8:32 am
$$temp? --> $temp
matthiasone
Forum Contributor
Posts: 117 Joined: Mon Jul 22, 2002 12:14 pm
Location: Texas, USA
Contact:
Post
by matthiasone » Tue Oct 12, 2004 8:34 am
I do believe CoderGoblin was correct.....thanks
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Tue Oct 12, 2004 8:35 am
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 » Tue Oct 12, 2004 8:38 am
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 » Tue Oct 12, 2004 8:43 am
-
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 » Tue Oct 12, 2004 8:47 am
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 » Tue Oct 12, 2004 8:50 am
ok, now I saw line 181, sorry.