PDA

View Full Version : (web) Cookie Making...



spilla
7th August 2005, 10:35 PM
Okay, heres my situation....I'm making a website which has 4 language translations...when you first go into the site there is a flash animation where you choose your langauge, then that takes you to a normal HTML page (not flash), but the flash intro takes a little while to get to the end..

...i want to make a cookie (or something similar), so that after you go into the site once, the next time you go into it....it redirects you to the language that you went into the last time, automatically, without having to go thru the flash intro.... i know it can be done....does anyone here know how to do it? :huh:

spilla
8th August 2005, 12:07 PM
anyone know how to do this?

Graham
8th August 2005, 12:33 PM
I plugged "+html +cookie" into Google and the second item on the list was http://www.quirksmode.org/js/cookies.html

That should give you a good start.

spilla
8th August 2005, 12:44 PM
hmmmm.....okay....that looks a little too hard for me....maybe i'll just get the visitors to bookmark the page.... :)

Graham
8th August 2005, 12:58 PM
Originally posted by spilla@Aug 8 2005, 12:44 PM
hmmmm.....okay....that looks a little too hard for me....
You're writing a multi-language site but a bit of JavaScript is too hard for you? :o

Husq
8th August 2005, 01:13 PM
There are a number of ways you can acheive this. First of all, are you sure you want a flash intro page? This practice is a little dated. Anyway I digress.

The first time a user comes to a page, you set a cookie with the language code. You can then read the cookie for the language code and redirect the user to a language specific URL. For example, http://www.yoursite.com/en/. This should be relatively simple for a static site. Google has numerous articles on reading from and writing to cookies in javascript.

More advanced methods include integrating internationalisation into your site so that language specific templates are included as necessary.

spilla
8th August 2005, 02:38 PM
ok.....have a look at my site:
http://testsite-1.netfirms.com

i've never used javascript.....but i may be able to learn....is it very hard?

EDIT: just remember....i'm still at skool.... :huh:

Graham
8th August 2005, 02:47 PM
Originally posted by spilla@Aug 8 2005, 02:38 PM
i've never used javascript.....but i may be able to learn....is it very hard?
If you know any C/C++ you know 90% of it. If you know any other programming (or scripting) language you're more than halfway there. Google for 'javascript tutorial" and you should be able to learn the main parts of the language within a couple of hours.

spilla
8th August 2005, 03:02 PM
hmmm...okay....never used C/C++......i've used applescript tho....how much javascript would i have to learn to make a cookie?

Graham
8th August 2005, 03:14 PM
That first link I gave you shows you pretty much everything you need (and you can easily Google the rest). The only thing more I could do is to write it for you but since it's your site and you need to learn it for yourself you can think of it as your homework for today :)

spilla
8th August 2005, 04:18 PM
ok....this may be a little off topic....but does anyone know how to submit a form in dreamweaver 2004 either to an email address or to a folder or something?

mac_man_luke
8th August 2005, 04:27 PM
you got PHP on the server?

Graham
8th August 2005, 04:31 PM
For email try http://webdesign.about.com/cs/dreamweaver/...wmailtoform.htm (http://webdesign.about.com/cs/dreamweaver/ht/htdwmailtoform.htm) (another Google first page result from using "+html +"submit form" +email" as the search criteria. The most important thing students should learn is how to find information...)

For writing to a file I'd use something like Perl or PHP (although I think JavaScript can do it as well).

spilla
8th August 2005, 04:35 PM
i always google before i ask here.....i just didn't put "html" in my search....and all i came up with was tutorials that u have to pay for :P .....and i've already tried what they've done on that site....my result was that it opened up a compose new message window for Gmail..... :huh: