Not Solved Parse error: syntax error, unexpected 'foreach' (T_FOREACH)
#1
Not Solved
Parse error: syntax error, unexpected 'foreach' (T_FOREACH), expecting ')' in /.../inc/plugins/imageslider.php on line 45 in Image slider plugin.
.php   imageslider.php (Size: 1.85 KB / Downloads: 55)
Reply
#2
Not Solved
Your script lacks a ; line 43, after the ).
The error is self explanitory
Tchat en français
Do not ask me help through PM or Discord

Reply
#3
Not Solved
(2022-10-31, 10:58 AM)Crazycat Wrote: Your script lacks a ; line 43, after the ).
The error is self explanitory
It didn't help. Now the error is:
Parse error: syntax error, unexpected ';', expecting ')' in /var/www/promo/data/www/77vk.ru/inc/plugins/imageslider.php on line 43
Reply
#4
Not Solved
This:

$setting_array = array(
		// A text setting
		'fav_colour' => array(
		'title' => 'Favorite Colour',
		'description' => 'Enter your favorite colour:',
		'optionscode' => 'text',
		'value' => 'Blue', // Default
		'disporder' => 1
)

Should be this:

$setting_array = array(
		// A text setting
		'fav_colour' => array(
		'title' => 'Favorite Colour',
		'description' => 'Enter your favorite colour:',
		'optionscode' => 'text',
		'value' => 'Blue', // Default
		'disporder' => 1
));

You were missing a closing ) on the array and the ;
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.
Reply
#5
Not Solved
Oh I didn't notice the lacking parenthesis. Badly indented code doesn't help.
Tchat en français
Do not ask me help through PM or Discord

Reply
#6
Not Solved
(2022-10-31, 12:37 PM)Matt Wrote: This:

$setting_array = array(
		// A text setting
		'fav_colour' => array(
		'title' => 'Favorite Colour',
		'description' => 'Enter your favorite colour:',
		'optionscode' => 'text',
		'value' => 'Blue', // Default
		'disporder' => 1
)

Should be this:

$setting_array = array(
		// A text setting
		'fav_colour' => array(
		'title' => 'Favorite Colour',
		'description' => 'Enter your favorite colour:',
		'optionscode' => 'text',
		'value' => 'Blue', // Default
		'disporder' => 1
));

You were missing a closing ) on the array and the ;

Thank you! But now there is other error:
Parse error: syntax error, unexpected '=', expecting ']' in /inc/plugins/imageslider.php on line 76
Reply
#7
Not Solved
This:

$post['message' = '<strong>Hello</strong';

Should be:

$post['message'] = '<strong>Hello</strong>';

I've also corrected the missing > in the closing strong tag there.

I would suggest learning more about PHP if you need help diagnosing these issues, as they're fairly clear messages with obvious errors in the code.
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.
Reply
#8
Not Solved
Oh, and I didn't notice the missing > in the closing strong tag. Now everything is working. Thank you more for your help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)