When we connect to our website we have the error since yesterday:

Parse error: syntax error, unexpected T_VARIABLE in /homez.534/planetinm/www/wp-content/themes/ut-gogreen/functions.php on line 301

Here is the line 301, could somebody tell me where is the syntax error?

<input type="text" id="col_<?php echo $i; ?>_title" name="col_<?php echo $i; ?>_title" style="width:350px;" value="<?php echo get_option('col_'$i'_title'); ?>" />

and I think we have also an error in line 307:

<textarea id="col_<?php echo $i; ?>_content" name="col_<?php echo $i; ?>_content" style="width:350px;"><?php echo get_option('col_'$i'_content'); ?></textarea>
share|improve this question
feedback

closed as not constructive by xdazz, rsplak, Dagon, Yan, bažmegakapa Aug 8 at 10:38

As it currently stands, this question is not a good fit for our Q&A; format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

2 Answers

Line 301:

value="<?php echo get_option('col_'$i'_title'); ?>"

Should be

value="<?php echo get_option('col_' . $i . '_title'); ?>"

You forgot the . operator, to concatenate string.

Same deal with 307:

<?php echo get_option('col_'$i'_content'); ?>

Should be

<?php echo get_option('col_' . $i . '_content'); ?>
share|improve this answer
Thanks a lot! amazing how fast you were guys!!! – user1584239 Aug 8 at 9:44
@user1584239 Please accept an answer when it solves your problem. – nkr Aug 8 at 9:45
@SiGanteng I have edited your post. Contact should be "" . $variable."" – KarmicDice Aug 8 at 10:02
@KarmicDice your edit isn't correct.. – SiGanteng Aug 8 at 10:03
@SiGanteng Ok. I didn't try it though ;) My mates agreed with me but, we are bit lazy to try it out. Hope, you did :) – KarmicDice Aug 8 at 12:27
show 1 more comment
feedback

You error is here:

<?php echo get_option('col_'. $i. '_title'); ?>

You forgot to concatenate the strings with $i.

share|improve this answer
feedback

Not the answer you're looking for? Browse other questions tagged or ask your own question.