Username: Save?
Password:
Home Forum Links Search Login Register*
    News: Welcome to the TechnoWorldInc! Community!
Recent Updates
[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[February 14, 2024, 02:00:39 PM]
Subscriptions
Get Latest Tech Updates For Free!
Resources
   Travelikers
   Funistan
   PrettyGalz
   Techlap
   FreeThemes
   Videsta
   Glamistan
   BachatMela
   GlamGalz
   Techzug
   Vidsage
   Funzug
   WorldHostInc
   Funfani
   FilmyMama
   Uploaded.Tech
   MegaPixelShop
   Netens
   Funotic
   FreeJobsInc
   FilesPark
Participate in the fastest growing Technical Encyclopedia! This website is 100% Free. Please register or login using the login box above if you have already registered. You will need to be logged in to reply, make new topics and to access all the areas. Registration is free! Click Here To Register.
+ Techno World Inc - The Best Technical Encyclopedia Online! » Forum » THE TECHNO CLUB [ TECHNOWORLDINC.COM ] » Programming Zone » PHP
 PHP Server to Client with No Refresh.
Pages: [1]   Go Down
  Print  
Author Topic: PHP Server to Client with No Refresh.  (Read 1234 times)
Daniel Franklin
TWI Hero
**********


Karma: 3
Offline Offline

Posts: 16647


View Profile Email
PHP Server to Client with No Refresh.
« Posted: September 26, 2007, 12:22:04 PM »


ntly, 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 scrip will be parsed by PHP and everyone lived happily ever after…

Articles Source - Free Articles

About the Author

Dave Collado is a senior design consultant at www.Foamers.net , and freelance web designer since 1999. Foamers.net offers quality website templates template customization, flash templates, phpnuke themes, phpbb themes, osCommerce templates,SWiSH templates, web design tutorials, and many other website design and web hosting services.

Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Copyright © 2006-2023 TechnoWorldInc.com. All Rights Reserved. Privacy Policy | Disclaimer
Page created in 0.085 seconds with 24 queries.