Closed Thread Icon

Topic awaiting preservation: mysql ignors slashes in file path? Pages that link to <a href="https://ozoneasylum.com/backlink?for=12530" title="Pages that link to Topic awaiting preservation: mysql ignors slashes in file path?" rel="nofollow" >Topic awaiting preservation: mysql ignors slashes in file path?\

 
Author Thread
Gee
Bipolar (III) Inmate

From: London, UK
Insane since: Nov 2002

posted posted 11-27-2002 10:31

Hello again,

Well I've been getting on with my coding and whilst it may not be the most tidy, neat or effective code - it is working so far. (and so I am learning at the same time)

Ok, I wanna store file paths in a field in mysql called filePath. I managed to insert the paths into the field but mysql refuses to display the \..\..\..\ (slashes!) in the path?

I know the slashes are included in my variables (called $filePath) cause I use echo to output them to screen.

code:
$filePath = "C:\\FoxServ\\www\\lectures\\".$_FILES['yourFile']['name'];



Anybody got any ideas?

Is there a special declaration to use to get a filepath with filename in PHP or to display slashes in mysql?

Gee

___________________________________________________________
Its the burden of time I have trouble with... the learning is the fun part !


Rooster
Bipolar (III) Inmate

From: the uterus
Insane since: Nov 2002

posted posted 11-27-2002 10:55

*

[This message has been edited by Rooster (edited 11-27-2002).]

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 11-27-2002 13:08

now, rooster, that is not terrible helpful, especially since some of us are not keen on advertising around here.

What I'd suggest, Gee, is that you make sure that the slashes in your string are masked probably by doing
$string = addslashs($string);
before inserting them into mysql.
That should help (oh and do the stripslashes() thing when you get them ;-).

So long,

Tyberius Prime

Gee
Bipolar (III) Inmate

From: London, UK
Insane since: Nov 2002

posted posted 11-27-2002 17:08

Hey Rooster,

It seems Tyberius is correct. Not only did you create a book recommendation thread - and now this... you are obviously only interested in selling your book.

If you had read the thread you started on the book recommendation, you would realise that I have already bought it.

Sometimes it is nice to ask questions on topics you are unsure of - isnt that what forums are for... sharing information?

Ps. Your book may be good and hold lots of information - but the coding stinks, it is outdataed and needs a new edition if you ask me. Hence one of the reasons I have to ask questions on forum!!!!!!!!!!!!!!!!!

PS. thnX Tyberious - I will now try this method.

GEE

Rooster
Bipolar (III) Inmate

From: the uterus
Insane since: Nov 2002

posted posted 11-27-2002 19:36

Yeah, I guess your right.

Sorry.


And I did read the thread I started I just didn?t connect the two before replying here. I just thought somebody could use a book. I don?t go to school for this and all I?ve ever had is books, they?re powerful tools.

The first thing I thought is how many times I?ve read the word, ?AddSlasheds? in the past week. But I?m a little insecure sometimes so I wasn?t really sure if that was the function you wanted. So instead, I tried to give the best advice I could. I mean I too just bought it.

I?ll just not type anything next time.

Sorry again for being such a dick.


..
~Existence is a mere pattern.~

Gee
Bipolar (III) Inmate

From: London, UK
Insane since: Nov 2002

posted posted 11-27-2002 21:29

Apology Accepted.

But dont 'not' post anything, one thing Ive learned is that sometimes people can point you in the right direction even if they are not entirely certain of something.

Ok - I should study from my book more - but I am doing all this 'on the fly',

I did look up filepaths(not referenced), '/',& '\' symbols in the index but they didnt answer my question. So I posted.

When Tyberius mentioned addslashes(), I looked this up and read up on it.

I use most of my books as reference a lot of the time cause it just takes to god damn long to get through them. I like to learn as I go along.

I think Ive flogged this topic for long enough anyway.

Until my next post (which will be soon!)

Gee.

___________________________________________________________
Its the burden of time I have trouble with... the learning is the fun part !


« BackwardsOnwards »

Show Forum Drop Down Menu