Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Otwieranie banneru
wysocki
post
Post #1





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 16.03.2009

Ostrzeżenie: (0%)
-----


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
Powód edycji: Dodałem bbCode (ociu)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 10)
Spawnm
post
Post #2





Grupa: Moderatorzy
Postów: 4 069
Pomógł: 497
Dołączył: 11.05.2007
Skąd: Warszawa




jak dasz kod w bbcode to ci pomogę .
Go to the top of the page
+Quote Post
wysocki
post
Post #3





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 16.03.2009

Ostrzeżenie: (0%)
-----


Czyli jak? (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post
Ociu
post
Post #4





Grupa: Moderatorzy
Postów: 1 566
Pomógł: 37
Dołączył: 14.05.2003
Skąd: Kraków




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.
Go to the top of the page
+Quote Post
Spawnm
post
Post #5





Grupa: Moderatorzy
Postów: 4 069
Pomógł: 497
Dołączył: 11.05.2007
Skąd: Warszawa




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 (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post
wysocki
post
Post #6





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 16.03.2009

Ostrzeżenie: (0%)
-----


Ja jestem w tym zielony więc podpowiesz mi jeszcze gdzie mam to umieścić?
Go to the top of the page
+Quote Post
Spawnm
post
Post #7





Grupa: Moderatorzy
Postów: 4 069
Pomógł: 497
Dołączył: 11.05.2007
Skąd: Warszawa




przed:
  1. <? if ($arg=="show") { print "onLoad=\"java script:showme()\"";} ?>

bo tam już jest sprawdzane czy $arg istnieje .
Go to the top of the page
+Quote Post
wysocki
post
Post #8





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 16.03.2009

Ostrzeżenie: (0%)
-----


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. (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)
Go to the top of the page
+Quote Post
piotrooo89
post
Post #9


Newsman


Grupa: Moderatorzy
Postów: 4 005
Pomógł: 548
Dołączył: 7.04.2008
Skąd: Trzebinia/Kraków




błąd logiczny...

  1. <?php
  2. if(!empty($_GET['sc']))
  3. ?>
Go to the top of the page
+Quote Post
Spawnm
post
Post #10





Grupa: Moderatorzy
Postów: 4 069
Pomógł: 497
Dołączył: 11.05.2007
Skąd: Warszawa




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 (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
piotrooo89
post
Post #11


Newsman


Grupa: Moderatorzy
Postów: 4 005
Pomógł: 548
Dołączył: 7.04.2008
Skąd: Trzebinia/Kraków




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.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 23:24