How to avoid an access to the counter ?

R

Raymond Schmit

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)
 
R

Robb

Raymond said:
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
 
R

Raymond Schmit

Raymond said:
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-Assura...456&zero=1&background=&stats=1&txt=&session=1">
</script>

may be we can modify the script if the page in on the localhost
computer...
 
R

Robb

Raymond said:
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>
 
R

Raymond Schmit

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 != ''
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top