Jump to content

[SOLVED] problem with spaces


Canman2005

Recommended Posts

Hi all

 

I have a simple sql statement that pulls a list of files from a sql table, I then print the name of each filename using

print $rows[filename];

 

This works fine, unless a filename has a spae in it and then it reads everything up to the space.

 

For example, a filename which prints ok looks like

 

image1.jpg

 

but if there is a space for example

 

image 1.jpg

 

then it prints

 

image

 

and forgets everything after the space.

 

Is there a fix for this?

 

Thanks

 

Dave

Link to comment
Share on other sites

Hi

 

My code looks like

 

if ($rows[type] == 'application/pdf' || $rows[type] == 'text/plain')
	{
		print '<p style=margin-top:5px><strong><a href=file_uploads/'.$rows[filename].' target=_blank>View \ Download File</a></strong></p>';

	}

 

So if a filename has a space in it, then it ignore everything after the space

 

Does that help?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.