General discussions : Non mobile discussion : counter on website question - IIS question added
>
New Topic
>
Reply<
Esato Forum Index
>
General discussions >
Non mobile discussion
> counter on website question - IIS question added
Bookmark topic
Run that "query" in a mysql interface, i use phpmyadmin. I suggest you install it,
http://www.phpmyadmin.net/home_page/
EDIT: Re-copy the script, i made a small change in the counter.php file.
_________________
JPortal Beta
http://beta.johnex.se
------------------------
Test it out now!
------------------------
Formerly known as JohnN4
[ This Message was edited by: Johnex on 2005-11-02 19:19 ]
--
Posted: 2005-11-02 20:16:00
Edit :
Quote
EastCoastStar Posts: > 500
the guys im workin with dont want me to get in with the SQL server, becuase they run alot on their SQL, and they are worried something might get messed up :- im looking for a non SSI and non mySQL solution :-\ hrm...
this would be so much easier if i was at home and could do it the way i wanted to

hahaha
[ This Message was edited by: eastcoaststar on 2005-11-02 19:31 ]
--
Posted: 2005-11-02 20:26:25
Edit :
Quote
k, one sec then......
--
Posted: 2005-11-02 20:29:38
Edit :
Quote
EastCoastStar Posts: > 500
thanks, i owe you!
--
Posted: 2005-11-02 20:34:17
Edit :
Quote
// PHP Counter © Johnex 2005
//=============================
//=======================//
// File: counter.php //
//=======================//
// Paste the following into
// a new file in notepad,
// save with "File Name"
// counter.php , and "Save
// As Type" as "All Files".
// Change the variables
// below to match your
// mysql settings.
//=========================
// Make File, Read Count, Add 1, Write New Count
if(file_exists('count_file.txt')) {
$count_file = fopen('count_file.txt', r);
$count = fread($count_file, filesize('count_file.txt'));
$new_count = $count+1;
fclose($count_file);
$count_file = fopen('count_file.txt', w);
fwrite($count_file,$new_count);
fclose($count_file);
} else {
$count_file = fopen('count_file.txt', w);
fwrite($count_file, 1);
$new_count = '1';
fclose($count_file);
}
// Print
print'
<!--
function writeContent() {
'."document.getElementById('counter').innerHTML = '<b>Hits: $new_count</b>';".'
}
writeContent();
//-->
';
//=======================//
// HTML //
//=======================//
// Paste the code bellow where
// you want the counter to be
// displayed. Change the
// "src" to the folder where
// you put the counter.php
// file
===========================
<div id="counter"></div>
<scrpt type="text/javascript" src="counter.php"></script>
//=============================
Flat File Version
_________________
JPortal Beta
http://beta.johnex.se
------------------------
Test it out now!
------------------------
Formerly known as JohnN4
[ This Message was edited by: Johnex on 2005-11-03 15:02 ]
--
Posted: 2005-11-02 20:36:28
Edit :
Quote
EastCoastStar Posts: > 500
i know im giving you a hard time here! haha but...
// Make File, Read Count, Add 1, Write New Count
im not running an FTP... so how can u chance the permissions? (read count, add one, write new count)
edit: im beginning to think the server i am working with is crap

hahaha
_________________
check out the site guys.
www.editionfws.com
Proud Owner: T61d, T610 X 3, T630 X 2, a new S710
Moto V400, V600
Brand New PSP: Midnight Club 3 and Ape Escape (for my gf)
[ This Message was edited by: EastCoastStar on 2005-11-02 19:43 ]
--
Posted: 2005-11-02 20:40:38
Edit :
Quote
EastCoastStar Posts: > 500
see, i was trying with PHP, then i realized PHP wasnt installed in the IIS (becuase im running this through the server thats right next to me, i didnt buy webspace), so i installed and configured php5 to IIS 5.1 successfully. but the i right click a file, and try to change the permissions, and it wont let me. That makes no sence to me why it wont let me chance permissions to a file. Then, They dont want me to use MySQL/SQL... and in order to use MOST CGI and PHP scripts, i have to change permissions... so they are telling me there is a way to easily run a counter straight out of the server, but they dont know how to do it... hrm... ::screams::
--
Posted: 2005-11-02 20:58:46
Edit :
Quote
errr........i an change the permissions in php, but that would have to be done on every change, slowing down the site......do you really need to change the perms? the default 755 is fine.....people can view the count_file, but who cares! It will show on the site anyway...
--
Posted: 2005-11-02 21:03:08
Edit :
Quote
EastCoastStar Posts: > 500
i thought i needed to in order for it to work... hrm...
so all i have to do is... add all that into 'counter.php' that parts easy... then make the blank file called 'count_file.txt' then add the HTML onto the main index, and it should work fine, right? (btw, whered ur HTML to add go?!? lol)
and again, i apologize for makin this hard on you! lol
--
Posted: 2005-11-02 21:06:54
Edit :
Quote
Yeah, it should work

. Use the previous posted html, but change the position of the two lines. First the div line, then the script line. EDIT: let me know how it goes

.
[ This Message was edited by: Johnex on 2005-11-02 20:41 ]
--
Posted: 2005-11-02 21:38:58
Edit :
Quote
New Topic
Reply