Jump to content


Javascript Cookie or better?


4 replies to this topic

#1 musicmee

    Young Padawan

  • Members
  • Pip
  • 18 posts
  • Gender:Male
  • Location:Doncaster

Posted 26 March 2008 - 03:16 PM

I have this script...

<script language="JavaScript">

var backImage = new Array(); 

backImage[0] = "http://www.url.com/ay/bg.gif";
backImage[1] = "http://www.url.com/ay/bg2.gif";
backImage[2] = "http://www.url.com/ay/bg3.gif";
backImage[3] = "http://www.url.com/ay/bg4.gif";
 
function changeBGImage(whichImage){
if (document.body){
document.body.style.backgroundImage = "url("+backImage[whichImage]+")";
}

}
</script>

My question / Plea for help ...
That allows the user to select a body background image, how would i get it so that it remembers it in a cookie ?


A seperate question too... Is it possible to save it in a text file rather than a mysql database, im looking for it to eventually be used on a network and no matter where they log in they would get their bg, but the school have said no to SQL. Text file?


Cheers guys!

#2 musicmee

    Young Padawan

  • Members
  • Pip
  • 18 posts
  • Gender:Male
  • Location:Doncaster

Posted 27 March 2008 - 02:04 PM

Sorry for the double post, but could really do with a cookies version for tomorow to impress the boss, if you could help me .... ill love you forever :huh: cheers

#3 The Creator

    Young Padawan

  • Members
  • Pip
  • 115 posts
  • Gender:Male
  • Location:England
  • Interests:Computers, Music, Technology, Sport

Posted 28 March 2008 - 08:32 AM

http://www.elated.co...pt-and-cookies/ :biggrin:

#4 musicmee

    Young Padawan

  • Members
  • Pip
  • 18 posts
  • Gender:Male
  • Location:Doncaster

Posted 28 March 2008 - 08:58 PM

View PostThe Creator, on Mar 28 2008, 09:32 AM, said:


didnt help ;) if any thing confused me more

#5 musicmee

    Young Padawan

  • Members
  • Pip
  • 18 posts
  • Gender:Male
  • Location:Doncaster

Posted 30 March 2008 - 01:54 PM

Just a quick update... Im willing to pay what you think its worth over paypal if someone could knock me up a javascript cookie saving background.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users