You are here: Re: Help with script « PHP Programming Language « IT news, forums, messages
Re: Help with script

Posted by Oli Filth on 09/15/05 19:05

Mark said the following on 15/09/2005 16:55:
> Can someone please help me with the below script? I think it's nearly
> correct but there's just something not quite right which won't let it
> run.
>


Why don't you just turn error reporting on, and it will tell you about
syntax errors.

You are missing the closing scope bracket "}" for each nested switch
statement.
>
> Mark
>
> ________________________________________________________________
>
> switch (article_get_field('style')) {
> case 'Short':
> switch (article_get_field('size')) {
> case 'M':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC11M');
> break;
> case 'L':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC11L');
> break;
> case 'XL':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC11XL');
> break;
> case 'XXL':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC11XXL');
> break;
}
> break;
> case 'Medium':
> switch (article_get_field('size')) {
> case 'M':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC10M');
> break;
> case 'L':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC10L');
> break;
> case 'XL':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC10XL');
> break;
> case 'XXL':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC10XXL');
> break;
}
> break;
> case 'Long':
> switch (article_get_field('size')) {
> case 'M':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC1M');
> break;
> case 'L':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC1L');
> break;
> case 'XL':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC1XL');
> break;
> case 'XXL':
> article_set_field('price', 0.00);
> article_set_field('item_number', 'HC1XXL');
> break;
}
> break;
> }
>


--
Oli

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация