Hi everyone,
I'm having trouble with some code syntax.
In addition to any categories and colours listed in my menus, there are two other possible values that might be selected: 'choose' which is the default and may have remained selected, and 'other' if a particular category or colour is yet to be entered into the database. The following code is supposed to remove the first value from the subarrays:
// if "Select category(s)" and "Select colour(s) still selected, remove from the array
if ($_POST['category'][0] == 'choose' || $_POST['colour'][0] == 'choose')
array_shift(
$_POST['category'];
$_POST['colour'];
)
The problem is that it gives an error saying:
Parse error: syntax error, unexpected ';' in /Applications/MAMP/htdocs/newsite/admin/insertNewGarment.php on line 95
Line 95 is this line:
$_POST['category'];
Also, to find out if 'other' has been chosen I used the the following code, but I'm pretty sure the syntax is again incorrect:
if (in_array('other',$_POST['category'] and $_POST['colour'])) {
$i = array_search('other', $_POST['category'] AND $_POST['colour']);
$_POST['category'][$i] = 0 AND $_POST['colour'][$i] = 0;
}
Would someone be able to help me fix the above syntax problems?
Appreciate any help offered.