Forum Moderators: coopster

Message Too Old, No Replies

Parse error: parse error, unexpected T_VARIABLE

         

LadyBrighid

10:15 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



I just put up a Top Site List. When a member trys to look at the FAQ's or Vote, they see this error...

Parse error: parse error, unexpected T_VARIABLE in /home/autosurf/public_html/lang/l1/misc.php on line 1

Here is the first part of misc.php- What do I fix?

<?php$lang = array ('rate_1-5' => 'Please choose a rating between 1 and 5 for','rate' => 'Rate','site_information' => 'Site Information','info' => 'Information','email_user' => 'E-Mail this Site Owner','vote_for_site' => 'Vote for this Site!','not_allow_email' => 'Sorry, this user does not allow users to send e-mails to them.','email_user_intro' => 'Use the below form to e-mail this site owner. Just fill in the form, and when you are ready click \'Send\'','send' => 'Send!','your_email' => 'Your E-mail','your_name' => 'Your Name','to_name' => 'To Name','to_email' => 'To E-mail','your_message' => 'Your Message','name_short' => 'The name entered is to short, please try again.','message_short' => 'The message entered is to short, please try again','from' => 'From','email_sent' => 'Your e-mail has been sent successfully!','no_comments' => 'Sorry, this site has no comments submited.','comments' => 'Comments','submit_comments' => 'Submit Comments','comments_added' => 'Your comments have been added successfully',

jatar_k

10:28 pm on Nov 8, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld LadyBrighid,

my wild guess

<?php$lang

needs a space or hard return

<?php $lang
or
<?php
$lang

i think the hard return is better

LadyBrighid

10:52 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



Ok. I did that. But still get the error...

<?php

$lang = array (
'rate_1-5' => 'Please choose a rating between 1 and 5 for',
'rate' => 'Rate',
'site_information' => 'Site Information',
'info' => 'Information',
'email_user' => 'E-Mail this Site Owner',
'vote_for_site' => 'Vote for this Site!',
'not_allow_email' => 'Sorry, this user does not allow users to send e-mails to them.',

jatar_k

10:53 pm on Nov 8, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



that is a big array

I am assuming there is more to that line as it isn't finished

if you split them all up on seperate lines does it give you the error on the same line?

LadyBrighid

11:19 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



I get this error now...

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '(' in /home/autosurf/public_html/lang/l1/misc.php on line 2

<?php
$lang = array 'rate_1-5' => 'Please choose a rating between 1 and 5 for','rate' => 'Rate','site_information' => 'Site Information','info' => 'Information','email_user' => 'E-Mail this Site Owner','vote_for_site' => 'Vote for this Site!','not_allow_email' => 'Sorry, this user does not allow users to send e-mails to them.','email_user_intro' => 'Use the below form to e-mail this site owner. Just fill in the form, and when you are ready click \'Send\'','send' => 'Send!','your_email' => 'Your E-mail','your_name' => 'Your Name','to_name' => 'To Name','to_email' => 'To E-mail','your_message' => 'Your Message','name_short' => 'The name entered is to short, please try again.',

LadyBrighid

11:28 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



Got it to work finally. After staring at it for 10 minutes, I noticed the ( wasn't there. Now it works.

Thanks so much for your help.

I am REALLY glad I found this forum.. I am trying to teach myself.

jatar_k

11:30 pm on Nov 8, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



try formatting it this way and see where it tells you the error is

<?php
$lang = array 'rate_1-5' => 'Please choose a rating between 1 and 5 for',
'rate' => 'Rate',
'site_information' => 'Site Information',
'info' => 'Information',
'email_user' => 'E-Mail this Site Owner',
'vote_for_site' => 'Vote for this Site!',
'not_allow_email' => 'Sorry, this user does not allow users to send e-mails to them.',
'email_user_intro' => 'Use the below form to e-mail this site owner. Just fill in the form, and when you are ready click \'Send\'',
'send' => 'Send!',
'your_email' => 'Your E-mail',
'your_name' => 'Your Name',
'to_name' => 'To Name',
'to_email' => 'To E-mail',
'your_message' => 'Your Message',
'name_short' => 'The name entered is to short, please try again.',

jatar_k

11:31 pm on Nov 8, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



ah, wait

I think it may be the word array

array is a function so all of the elements must be within ()

$lang = array(all the stuff goes here);

it may just be the missing parentheses