hiding parsed data in URL
- Started
- Last post
- 21 Responses
- JamesEngage
I've recently just done a site...where by people can send links to other people and it shortcuts to the article... e.g. http://www.the-mill.com/article.…
(thats me by the way! :) )trouble is because the page doesn't refresh it stays on that URL... people can use the email this article and it will send it correctly... trouble is a few people (and I don't blame them) are cutting and pasting the URL from the address bar... and thus sending the page from where they came in... not the page they intended... any clues on the best way around this?
- those0
that's you in the t-shirt..?
that's a very special t-shirt...
- UndoUndo0
could you not use sessionID to store the variables rather than pass them through the URL?
- rasko40
dude... you are wearing a 'Lassie' t-shirt
- JamesEngage0
very perseptive.
- JamesEngage0
I need to be able to put an id in an email though?
- UndoUndo0
if you establish your sessionID's to be persistant for long enough [ you can establish how long the session will last]
you might be able to pass the id in the email and have the user return via the link you sent to the correct page setup.take a look at register_session() in php.
- UndoUndo0
or create a unique id for each user, store the vriables against that id in a table row. when the user sends the email , pass the id as a variable.
when the recipient of the email clicks the link check for the id and retieve the variables!
if you want the link to work only once then delete the row when the query is completed.
- unfittoprint0
why is it a problem cutting/pasting that url to fetch the article later?
As long php detects that the article variable is set, writes it within the embed flash object and flash itself detects it on _root, it shouldn't be a problem for it to go to the desired section...
- rabattski0
yeah dito unfit, since sometimes you just want to send a direct link and not the site and instructions as in you have to explain, click here, go there, look for ..., click there etc.
- fugged0
try using named anchors rather than a querystring.
you can update the browser url, without refreshing the page by calling a javascript function with getURL. pass the anchor name to the javascript as an arg and set the page's location. with location.href=[anchor name]
just have your php page parse the url, look for the anchor, and then if it's present, pass that to flash in the url to the swf.
of course I haven't actually tried this, but I think it will work (?)
- JamesEngage0
I've tried anchors for something else I was doing... but on safari on a mac it was refreshin gthe page each time which was annoying...
- JamesEngage0
and apologies for not wearing a skate t-shirt, or one with some helvetica on it
- JamesEngage0
why is it a problem cutting/pasting that url to fetch the article later?
it is because flash is reading in the article.. and then when the user goes to another article in the flash movie... the url does not change... and people see the id at the end of the url... and think it relates to the current article on screen, when it doesn't ...
confusng unless you try it I guess
- fugged0
>> but on safari on a mac it was refreshin gthe page
you could do a browser check and disable for that case. how many people are really using that browser? heh.
there's gotta be a way... im not gonna get any work done now... thanks =)
- unfittoprint0
got it, got it...
here's a dirty way....
you could pop up your site [i know, i know] without an adress bar make your own flash adress bar, and refreshing the url in it...
- rabattski0
hold on, do you load new swf's each time the id changes? if so you can just call it with adding ?id=xx after the embedded .swf and not thru the url.
- JamesEngage0
don't wanna be doing that... I think there is a .htaccess way of just not showing the whole URL which is a better way of doing it... then 'most' people will know not to cut and paste it... if it justsays www.the-mill.com
- unfittoprint0
yeah it's called RewriteEngine...
- DonnieTV0
You could try having an intermediate page James. i.e. have an index page that takes the id for the page and passes it on to the page with the flash movie using POST so it's not in the url.