Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Otwieranie banneru
Forum PHP.pl > Forum > Przedszkole
wysocki
Witam serdecznie. Chcialbym zeby wyswietlal mi sie taki bannerek jezli ktos bedzie wchodzil na strone głowna. Nie znam sie na tym kompletnie ale ten chlopak podal mi link http://www.regent.pl/index2.php?arg=show to wtedy sie otwiera. A chcialbym zeby otwieralo sie przy wpisywaniu strony glownej. Mam w kodzie takie cos:

  1. <?php    $a = $_SERVER['SERVER_NAME'];
  2.    $as = explode(".", $a);
  3.        if($as[0] != "www"){
  4.            header("Location: http://www.regent.pl/"); /* Redirect browser */
  5.            exit;
  6.        }
  7.  
  8.        require 'conf.php';
  9.        require 'connect.php';
  10.  
  11.    include_once('./wtclient.php');
  12.    $wt = new wtengine;
  13.    echo $wt -> fetch();
  14.  
  15. ?>

i w body to:

  1. <? if ($arg=="show") { print "onLoad=\"javascript:showme()\"";} ?>>
  2. <? if ($arg=="show") { ?>
  3. <div id="light" class="white_content">
  4. <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="550" height="400">
  5. <param name="movie" value="M/floating.swf">
  6. <param name="quality" value="high">
  7. <param name="wmode" value="transparent">
  8. <param name="swfversion" value="6.0.65.0">
  9. <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don't want users to see the prompt. -->
  10. <param name="expressinstall" value="Scripts/expressInstall.swf">
  11. <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
  12. <!--[if !IE]>-->
  13. <object type="application/x-shockwave-flash" data="M/floating.swf" width="550" height="400">
  14. <!--<![endif]-->
  15. <param name="quality" value="high">
  16. <param name="wmode" value="transparent">
  17. <param name="swfversion" value="6.0.65.0">
  18. <param name="expressinstall" value="Scripts/expressInstall.swf">
  19. <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
  20. <div>
  21. <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
  22. <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
  23. </div>
  24. <!--[if !IE]>-->
  25. </object>
  26. <!--<![endif]-->
  27. </object>
  28. </div><div id="fade" class="black_overlay"></div><? };?>


Pozdrawiam
Spawnm
jak dasz kod w bbcode to ci pomogę .
wysocki
Czyli jak? winksmiley.jpg
Ociu
Panie Spawnm, na forum od taki rzecz są przyciski Raportuj, proszę nie bawić się w moderatora.
Panie wysocki, proszę na następny raz używać bbCode.
Spawnm
sprawdzaj czy empty($_GET['sc']), jeśli tak to znaczy że jesteśmy na stronie głównej i można odpalić baner,
czyli
  1. <?php
  2. if( empty($_GET['sc']) ){
  3.  $arg="show";
  4. }
  5. ?>


Ociu nie bawię się w moda, poprostu kod był nieczytelny więc poprosiłem o bbcode winksmiley.jpg
wysocki
Ja jestem w tym zielony więc podpowiesz mi jeszcze gdzie mam to umieścić?
Spawnm
przed:
  1. <? if ($arg=="show") { print "onLoad=\"java script:showme()\"";} ?>

bo tam już jest sprawdzane czy $arg istnieje .
wysocki
Teraz kod wygląda tak:

  1. <?php
  2. if( empty($_GET['sc']) ){
  3. $arg="show";
  4. }
  5. ?>
  6. <? if ($arg=="show") { print "onLoad=\"java script:showme()\"";} ?>>
  7. <? if ($arg=="show") { ?>
  8. <div id="light" class="white_content">
  9.  <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="550" height="400">
  10.    <param name="movie" value="M/floating.swf">
  11.    <param name="quality" value="high">
  12.    <param name="wmode" value="transparent">
  13.    <param name="swfversion" value="6.0.65.0">
  14.    <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don't want users to see the prompt. -->
  15.    <param name="expressinstall" value="Scripts/expressInstall.swf">
  16.    <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
  17.    <!--[if !IE]>-->
  18.    <object type="application/x-shockwave-flash" data="M/floating.swf" width="550" height="400">
  19.      <!--<![endif]-->
  20.      <param name="quality" value="high">
  21.      <param name="wmode" value="transparent">
  22.      <param name="swfversion" value="6.0.65.0">
  23.      <param name="expressinstall" value="Scripts/expressInstall.swf">
  24.      <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
  25.      <div>
  26.        <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
  27.        <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
  28.      </div>
  29.      <!--[if !IE]>-->
  30.    </object>
  31.    <!--<![endif]-->
  32.  </object>
  33. </div><div id="fade" class="black_overlay"></div><? };?>


Niestety nadal się nie pokazuje. sad.gif
piotrooo89
błąd logiczny...

  1. <?php
  2. if(!empty($_GET['sc']))
  3. ?>
Spawnm
Cytat(piotrooo89 @ 16.03.2009, 19:40:23 ) *
błąd logiczny...

  1. <?php
  2. if(!empty($_GET['sc']))
  3. ?>

no chyba nie tu błąd , bo to co napisałeś brzmi :
'jeśli nie jest pusty get to...'

a get ma być pusty bo to oznaka że jesteśmy na stronie głównej smile.gif
piotrooo89
Cytat
a get ma być pusty bo to oznaka że jesteśmy na stronie głównej


no chyba że tak... to całkowicie zmienia postać rzeczy.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.