Google Answers Logo
View Question
 
Q: HTML / Web Page ( No Answer,   2 Comments )
Question  
Subject: HTML / Web Page
Category: Computers > Internet
Asked by: honorbound-ga
List Price: $50.00
Posted: 16 May 2006 09:19 PDT
Expires: 18 May 2006 08:26 PDT
Question ID: 729366
Im wanting to make a web page that when the user clicks on a button a
box above the button changes color. But I want any one that is viewing
that same page to see that change. Any one can change the color of the
box and other people viewing the same page will see it happen. If Joe
in California clicks the button and changes the color then Ron in
Oklahoma will see the box change color on his screen also. So any one
viewing the page has control over the color of the box at any one
time. Like when you leave a message in someones guestbook and it shows
up on the page after you submit it. but I want to do this with colors
or graphics Id like to do this without refreshing the page but I dont
think that is possible. If the page has to be refreshed that is
acceptable. Anyway Im looking for the simplest way to do this in HTML.

Request for Question Clarification by djbaker-ga on 16 May 2006 09:23 PDT
Greetings!
To my knowledge, what you want to do is basic html would not be
possible.  I could do it very easily for you if you have access to a
database of some sort and your hosting allows for simple PHP server
side scripting.

WIth those options it would be very easy to do.  If you would be
interested in this solution as your answer, let me know and I will
code it for you.

Request for Question Clarification by djbaker-ga on 16 May 2006 09:48 PDT
FYI...
Unless you are using some sort of free hosting (i.e a comcast account,
some school accounts, a geocities account, etc) you should have access
to a database and some server side scripting.  If you do not have
database access or do not know how to set one up it may also still be
possible provided you have some type of server side scripting
available.

In the meantime, I will look up another option I have in mind which
might also do the trick for you if those two options are not
available.

Request for Question Clarification by webadept-ga on 16 May 2006 11:36 PDT
Hi Honorbound, 

While djbaker is waiting for your reply, and looking for other options
for you, I thought I would give you both a few hints. There is no way
to do this with HTML, as djbaker is certainly aware. You are going to
need some programming done with either ASP, PHP, or something of that
nature. The real tool for this job would be Flash, since it can show
real time changes in a database to multiple users, producing the
effect you are looking for without refreshing the page. The most
stable combination is going to be Flash, PHP, and MySQL. There are
other answers of course (there is always more than one way to do
something), but if you are looking for a system that is stable, fast,
and able to handle a growing amount of use, then you are looking at
that combination for this project.

Good luck to you, 

webadept-ga

Request for Question Clarification by djbaker-ga on 16 May 2006 11:57 PDT
Flash would certainly be one option but probably more cumbersome then
what I had in mind.  Using Ajax it should be relatively easy to do
what you are asking (provided you have access to a database or your
files have write access permissions on the server) without refreshing
the page.  There is a javascript command used by almost all web 2.0
apps called XMLHTTPREQUEST which allows the page to send a request to
a server side script and get processed in the background.  The script
then sends back the information to the javascript which can make the
changes on the page without a refresh.

You can see examples of this type of thing in GMail, Digg, Google Maps
and other similar sites.  For example, in Gmail when you hit reply to
a message, the reply simply drops down without a page reload being
necessary.

While I have never used this to change the background of a page, it
should be fairly easily.  All that would be necessary is to set up a
javascript trigger which checks the server for a new page color every
1 - 3 seconds and then makes the change accordingly.

Best,
djbaker-ga
Answer  
There is no answer at this time.

Comments  
Subject: Re: HTML / Web Page
From: webadept-ga on 17 May 2006 16:09 PDT
 
I hadn't thought of that one... but it is a very cool way of doing it
(referring to djbaker's last post). After doing a bit of research, I
really wish they had that ability when I was coding pages a few years
ago. Could have saved a whole lot of time. Ideas just keep getting
better don't they? :-)

Very cool. 

webadept-ga
Subject: Re: HTML / Web Page
From: golivehost-ga on 18 May 2006 01:13 PDT
 
As the others have mentioned, there is no way to do this in just HTML.
You'll need access to a scripting language (PHP/Perl/ASP/etc), and the
ability to write to a file on the server. It could be as simple as a
file with 6 numbers in it (the RGB code for the color), that is then
included in the page to color the element that the box is
(td/div/etc). The code would be simple, just a few lines, but it
entirely depends on the scripting language you have available to you.
With that info, the script could be provided easily.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy