Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How to avoid an access to the counter ?

Reply
Thread Tools

How to avoid an access to the counter ?

 
 
Raymond Schmit
Guest
Posts: n/a
 
      02-12-2009
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)
 
Reply With Quote
 
 
 
 
Robb
Guest
Posts: n/a
 
      02-12-2009
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
 
Reply With Quote
 
 
 
 
Raymond Schmit
Guest
Posts: n/a
 
      02-12-2009
On 12 Feb 2009 10:09:51 GMT, Robb <(E-Mail Removed)> 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...

 
Reply With Quote
 
Robb
Guest
Posts: n/a
 
      02-13-2009
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!.!)u p!opu!joufsgfsf!uif!wjtju!dpvoufs!evsjoh!mpdbm uf tut*#< ~ fmtf | %iunm`gppufs!>!===``XIBUFWFS`Z PV`XBOU`UP`NBLF`JU`TUPQ`` .!wjtju!dpvoufs!bddft!d pef!jt!opsnbmmz!ifsf!.!cvu!opu!dpqjfe!ifsf!up sfe vdf!uif!mfohui!pg!uijt!ofxthspvq!qptu!. ``XIBUFWF S`ZPV`XBOU`UP`NBLF`JU`TUPQ``< !~ fdip!%iunm`gppu fs< @?";
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
 
Reply With Quote
 
Raymond Schmit
Guest
Posts: n/a
 
      02-14-2009
On 13 Feb 2009 16:52:59 GMT, Robb <(E-Mail Removed)> 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!.!)u p!opu!joufsgfsf!uif!wjtju!dpvoufs!evsjoh!mpdbm uf tut*#< ~ fmtf | %iunm`gppufs!>!===``XIBUFWFS`Z PV`XBOU`UP`NBLF`JU`TUPQ`` .!wjtju!dpvoufs!bddft!d pef!jt!opsnbmmz!ifsf!.!cvu!opu!dpqjfe!ifsf!up sfe vdf!uif!mfohui!pg!uijt!ofxthspvq!qptu!. ``XIBUFWF S`ZPV`XBOU`UP`NBLF`JU`TUPQ``< !~ fdip!%iunm`gppu fs< @?";
>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 != ''


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Page File counter and Private Bytes Counter George2 C++ 1 01-31-2008 09:27 AM
Avoid having a SQL express for web parts and avoid personalization Roger23 ASP .Net 2 10-12-2006 10:54 PM
Session("counter") vs. ViewState("counter")...a newbie question The Eeediot ASP .Net 3 12-22-2004 09:31 PM
Avoid wasting time or how to avoid initialization Alexander Malkis C++ 8 04-13-2004 11:23 PM



Advertisments