Although most of our companies work is template based design, the end result is always unique and adapts to each client's individual needs.
The process of merging a client's content and style with our templates creates an opportunity to challenge ourselves and once again put our web design skills to the test.
Recently, I found myself in a situation where it was necessary to pass information in the form of GET data from a simple flash button to a server side scripting language- all without reloading the current page. A client was running several different flash animated banners ads via XML layer popup, underlining some of her most popular website products and online services. She needed a simple way to track the overall efficiency of her small ad campaign. Specifically, she needed to know which banners were being clicked on and which banners were simply annoying or inconsequential to her client base. She also needed to know which were the most popular browsers accessing these pages.
I'll try to describe what needed to happen with out getting too techie.
An XML layer popup would pop up, offering the end user with a two options. In option A, one could click on the popup. This would take them to wherever the popup was designed to take them. Option B was for the end user to close the popup, and that would simply hide the XML layer's visibility property. At first, it sounded easy. However, beyond the obvious functionality of options A and B, each option needed to open, write, and save to an external file all without refreshing the current page. After all, the last thing anyone wants to see after closing a popup is another page pop up.
Nevertheless server side scripting languages, like PHP, require a refresh of the page to pass information. Unlike JavaScript which handles its business on the client side of a client server system via your browser (the client), PHP scripts are server-side because they operate solely on the server; data is sent to via POST or GET The script is then parsed, and the new data is sent back to the browser if necessary.
Here's the solution. I created the following<iframe>.
| <IFRAME id="ifrMain" name="main" src="myscript.php" frameborder="0" width="0" height="0" scrolling="no" ></IFRAME> |
Note that the SRC property is the location of our PHP script, which will be summoned later, to write and save to our external file. Notice our width and height properties are both set to zero.
I still submit the data to my PHP script, from within the flash banner popup with the help of ActionScript's cool little getURL() function:.
| on(press){ GetURL("myscript.php?banner=this&action=close","main", "GET"); } |
However because the target (main) was loaded inside our little hidden <iframe>, only the <iframe> refreshes. The user will not see a window refresh, the script will be parsed by PHP and everyone lived happily ever after…
Related Articles
- How To Get Profits From Your '404 Page Not Found' File?Page Not Found on this Server. Check the URL and try again. Or Refresh the page...
This is the annoying error that we will come across every time we surf the web pages. Internet will be changing every minute and day. The web sites that were here are not found next day... - Understanding the Domain Name SystemEver wonder why DNS systems came into existence? Efficiency. Every computer has a distinct IP address, and the Internet needed an elite method for obtaining these addresses and for managing the system as a whole. Enter ICANN.
- Client Side ScriptingHowever, this is not to say that other technologies are not extremely useful. Several technologies have proven to be just as important as CGI for the average Internet developer. These technologies focus on putting the demands of computation in the hands of the client instead of the server...
- Types of HostingWebsite hosting can be a big issue, especially since its a recurring monthly charge and hosting packages can become quite expensive. This article points out the pros and cons of each of the different types of hosting service packages.
- Web Programming 101At some point along the way webmasters around the net realized that HTML (1) was too limited to do many of the things that they wanted to accomplish.
- Web Hosting the Pros and ConsManaged hosting is a type of internet hosting using a dedicated server. For you, the client, this means that you have the server to yourself and you do not share digital space with anyone else. This is also called a dedicated hosting service...
- 8 Things a Web Host Must DoA web host can make or break your web site business. The success of any business online is as much dependant on its web host as on its business plan.
- Four Questions To Ask When Shopping For Web HostingWeb hosting is a difficult and confusing business to get yourself into, but sooner or later just about everybody thinks about starting a Web site for themselves. No mater if you are starting up a Web site for your childs baseball team or for your own corporate business, the things you need to look....
- Different Types of Web HostingThe key responsibilities of a web hosting company are to provide server space, web services and maintenance of servers which host websites owned or controlled by individuals and companies. Most web hosting companies offer shared hosting and dedicated hosting, which are explained in detail below....
- Web Hosting BasicsWhat can you learn from Web Hosting Basics? You might be surprised. The author covers necessary questions and gets all the answers that you want to hear if you need a serious hosting service. Read on for the bottom line.
