0

I have come across this thing where facebook pages say

Comment your name in the URL to reveal such & such thing about yourself

Like for example https://www.downloadanysong.com/william https://www.downloadanysong.com/john this apparently tells you what song you should be listening.

How do they do this?

Hanan Ur Rehman
  • 123
  • 1
  • 1
  • 8

2 Answers2

0

it depends on what technology their using in JavaScript you can the url with window.location.href and then they could just split it after the last / to find the name you typed in. And index an object full of songs to find which one goes with that name. Otherwise, if their doing it on the server side, it's completely dependent on the language their using.

IanS5
  • 94
  • 3
0

this can be done using MVC or Model View Controller, Where the URL is analyzed please note that this is not possible using htacess rewrite conditions.

a good reference to start is the below How does an MVC system work?

jdoe1991
  • 17
  • 7