Markie
Posts: 251
|
| Posted: 10/14/2008, 12:18 PM |
|
I'm building a professional photo gallery. Users of the gallery can send an e-mail with a link to a specific photo. The recipient of the mail can download the photo, just by clicking the link. At the moment, the link to the photo is something like this:
http://www.mysite.com/photos/photo1.jpg
This is too obvious, the recipient of the mail can see where the photos are stored. I want to 'anonymize' the link, for example:
http://www.mysite.com?photo=5MeRlZATc2M
Is this possible ? Can somebody push me into the right direction ?
Markie
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL |
 |
 |
Gena
Posts: 591
|
| Posted: 10/14/2008, 12:35 PM |
|
sure you can.
For example, look here http://www.motleysoft.com/ProductDetail.php?ProductID=86
at the botton you can find a link like Download Trial/Demo and it shows as http://www.motleysoft.com/trackdemo.php?pid=86
so this php script makes 2 things:
1. track downloads
2. opens real URL to download file
it really simple file with code like
<?php
define("RelativePath", ".");
define("PathToCurrentPage", "/");
define("FileName", "trackdemo.php");
include(RelativePath . "/Common.php");
$pid=CCGetParam("pid","");
$db = new clsDB();
$SQL = "select ProductDemoURL where ProductID=" . $pid ;
$db->query($SQL);
$db->next_record();
$URL = $db->f("ProductDemoURL");
if ($URL!="") {
$SQL = "UPDATE Products SET ProductDemoDownloads=ProductDemoDownloads+1 where ProductID=" . $pid ;
$db->query($SQL);
$db->close();
header("Location: $URL");
exit;
} else {
$db->close();
exit;
}
?>
i hope this help
_________________
Gena |
 |
 |
melvyn
Posts: 333
|
| Posted: 10/14/2008, 12:44 PM |
|
that work if you want to download it. To show a picture, you can't hide the url. Any ways, if you hide it, when the user right-click the picter and ask for properties, will see the picture's real url.
the best you can do in this way is using mod_rewrite with your apache.
Some php work around will work too.
_________________
Melvyn Perez
Puro Codigo
http://purocodigo.com |
 |
 |
Gena
Posts: 591
|
| Posted: 10/14/2008, 2:43 PM |
|
Quote melvyn:
that work if you want to download it. To show a picture, you can't hide the url. Any ways, if you hide it, when the user right-click the picter and ask for properties, will see the picture's real url.
no, the request was: Quote :Users of the gallery can send an e-mail with a link to a specific photo. The recipient of the mail can download the photo, just by clicking the link.
so using my suggestion it should solve his problem.
_________________
Gena |
 |
 |
Markie
Posts: 251
|
| Posted: 10/15/2008, 12:25 AM |
|
Gena's right ! I'll try this solution.
Thanks to both of you.
Markie
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL |
 |
 |
Markie
Posts: 251
|
| Posted: 10/15/2008, 7:26 AM |
|
Okay, today I did some coding and it seems mod_rewrite is the most easy solution to my problem. I did add my solution to the tips department of this forum:
http://forums.yessoftware.com/posts.php?post_id=101099
good luck,
Markie
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 11/06/2008, 8:30 AM |
|
There is a much easier way to do this that mod rewrites and other stuff.
Here is an example using just what Markie was looking for.
http://realtest.biz/viewconversion.php
This is for video and allows both download and display. It will serve up all other media as well including photos and audio. Note. It just takes a parameter for the item to serve up as Markie was trying to do.
If you would like more info, Let me know
Have Fun
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
Markie
Posts: 251
|
| Posted: 11/06/2008, 8:56 AM |
|
Thanks John, I've send you a PM
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 11/06/2008, 9:05 AM |
|
Hi Markie
I actually have created this solution as a set of CCS pages and put it up on CCSElite for access.
http://ccselite.com/online_store.php?pid=5
I think I have seen you there as a member.
Let me know if I can help you with this any further.
Take Care
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
|