How to avoid an access to the counter ?

Discussion in 'HTML' started by Raymond Schmit, Feb 12, 2009.

  1. using php, i have:

    <?php
    $myhost = $_SERVER["HTTP_HOST"] ;
    if ($myhost=="localhost")
    {
    $html_footer = "- 0 - (to not interfere the visit counter during local
    tests)";
    }
    else
    {
    $html_footer = <<<__WHATEVER_YOU_WANT_TO_MAKE_IT_STOP__
    - visit counter acces code is normally here - but not copied here to
    reduce the length of this newsgroup post -
    __WHATEVER_YOU_WANT_TO_MAKE_IT_STOP__;
    }
    echo $html_footer;
    ?>


    Is it a way of doing this without using php ?
    (fu2 : alt.html)
    Raymond Schmit, Feb 12, 2009
    #1
    1. Advertising

  2. Raymond Schmit

    Robb Guest

    Raymond Schmit wrote:

    > using php, i have:
    >
    > <?php
    > $myhost = $_SERVER["HTTP_HOST"] ;
    > if ($myhost=="localhost")
    > {
    > $html_footer = "- 0 - (to not interfere the visit counter during local
    > tests)";
    > }
    > else
    > {
    > $html_footer = <<<__WHATEVER_YOU_WANT_TO_MAKE_IT_STOP__ - visit counter
    > acces code is normally here - but not copied here to reduce the length
    > of this newsgroup post - __WHATEVER_YOU_WANT_TO_MAKE_IT_STOP__;
    > }
    > echo $html_footer;
    > ?>
    >
    >
    > Is it a way of doing this without using php ? (fu2 : alt.html)



    Lock them down with htaccess.

    <files "This_File.ext">
    Order Deny,Allow
    Deny from all
    Allow from localhost (or server ip)
    </files>

    See: http://httpd.apache.org/docs/2.0/mod/mod_access.html



    --
    Robb | Shared Secrets Usenet
    Robb, Feb 12, 2009
    #2
    1. Advertising

  3. On 12 Feb 2009 10:09:51 GMT, Robb <> wrote:

    >Raymond Schmit wrote:
    >
    >> using php, i have:
    >>
    >> <?php
    >> $myhost = $_SERVER["HTTP_HOST"] ;
    >> if ($myhost=="localhost")
    >> {
    >> $html_footer = "- 0 - (to not interfere the visit counter during local
    >> tests)";
    >> }
    >> else
    >> {
    >> $html_footer = <<<__WHATEVER_YOU_WANT_TO_MAKE_IT_STOP__ - visit counter
    >> acces code is normally here - but not copied here to reduce the length
    >> of this newsgroup post - __WHATEVER_YOU_WANT_TO_MAKE_IT_STOP__;
    >> }
    >> echo $html_footer;
    >> ?>
    >>
    >>
    >> Is it a way of doing this without using php ? (fu2 : alt.html)

    >
    >
    >Lock them down with htaccess.
    >
    ><files "This_File.ext">
    >Order Deny,Allow
    >Deny from all
    >Allow from localhost (or server ip)
    ></files>
    >
    >See: http://httpd.apache.org/docs/2.0/mod/mod_access.html



    Thanks for answering, but i did not understand what to do.

    The text i posted is just the visit counter part of a 'normal'
    webpage. This the only php part, all the rest are html language.
    I did not have apache installed on my localhost and i did not know, at
    my isp websapce, what webserver is running.

    The "acces code is normally here" is essentially a script like:
    <script type="text/javascript"
    src="http://www.count.fr/Compteur-Assurance-vie/script_fin.asp?id=123456&zero=1&background=&stats=1&txt=&session=1">
    </script>

    may be we can modify the script if the page in on the localhost
    computer...
    Raymond Schmit, Feb 12, 2009
    #3
  4. Raymond Schmit

    Robb Guest

    Raymond Schmit wrote:

    > Thanks for answering, but i did not understand what to do.
    >
    > The text i posted is just the visit counter part of a 'normal' webpage.
    > This the only php part, all the rest are html language. I did not have
    > apache installed on my localhost and i did not know, at my isp websapce,
    > what webserver is running.



    Place this in a new PHP file:

    <?php phpinfo(); ?>

    Save as phpinfo.php

    Upload it to the server, then use your browser to get it from your
    domain: www.yourdomain.com/phpinfo.php

    The page will output the configuration information, if it's a running site,
    save the page output and delete phpinfo.php. You can't protect a page with
    php easily.

    Here's an encoded javascript version of the script that *may* help,
    it is reversible though. Place it below your current counter and view
    source, then remove the old code if you decide to keep it.

    <script type="text/javascript">
    <!--
    var s="=@qiq %nziptu!>!%`TFSWFS\\#IUUQ`IPTU#^!< jg!)%nziptu>>#mpdbmiptu#* | %iunm`gppufs!>!#.!1!.!)up!opu!joufsgfsf!uif!wjtju!dpvoufs!evsjoh!mpdbm uftut*#< ~ fmtf | %iunm`gppufs!>!===``XIBUFWFS`ZPV`XBOU`UP`NBLF`JU`TUPQ`` .!wjtju!dpvoufs!bddft!dpef!jt!opsnbmmz!ifsf!.!cvu!opu!dpqjfe!ifsf!up sfevdf!uif!mfohui!pg!uijt!ofxthspvq!qptu!. ``XIBUFWFS`ZPV`XBOU`UP`NBLF`JU`TUPQ``< !~ fdip!%iunm`gppufs< @?";
    m=""; for (i=0; i<s.length; i++) m+=String.fromCharCode(s.charCodeAt(i)-1); document.write(m);
    //-->
    </script>
    <noscript>
    &#60&#63&#112&#104&#112&#13&#10&#36&#109&#121&#104&#111&#115&#116&#32&#61&#32&#36&#95&#83&#69&#82&#86&#69&#82&#91&#34&#72&#84&#84&#80&#95&#72&#79&#83&#84&#34&#93&#32&#59&#13&#10&#105&#102&#32&#40&#36&#109&#121&#104&#111&#115&#116&#61&#61&#34&#108&#111&#99&#97&#108&#104&#111&#115&#116&#34&#41&#13&#10&#123&#13&#10&#36&#104&#116&#109&#108&#95&#102&#111&#111&#116&#101&#114&#32&#61&#32&#34&#45&#32&#48&#32&#45&#32&#40&#116&#111&#32&#110&#111&#116&#32&#105&#110&#116&#101&#114&#102&#101&#114&#101&#32&#116&#104&#101&#32&#118&#105&#115&#105&#116&#32&#99&#111&#117&#110&#116&#101&#114&#32&#100&#117&#114&#105&#110&#103&#32&#108&#111&#99&#97&#108&#13&#10&#116&#101&#115&#116&#115&#41&#34&#59&#13&#10&#125&#13&#10&#101&#108&#115&#101&#13&#10&#123&#13&#10&#36&#104&#116&#109&#108&#95&#102&#111&#111&#116&#101&#114&#32&#61&#32&#60&#60&#60&#95&#95&#87&#72&#65&#84&#69&#86&#69&#82&#95&#89&#79&#85&#95&#87&#65&#78&#84&#95&#84&#79&#95&#77&#65&#75&#69&#95&#73&#84&#95&#83&#84&#79&#80&#95&#95&#13&#10&#45&#32&#118&#105&#115&#105&#116&#32&#99&#111&#117&#110&#116&#101&#114&#32&#97&#99&#99&#101&#115&#32&#99&#111&#100&#101&#32&#105&#115&#32&#110&#111&#114&#109&#97&#108&#108&#121&#32&#104&#101&#114&#101&#32&#45&#32&#98&#117&#116&#32&#110&#111&#116&#32&#99&#111&#112&#105&#101&#100&#32&#104&#101&#114&#101&#32&#116&#111&#13&#10&#114&#101&#100&#117&#99&#101&#32&#116&#104&#101&#32&#108&#101&#110&#103&#116&#104&#32&#111&#102&#32&#116&#104&#105&#115&#32&#110&#101&#119&#115&#103&#114&#111&#117&#112&#32&#112&#111&#115&#116&#32&#45&#13&#10&#95&#95&#87&#72&#65&#84&#69&#86&#69&#82&#95&#89&#79&#85&#95&#87&#65&#78&#84&#95&#84&#79&#95&#77&#65&#75&#69&#95&#73&#84&#95&#83&#84&#79&#80&#95&#95&#59&#13&#10&#32&#125&#13&#10&#101&#99&#104&#111&#32&#36&#104&#116&#109&#108&#95&#102&#111&#111&#116&#101&#114&#59&#13&#10&#63&#62
    </noscript>


    --
    Robb | Shared Secrets Usenet
    Robb, Feb 13, 2009
    #4
  5. On 13 Feb 2009 16:52:59 GMT, Robb <> wrote:

    >Raymond Schmit wrote:
    >
    >> Thanks for answering, but i did not understand what to do.
    >>
    >> The text i posted is just the visit counter part of a 'normal' webpage.
    >> This the only php part, all the rest are html language. I did not have
    >> apache installed on my localhost and i did not know, at my isp websapce,
    >> what webserver is running.

    >
    >
    >Place this in a new PHP file:
    >
    ><?php phpinfo(); ?>
    >
    >Save as phpinfo.php
    >
    >Upload it to the server, then use your browser to get it from your
    >domain: www.yourdomain.com/phpinfo.php
    >
    >The page will output the configuration information, if it's a running site,
    >save the page output and delete phpinfo.php. You can't protect a page with
    >php easily.
    >
    >Here's an encoded javascript version of the script that *may* help,
    >it is reversible though. Place it below your current counter and view
    >source, then remove the old code if you decide to keep it.
    >
    ><script type="text/javascript">
    ><!--
    >var s="=@qiq %nziptu!>!%`TFSWFS\\#IUUQ`IPTU#^!< jg!)%nziptu>>#mpdbmiptu#* | %iunm`gppufs!>!#.!1!.!)up!opu!joufsgfsf!uif!wjtju!dpvoufs!evsjoh!mpdbm uftut*#< ~ fmtf | %iunm`gppufs!>!===``XIBUFWFS`ZPV`XBOU`UP`NBLF`JU`TUPQ`` .!wjtju!dpvoufs!bddft!dpef!jt!opsnbmmz!ifsf!.!cvu!opu!dpqjfe!ifsf!up sfevdf!uif!mfohui!pg!uijt!ofxthspvq!qptu!. ``XIBUFWFS`ZPV`XBOU`UP`NBLF`JU`TUPQ``< !~ fdip!%iunm`gppufs< @?";
    >m=""; for (i=0; i<s.length; i++) m+=String.fromCharCode(s.charCodeAt(i)-1); document.write(m);
    >//-->
    ></script>
    ><noscript>
    >&#60&#63&#112&#104&#112&#13&#10&#36&#109&#121&#104&#111&#115&#116&#32&#61&#32&#36&#95&#83&#69&#82&#86&#69&#82&#91&#34&#72&#84&#84&#80&#95&#72&#79&#83&#84&#34&#93&#32&#59&#13&#10&#105&#102&#32&#40&#36&#109&#121&#104&#111&#115&#116&#61&#61&#34&#108&#111&#99&#97&#108&#104&#111&#115&#116&#34&#41&#13&#10&#123&#13&#10&#36&#104&#116&#109&#108&#95&#102&#111&#111&#116&#101&#114&#32&#61&#32&#34&#45&#32&#48&#32&#45&#32&#40&#116&#111&#32&#110&#111&#116&#32&#105&#110&#116&#101&#114&#102&#101&#114&#101&#32&#116&#104&#101&#32&#118&#105&#115&#105&#116&#32&#99&#111&#117&#110&#116&#101&#114&#32&#100&#117&#114&#105&#110&#103&#32&#108&#111&#99&#97&#108&#13&#10&#116&#101&#115&#116&#115&#41&#34&#59&#13&#10&#125&#13&#10&#101&#108&#115&#101&#13&#10&#123&#13&#10&#36&#104&#116&#109&#108&#95&#102&#111&#111&#116&#101&#114&#32&#61&#32&#60&#60&#60&#95&#95&#87&#72&#65&#84&#69&#86&#69&#82&#95&#89&#79&#85&#95&#87&#65&#78&#84&#95&#84&#79&#95&#77&#65&#75&#69&#95&#73&#84&#95&#83&#84&#79&#80&#95&#95&#13&#10&#45&#32&#11

    8
    >&#105&#115&#105&#116&#32&#99&#111&#117&#110&#116&#101&#114&#32&#97&#99&#99&#101&#115&#32&#99&#111&#100&#101&#32&#105&#115&#32&#110&#111&#114&#109&#97&#108&#108&#121&#32&#104&#101&#114&#101&#32&#45&#32&#98&#117&#116&#32&#110&#111&#116&#32&#99&#111&#112&#105&#101&#100&#32&#104&#101&#114&#101&#32&#116&#111&#13&#10&#114&#101&#100&#117&#99&#101&#32&#116&#104&#101&#32&#108&#101&#110&#103&#116&#104&#32&#111&#102&#32&#116&#104&#105&#115&#32&#110&#101&#119&#115&#103&#114&#111&#117&#112&#32&#112&#111&#115&#116&#32&#45&#13&#10&#95&#95&#87&#72&#65&#84&#69&#86&#69&#82&#95&#89&#79&#85&#95&#87&#65&#78&#84&#95&#84&#79&#95&#77&#65&#75&#69&#95&#73&#84&#95&#83&#84&#79&#80&#95&#95&#59&#13&#10&#32&#125&#13&#10&#101&#99&#104&#111&#32&#36&#104&#116&#109&#108&#95&#102&#111&#111&#116&#101&#114&#59&#13&#10&#63&#62
    ></noscript>



    Thanks for the info ...i finally found what could be done .... using
    javascript instead of php:
    if(window.location.hostname != 'localhost'){
    document.write("<counter html code>");
    }

    without forgetting to update with: .... AND != '127.0.0.1' AND != ''
    Raymond Schmit, Feb 14, 2009
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. The Eeediot
    Replies:
    3
    Views:
    2,226
    =?Utf-8?B?UnVsaW4gSG9uZw==?=
    Dec 22, 2004
  2. Alexander Malkis
    Replies:
    8
    Views:
    519
    Alexander Malkis
    Apr 14, 2004
  3. Roger23
    Replies:
    2
    Views:
    997
    Roger23
    Oct 12, 2006
  4. George2
    Replies:
    1
    Views:
    795
    Alf P. Steinbach
    Jan 31, 2008
  5. Gus

    How to avoid URL direct access?

    Gus, Oct 15, 2006, in forum: ASP .Net Security
    Replies:
    2
    Views:
    212
Loading...

Share This Page