<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1012530" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1012530</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/script-lets-client-change-background-color-my-website#comment-1073026</link>
    <description> &lt;p&gt;Suzanne-&lt;br /&gt;
right on!&lt;/p&gt;
&lt;p&gt;I&#039;d go with the cgi (or perhaps PHP &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;) executed (or include for PHP) to set the vars...&lt;/p&gt;
&lt;p&gt;unless I&#039;m missing something, Ken&#039;s code won&#039;t work for return visits (without caching on).&lt;/p&gt;
&lt;p&gt;if you use cgi/php, you could have the a DB store the preferences and access it with the users IP, or a single cookie with a unique user id.  OR you could just set cookies holding all the vars you need (there is a limit)&lt;/p&gt;
 </description>
     <pubDate>Thu, 19 Oct 2000 06:09:32 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1073026 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/script-lets-client-change-background-color-my-website#comment-1072986</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: &lt;em&gt;Originally posted by fairhousing &lt;/em&gt;&lt;br /&gt;
&lt;strong&gt;i&#039;d go with the javascript, it&#039;s more efficient for the task at hand. &lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Yeah, but users with JavaScript disabled won&#039;t be able to use it...&lt;/p&gt;
 </description>
     <pubDate>Wed, 18 Oct 2000 20:36:05 +0000</pubDate>
 <dc:creator>mjames</dc:creator>
 <guid isPermaLink="false">comment 1072986 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>nit picking detail</title>
    <link>https://www.webmaster-forums.net/serverside-scripting/script-lets-client-change-background-color-my-website#comment-1072939</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: The only reason I suggest Java ... you&#039;d still have to use Java to retrieve it otherwise each page would have to be generated via cgi. &lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Two things about this, just nit picking.&lt;/p&gt;
&lt;p&gt;1.  Java is NOT the same as JavaScript.  Not even close.  They are two totally different languages with similarities, but they are not the same thing.&lt;/p&gt;
&lt;p&gt;2.  You don&#039;t have to generate a whole page to use CGI.  You can include or execute CGI files within a regular page (with server side includes turned on).  Of course, generating a page from a template rather than hard-coding it also saves time in the future, but that&#039;s a different discussion.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt; Suzanne&lt;/p&gt;
 </description>
     <pubDate>Wed, 18 Oct 2000 02:37:11 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1072939 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/script-lets-client-change-background-color-my-website#comment-1072402</link>
    <description> &lt;p&gt;i&#039;d go with the javascript, it&#039;s more efficient for the task at hand.&lt;/p&gt;
 </description>
     <pubDate>Sat, 07 Oct 2000 05:27:52 +0000</pubDate>
 <dc:creator>fairhousing</dc:creator>
 <guid isPermaLink="false">comment 1072402 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/script-lets-client-change-background-color-my-website#comment-1072379</link>
    <description> &lt;p&gt;Hi Quickstrike,&lt;/p&gt;
&lt;p&gt;  I agree with Denise in that if you wish to save only a few variables, javascript cookies is the way to go. It&#039;s relatively simple to implement, requires no cgi access, and responds faster because it is client-side.&lt;br /&gt;
  However, if you intend to save more than a few variables, I would recommend going the cgi route -- a database for storing the user selections, usernames, passwords, etc.  Not everyone allows a cookie and cookies eventually expire or get overwritten by someone else&#039;s cookie.&lt;/p&gt;
&lt;p&gt;  Ken: I agree.  Both code snippets look like some sort of magical incantation (especially the perl one, since I have very little background in it &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Vinny&lt;/p&gt;
 </description>
     <pubDate>Fri, 06 Oct 2000 18:53:08 +0000</pubDate>
 <dc:creator>Vincent Puglia</dc:creator>
 <guid isPermaLink="false">comment 1072379 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/script-lets-client-change-background-color-my-website#comment-1072370</link>
    <description> &lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The only reason I suggest Java is because it&#039;s a live language, really speeds things up here and doesn&#039;t rely on cgi.. and either way, even if you do include a cookie writing subroutine in your Perl example, you&#039;d still have to use Java to retrieve it otherwise each page would have to be generated via cgi.&lt;/p&gt;
&lt;p&gt;This can be difficult because the cgi would have to know exactly the content of each page to be displayed and then print it again, which means reading the data as an array and returning it to the browser.&lt;/p&gt;
&lt;p&gt;I think Perl cgi would only be neccessary if you were constantly returning standard pages with many fields dependant on a surfer&#039;s chosen variables.&lt;/p&gt;
&lt;p&gt;But what the heck, it&#039;s a free world!&lt;/p&gt;
&lt;p&gt;Denise &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Fri, 06 Oct 2000 15:27:59 +0000</pubDate>
 <dc:creator>Denise</dc:creator>
 <guid isPermaLink="false">comment 1072370 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/script-lets-client-change-background-color-my-website#comment-1072369</link>
    <description> &lt;p&gt;Wow..I really don&#039;t know JavaScript to well..but it doesn&#039;t look much easier.&lt;/p&gt;
&lt;p&gt;Here is my code..&lt;/p&gt;
&lt;p&gt;1st page: choose the color..&lt;/p&gt;
&lt;p&gt;Blue&lt;br /&gt;
Red&lt;br /&gt;
Black&lt;br /&gt;
White&lt;/p&gt;
&lt;p&gt;Script: shows color and page&lt;/p&gt;
&lt;p&gt;#!/usr/bin/perl -w&lt;br /&gt;
&amp;Parse;&lt;/p&gt;
&lt;p&gt;$color = $formdata{&#039;color&#039;};&lt;/p&gt;
&lt;p&gt;print &quot;Content-type:text/html\n\n&quot;;&lt;br /&gt;
print &quot;&quot;;&lt;br /&gt;
print &quot;So you chose $color...nice choice&quot;;&lt;br /&gt;
print &quot;&quot;;&lt;/p&gt;
&lt;p&gt;sub Parse {&lt;br /&gt;
@pairs = split(/&amp;amp;/, $ENV{&#039;QUERY_STRING&#039;});&lt;br /&gt;
foreach $pair (@pairs) {&lt;br /&gt;
		($key, $value) = split (/=/, $pair);&lt;br /&gt;
		$key =~ tr/+/ /;&lt;br /&gt;
		$key =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(&quot;C&quot;, hex($1))/eg;&lt;br /&gt;
		$value =~ tr/+/ /;&lt;br /&gt;
		$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(&quot;C&quot;, hex($1))/eg;&lt;/p&gt;
&lt;p&gt;		$value =~s///g;&lt;/p&gt;
&lt;p&gt;		if ($formdata{$key}) {&lt;br /&gt;
			$formdata{$key} .= &quot;, $value&quot;;&lt;br /&gt;
		} else {&lt;br /&gt;
			$formdata{$key} = $value;&lt;br /&gt;
		}&lt;br /&gt;
}&lt;br /&gt;
	}&lt;/p&gt;
&lt;p&gt;Hmm...well neither is very pretty to look at.&lt;/p&gt;
 </description>
     <pubDate>Fri, 06 Oct 2000 15:11:12 +0000</pubDate>
 <dc:creator>Ken Elliott</dc:creator>
 <guid isPermaLink="false">comment 1072369 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Background Color</title>
    <link>https://www.webmaster-forums.net/serverside-scripting/script-lets-client-change-background-color-my-website#comment-1072368</link>
    <description> &lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I know this is a Perl Forum but I really think it would be much easier to do in Javacript.&lt;/p&gt;
&lt;p&gt;Here&#039;s the code to place in your page &lt;/p&gt;
&lt;p&gt;---------------------------------------------------&lt;/p&gt;
&lt;p&gt;&amp;lt;script LANGUAGE=&quot;Javascript&quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;script LANGUAGE=&quot;Javascript&quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;script LANGUAGE=&quot;Javascript&quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;---------------------------------------------------&lt;/p&gt;
&lt;p&gt;Here&#039;s the code to place where you&#039;re  tag appears:&lt;/p&gt;
&lt;p&gt;&amp;lt;script LANGUAGE=&quot;Javascript&quot;&amp;gt;&lt;br /&gt;
\n&quot;);}&lt;br /&gt;
else{&lt;br /&gt;
document.write(&quot;\n&quot;);}&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;----------------------------------------------------&lt;/p&gt;
&lt;p&gt;And here&#039;s the link to place on your page!&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/javascript_only&quot;&gt;Click here to choose your background color!&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This all works, I tried it!&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Denise &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;[Edited by Denise on 10-06-2000 at 09:15 AM]&lt;/p&gt;
 </description>
     <pubDate>Fri, 06 Oct 2000 13:03:08 +0000</pubDate>
 <dc:creator>Denise</dc:creator>
 <guid isPermaLink="false">comment 1072368 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
