943,822 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 827
  • PHP RSS
Dec 19th, 2008
0

Help with gateway script!

Expand Post »
Hi,
I have a site with free games, etc..
I want to do this: when a user clicks on a game to play, he is redirected to the landing page, where a script checks, if he has our toolbar installed; if yes, then he can play the game - if not, the background freezes and in the front shows a prompt window (mgate.php), to install the toolbar.
I have developed a code, but it does not work properly, so I am asking for a little help
Here is the code for the page with game on it (example: index.php):

PHP Syntax (Toggle Plain Text)
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. toolbar=0;
  5. function ToolBarInit(tool) {
  6. toolbar=1;
  7. }
  8.  
  9. function checkToolbar(){
  10. if(toolbar!=1) {
  11. window.location.href="landingpage.php";
  12. }
  13. }
  14. </script>
  15. <script language="javascript">
  16. document.getElementById('mask').style.visibility='visible'
  17. document.getElementById('mask2').style.visibility='visible'
  18.  
  19. document.getElementById('mask').style.height=document.body.clientHeight
  20.  
  21. function loadContent(){
  22.  
  23. if(toolbar==1){ document.getElementById('cont').innerHTML='<div width=500 height=500 style="overflow: hidden;" id=media_container><embed src= "http://www.odeo.com/flash/audio_player_standard_gray.swf" quality="high" width="300" height="52" allowScriptAccess="always" wmode="transparent" type="application/x-shockwave-flash" flashvars= "valid_sample_rate=true&external_url=<?=$_GET[url];?>" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed></div>'
  24. document.getElementById('mask').style.visibility='hidden'
  25. document.getElementById('mask2').style.visibility='hidden'
  26.  
  27. }
  28. }
  29.  
  30. function confirmDL(){
  31. location.href='http://mydomain/toolbar.exe';
  32. }
  33.  
  34. </script>
  35. </head>
  36. <body>
  37.  
  38. <h1><a href="http://mydomain/game.swf">Click to Play!</a></h1>
  39. </body>
  40. </html>

And here is the code for the landing page:

PHP Syntax (Toggle Plain Text)
  1. <html>
  2. <head>
  3. </head>
  4. <body onLoad="loadContent();" style="position:relative; display:block">
  5. <div id=mask style="width:100%; height:100%; position:absolute; z-index:1000; background-color: black; filter:alpha(opacity=50);-moz-opacity:.50;opacity:.50;left:0px; top:0px; display:block; visibility:hidden" align=center></div>
  6. <div id=mask2 style=" position: absolute; width: 650px; z-index:1500; display:block; margin-left:50%; visibility:hidden" ><div style='position:absolute; z-index:1500; width:650px; height:450px; background-color:white; border:1px solid gray; margin-left:-325px; display:block; margin-top:200px; ' align=center><?php include_once("mgate.php");?></div></div>
  7. <script language="javascript">
  8. document.getElementById('mask').style.visibility='visible'
  9. document.getElementById('mask2').style.visibility='visible'
  10.  
  11. document.getElementById('mask').style.height=document.body.clientHeight
  12.  
  13. function loadContent(){
  14.  
  15. if(toolbar==1){ document.getElementById('cont').innerHTML='<div width=500 height=500 style="overflow: hidden;" id=media_container><embed src= "http://www.odeo.com/flash/audio_player_standard_gray.swf" quality="high" width="300" height="52" allowScriptAccess="always" wmode="transparent" type="application/x-shockwave-flash" flashvars= "valid_sample_rate=true&external_url=<?=$_GET[url];?>" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed></div>'
  16. document.getElementById('mask').style.visibility='hidden'
  17. document.getElementById('mask2').style.visibility='hidden'
  18.  
  19. }
  20. }
  21.  
  22. function confirmDL(){
  23. location.href='http://mydomain/toolbar.exe';
  24. }
  25.  
  26. </script>
  27.  
  28. <div id=('cont')
  29.  
  30. </body>
  31. </html>
Help pls!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
elbuhleini is offline Offline
17 posts
since Apr 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Email FUnction with PHP & PDF pr Word FOrmat
Next Thread in PHP Forum Timeline: Any suggestion about schedule graphic





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC