• 08-07-2010, 20:58:46
    #1
    Üyeliği durduruldu
    Google Analytics kodunu bir değişkene nasıl eşitleyebilirim
    yani
    $a= "R10";
    echo"$a";
    Yapınca echo"$a"; R10 yazdırıyorsa bende echo"$a"; yapınca

    <script type="text/javascript">
    
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-Xxxxx']);
      _gaq.push(['_trackPageview']);
    
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    
    </script>
    kodunu yazdırmak istiyorum
  • 08-07-2010, 21:14:24
    #2
    Üyeliği durduruldu
    Analytics Kodunu farklı bir sayfaya yazıp include edebilirsin en basitinden.
  • 08-07-2010, 21:19:34
    #3
    <?php 
    
    $haha = "<script type=\"text/javascript\">
    
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-Xxxxx']);
      _gaq.push(['_trackPageview']);
    
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    
    </script>  ";
    
    
    echo $haha;
    
    ?>
  • 08-07-2010, 21:21:42
    #4
    Üyeliği durduruldu
    Teşekkürler işime yaradı peki while döngüsünü nasıl bir değişkene eşitleyebilirim?

    enc0der adlı üyeden alıntı: mesajı görüntüle
    <?php 
    
    $haha = "<script type=\"text/javascript\">
    
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-Xxxxx']);
      _gaq.push(['_trackPageview']);
    
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    
    </script>  ";
    
    
    echo $haha;
    
    ?>
  • 08-07-2010, 21:26:18
    #5
    varmı öyle bişey bilmiyorum ama fonksiyon ile yaparsın
    <?php 
    
    function hobba(){
    $a=1;
    while($a<15){
    echo $a.'<br>';
    $a++;
    }
    }
    hobba(); //  değişken gibi düşün :D
    ?>
  • 08-07-2010, 21:28:56
    #6
    Üyeliği durduruldu
    fonksiyon içine while döngünü koysam? olmazmı

    enc0der adlı üyeden alıntı: mesajı görüntüle
    varmı öyle bişey bilmiyorum ama fonksiyon ile yaparsın
    <?php 
    
    function hobba(){
    $a=1;
    while($a<15){
    echo $a.'<br>';
    $a++;
    }
    }
    hobba(); //  değişken gibi düşün :D
    ?>
  • 08-07-2010, 21:31:57
    #7
    while döngüsü zaten hobba() isimli fonksiyon içinde hocam analmadım demek istediginizi
  • 08-07-2010, 21:33:06
    #8
    Üyeliği durduruldu
    Pardon Görmedim Teşekkürler.
    enc0der adlı üyeden alıntı: mesajı görüntüle
    while döngüsü zaten hobba() isimli fonksiyon içinde hocam analmadım demek istediginizi