Click to See Complete Forum and Search --> : creating a link from an input


bounder
11-13-2003, 10:23 AM
is it possible?

let me explain...

I'm in the process of making a flash christmas card, where you can alter the from bit by adding your name to the url of the swf. eg..

xmas.sf?t=Jon

which all works fine.

I can understand this and easily alter the links in an email i send - but the thing won't be as straight forward for most people.

so what i was goign to do was have a link to a html page that people copy and paste the link from, generating the url in flash and passign it to the page in the address in the same way...

send.html?from=Jon

but i can't work out how to produce the link in the page. i've seen javascript soluntions that can display variables from the address bar on the page - but to generate the link?

is it possible - or am i barking up the wrong tree?

thanks for any help you coudl give us

pyro
11-13-2003, 12:10 PM
You'd be much better off using a server-side language to do this, as 13% of user do not have JavaScript enabled. But, here's one way to do it:

<script type="text/javascript">
name = window.location.search.substr(6); //get the name off the query string (page.htm?name=foo)
document.write("<a href=\"xmas.swf?t="+name+"\">link</a>");
</script>

bounder
11-13-2003, 12:28 PM
thanks for your help. you're right, i'd love to have done it in php (or even cf) - but the host i've got hasn't got any of that...

and since it's work, it wasn't my choice...

i'll try it..