vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Why am I getting this error... (https://vborg.vbsupport.ru/showthread.php?t=54999)

Dark_Wizard 07-04-2003 11:01 AM

Why am I getting this error...
 
It's only on some sites and it's driving me nuts...

The error is:
Parse error: parse error, expecting `']'' in /home/heroclan/public_html/forums/vchallenge.php(172) : eval()'d code on line 303


and here is the offending line in the template:
<option value="12:00" $wartimeselected[12:00]>12:00</option>

and the PHP code:
PHP Code:

if(isset($HTTP_POST_VARS["wartime"])) $wartimeselected[$HTTP_POST_VARS["wartime"]]="selected"

It doesn't like this [12:00] anyone know why?

noppid 07-04-2003 01:10 PM

My guess is it don't like the : in the array element name.

Dark_Wizard 07-04-2003 01:16 PM

Quote:

Today at 10:10 AM noppid said this in Post #2
My guess is it don't like the : in the array element name.

But why only certain sites? All are using PHP 4.2.3...

noppid 07-04-2003 01:28 PM

I have no idea.

I tried the : in php Expert editor. The colon causes a syntax error.
Lose the : in the element array names.

Dark_Wizard 07-04-2003 01:40 PM

Quote:

Today at 10:28 AM noppid said this in Post #4
I have no idea.

I tried the : in php Expert editor. The colon causes a syntax error.
Lose the : in the element array names.

Then I would have to do seperate months and days in the dropdown and then implode it...

Dean C 07-04-2003 02:34 PM

PHP Code:

if( isset( $HTTP_POST_VARS['wartime'] ) )
{
 
$wartimeselected["$HTTP_POST_VARS['wartime']"]="selected";


Try that ^^

If the extra double quotes don't work try single quotes. I think it's double quotes though on keys with variables in :)

- miSt

Dark_Wizard 07-04-2003 07:42 PM

Quote:

Today at 11:34 AM Mist said this in Post #6
PHP Code:

if( isset( $HTTP_POST_VARS['wartime'] ) )
{
 
$wartimeselected["$HTTP_POST_VARS['wartime']"]="selected";


Try that ^^

If the extra double quotes don't work try single quotes. I think it's double quotes though on keys with variables in :)

- miSt

Tired it and it doesn't work get a "unexpected T_Variable"...whats funny is that in the admin piece it works fine...


All times are GMT. The time now is 11:18 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00966 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete