Welcome Guest, Not a member yet? Register   Sign In
Have user id as part of file name
#4

I would set a code for the user, a code for the filename, and a code for the post.

Code:
www.site.co.uk/post/view/dlfhgldhfglsdfgwe
www.site.co.uk/user/view/kfdhgjkhdfkghkd
www.site.co.uk/file/view/dsfgkjhdsfgkhs

The file name would be named as a code too:

Code:
sdgdsggfsdfgdg.jpg

and with a secure code for all these, linked in tables, you would lookup the file code to get the file name etc. etc. No need for post_1 or post_2 etc.

I would not use a database id in any url, file or js code structure. Database ID's are for database and internal code use, not public use or display.

In fact, I no longer really use codes. I set pretty urls for all of these things in whatever way is appropriate. Such as creating it from a name, or specifically ask for user input, or merge a category name with a post name etc. Whatever is right for the situation.
Code:
So definitely not this:
www.mysite.co.uk/product/view/147

I used to do this:
www.mysite.co.uk/product/view/sdfghdksfjghklsdhfg

Now I would do this:
www.mysite.co.uk/product/view/baltic-style-brick-and-mortar-paint
Same would apply for your filenames too.
Reply


Messages In This Thread
RE: Have user id as part of file name - by PaulD - 02-12-2017, 10:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB