PDA

View Full Version : Background Image Carousel and spaces in image_path



andre65
04-02-2013, 10:58 AM
Hi,

I've a question with spaces in Background Image Carousel.
url : http://www.dynamicdrive.com/dynamicindex14/bgcarousel.htm

It's working, but in the 'imagearray' image_path is not allowed to use spaces.
Is there a solution for this

imagearray: [
>> doesn't work <<
['autumnpark space.jpg', '<h2>Autumn Day</h2>The sun peaks through the trees, a knife that cuts through the chill, crisp air.'],

>> works <<
['autumnpark_space.jpg', '<h2>Autumn Day</h2>The sun peaks through the trees, a knife that cuts through the chill, crisp air.'],

Thanks in advance for the help

yours sincerely,
Andre

Beverleyh
04-02-2013, 11:32 AM
What if you use "%20" in place of all spaces? (URL encoding of ASCII characters: http://www.tutorialspoint.com/html/html_url_encoding.htm )

['autumnpark%20space.jpg', '<h2>Autumn Day</h2>The sun peaks through the trees, a knife that cuts through the chill, crisp air.'],

Instead of

['autumnpark space.jpg', '<h2>Autumn Day</h2>The sun peaks through the trees, a knife that cuts through the chill, crisp air.'],

andre65
04-02-2013, 01:41 PM
Sometimes things can be so simple. :confused:

Thank you Beverleyh

andre65
04-02-2013, 03:04 PM
update :

My photo's filenames are in a sql db.
This is how I build the array.

echo "['../image/".rawurlencode($row[name])."', '".$row[comment]."'], ";


Pretty cool for a newbie :-)