anoying problem with spaces.....`

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

anoying problem with spaces.....`

Post by dull1554 »

i have written a picture gallery but if the image has a space in the file name, it does not display, i was wondering how i can fix this.
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

never ever ever never..never have spaces in your file names, unix/linux doest like it.

here is something you can try...its a little tricky though...rename all the files which have spaces in the names :lol: :lol: :lol:

sorry, dont mean to be rude :P
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

enclose src attribute value in quotes:
instead of

Code: Select all

<img src=some picture.jpg>
use:

Code: Select all

<img src='some picture.jpg'>
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

thankyou weirdan, i would have never thought of something so simple,i was about to write a script to change all spaces to dashes to fix my problem, but this was much easier, and qads, see whenever i upload a file i make sure there are no spaces b/c i no that many systems do not like spaces, but the script i've been working on is for someone elses website, and they may upload files with spaces, but thanks for the suggestion
Post Reply