0

I have seen some websites which ask for a valid email address and send dynamically created download link to the email address. The file will exist in the same location. How is it possible to have different dynamic urls to point to the same location?

I need to do a similar implementation using php. Please suggest.

Sangam254
  • 3,415
  • 11
  • 33
  • 43
  • are you referring to short urls? or a Url shortener? – ianace Jan 08 '13 at 07:03
  • No. Not short urls. I receive a email with download link www.example.com/download/1234556 . On click, I can download the data. Someone else receives the email with link www.example.com/download/2343443 . it still downloads the same data but url is different. – Sangam254 Jan 08 '13 at 08:37

2 Answers2

0

A dynamic url is one that includes datal while static are just links that access a page. Dynamic link: http://www.somesites.com/forums/thread.php?threadid=12345&sort=date because on the page thread.php

someone can use these these functions to load data into the main page thread.php
$myvar = $_GET['threadid']; //which is 12345
$myvar2 = $_GET['sort']; //which is 'date'

Static link:http://www.somesites.com/forums/the-challenges-of-dynamic-urls.htm This is static because there is no data stored in it; it is just used to point to a page.

For links pointing to the same page an example would be: index.php?var=5 and index.php "Both of these URLs point to two different pages. But if the search engine purges the information after the first offending character, the question mark (?), now both pages look the same "; so they are very similar; just the first one can submit data onto that page.

To learn more about static and dynamic links check out: http://www.webconfs.com/dynamic-urls-vs-static-urls-article-3.php

Devon Bernard
  • 2,250
  • 5
  • 19
  • 32
0

Generally speaking, they don't point to the same location. That would be a redirect and would cause the "real" URL (without any authentication protection on it) to be available to the client who could share it.

The server side code just picks the file off the file system and returns it directly (e.g. with readfile (don't forget to set the Content-Type header)).

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • Thank you for the reply. Can you please explain the logic. Where do I place the servers script? I did not understand how to implement this :The server side code just picks the file off the file system and returns it directly – Sangam254 Jan 08 '13 at 08:40