Monday, November 3, 2008

Control the background image with AJAX and PHP

The assignment was "to create an application which allows you to control and change the content that someone else is viewing on your site". So what I wanted to do is to change some visual elements (eg. background color, background image, text size, etc...) when someone else is visiting my web page or reading my blog.

So I created a kind of admin page where I can input a command, this is the visual element I want to change(eg. "bg" is for changing background image), and also a value, which is the value to be changed to. For example, I can put in "bg" in the command field and "http://www.flash-screen.com/flashgallerybuilder/images/christmas-snow.jpg" in the value field for the background image's url.

The admin page is at here http://unwiredd.com/garage/liveweb/admin.php

And the page audience should visit is here http://unwiredd.com/garage/liveweb/mypage.html


So just go to the admin page and put in "bg" and a url of any image on the internet, the people visiting the page http://unwiredd.com/garage/liveweb/mypage.html should see the background image changes immediately.

What I'm also thinking about after the introduction of TextMarks in class is that it is also possible that the admin can send a pair of command and value in a SMS, and then people should see the changes on the page they are visiting immediately.

No comments: