PDA

View Full Version : Redirecting when coming from a certain place



sharpleaf
10 Dec 2010, 11:02 PM
I have page A on my site that uses an iframe. The iframe source is from another .asp page B. This means that you can visit the src B of the iframe directly if you would like.

I would like to make it where if you visited B and you weren't passing in a particular ref variable, it would redirect you to A and put the page B in A's iframe.

To see what I'm doing, go to http://alexmsmith.com/songs_updated.asp?albumID=8 (http://alexmsmith.com/songs_updated.asp?albumID=8) and click on the song titles on the left to see the iframe on the right change it's source.
I want to add a facebook "like" to each of my songs. However, you can't like a "song" you can only like a page with type "song". The page for each song is what loads in the iframe. If someone were to like the song, it would show up on their facebook wall. The problem is that the wall link would link back directly to the page that's supposed to load in an iframe.

(the page that gets loaded into the iframe is songdetails.asp?songID=xxx)

So, what I'm trying to do is make it where if someone goes to songdetails.asp?songid=xxx&ref=facebook (that wold be the link I use for the facebook like button) it would automatically redirect to songs_updated.asp with songdetails.asp?songid=xxx in the iframe.

I'm having a hard time trying to type what it is I'm trying to ask so hopefully yo'll understand what I'm trying to ask.

Basically, if you go to a page from anywhere other than ?ref=home, redirect to another page. <-- how do you do that?

Thanks!
Alex