What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » php and mysql help md5 hash...

php and mysql help md5 hash...
Author: Message:
stonesour
Full Member
***

Avatar
Posts: 901231

Posts: 205
36 / Male / –
Joined: Nov 2003
O.P. php and mysql help md5 hash...
What i'm trying to do, is for my forum hide the name of a file, so I want to md5 hash the filename on upload, and insert it into say ibf_md5image

in the table ibf_md5image, it would have a column for the md5 hash, and the original filename. So then in my forum, I would link the image to the md5 hash. My question is in my script watermark.php I want to hide the filename, so people can't remove the watermark by simply going to the original.

SO currently when I click an uploaded image on my board it goes to http://mysite.net/forums/uploads/watermark.php?na...ome-image-name.jpg

I want it to go to
http://mysite.net/forums/uploads/watermark.php?name=md5hashedname.jpg

So, because the the md5 hash of the filename isn't the exact filename, what I want to do is have my watermark.php show the image, and figure out the filename using some sql. But i'm not sure how I would word the statement.

select real_name from ibf_md5image where hash_name = $variable

now somehow, it would have to get the md5 hash name from the url, so the link on the board to the image would have to pass the md5 hashed filename to the variable.


Is this possible?
06-07-2004 11:12 PM
Profile E-Mail PM Web Find Quote Report
Hah
Full Member
***

Avatar
Im in a good mood - take advantage!

Posts: 224
37 / Male / –
Joined: May 2003
RE: php and mysql help md5 hash...
Sure is....you need WDZ or some other MySQL/PHP expert for the ins and outs though.

Im guessing that in the filename on the board, the md5 sum will include the .jpg, so the user wont even know its a jpeg. You could include the content type in the mysql table as well if you wanted to use the function out side of the watermark.php function e.g. for a download script to keep track of downloads etc.

I can't tell you much (coz i dont know and im not going to pretend) but I can tell you that it certainly is possible.

Tah,

Hah
This post was brought to you by Hah!
(and he takes no responsibility for it :p)

[Image: signatures.jpg]

{Current Web Site}
06-07-2004 11:18 PM
Profile E-Mail PM Web Find Quote Report
fluffy_lobster
Veteran Member
*****

Avatar
Posts: -2

Posts: 1391
Reputation: 23
36 / Male / Flag
Joined: Nov 2002
RE: php and mysql help md5 hash...
If I get your question right, you need to use either $_GET['name'] or if you're sure there are no other variables called name and your server supports it, just $name

Don't forget to put quotes in the query.  Your query will then be something like:

"SELECT real_name FROM ibs_md5image WHERE hash_name = '$_GET[name]'"

That help?
06-08-2004 11:16 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On