Esato

Forum > General discussions > Non mobile discussion > counter on website question - IIS question added

Previous  123  Next
Author counter on website question - IIS question added
EastCoastStar
S700
Joined: Dec 07, 2003
Posts: > 500
From: orlando fl US
PM
Posted: 2005-11-02 20:40
Reply with quoteEdit/Delete This PostPrint this post
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 ]
EastCoastStar
S700
Joined: Dec 07, 2003
Posts: > 500
From: orlando fl US
PM
Posted: 2005-11-02 20:58
Reply with quoteEdit/Delete This PostPrint this post
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::
Its good to be back!
Johnex
P990
Joined: Nov 26, 2002
Posts: > 500
From: Stockholm/Sweden
PM, WWW
Posted: 2005-11-02 21:03
Reply with quoteEdit/Delete This PostPrint this post
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...
EastCoastStar
S700
Joined: Dec 07, 2003
Posts: > 500
From: orlando fl US
PM
Posted: 2005-11-02 21:06
Reply with quoteEdit/Delete This PostPrint this post
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
Its good to be back!
Johnex
P990
Joined: Nov 26, 2002
Posts: > 500
From: Stockholm/Sweden
PM, WWW
Posted: 2005-11-02 21:38
Reply with quoteEdit/Delete This PostPrint this post
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 ]
EastCoastStar
S700
Joined: Dec 07, 2003
Posts: > 500
From: orlando fl US
PM
Posted: 2005-11-02 21:54
Reply with quoteEdit/Delete This PostPrint this post
still nothing nothing loads on the page, its like i never put the code there, but its in the HTML
Its good to be back!
Johnex
P990
Joined: Nov 26, 2002
Posts: > 500
From: Stockholm/Sweden
PM, WWW
Posted: 2005-11-03 06:07
Reply with quoteEdit/Delete This PostPrint this post
Whats the address? Pm it to me.

This message was posted from a Z1010

EastCoastStar
S700
Joined: Dec 07, 2003
Posts: > 500
From: orlando fl US
PM
Posted: 2005-11-03 06:26
Reply with quoteEdit/Delete This PostPrint this post
you got PM
Its good to be back!
Johnex
P990
Joined: Nov 26, 2002
Posts: > 500
From: Stockholm/Sweden
PM, WWW
Posted: 2005-11-03 06:57
Reply with quoteEdit/Delete This PostPrint this post
So do you :-).:-):-)

This message was posted from a Z1010

EastCoastStar
S700
Joined: Dec 07, 2003
Posts: > 500
From: orlando fl US
PM
Posted: 2005-11-03 14:45
Reply with quoteEdit/Delete This PostPrint this post
and back at yaaaaa
Johnex
P990
Joined: Nov 26, 2002
Posts: > 500
From: Stockholm/Sweden
PM, WWW
Posted: 2005-11-03 15:23
Reply with quoteEdit/Delete This PostPrint this post
.....and yet again.
EastCoastStar
S700
Joined: Dec 07, 2003
Posts: > 500
From: orlando fl US
PM
Posted: 2005-11-03 15:37
Reply with quoteEdit/Delete This PostPrint this post
and back again... maybe haha idk if u saw it yet lol
Its good to be back!
Johnex
P990
Joined: Nov 26, 2002
Posts: > 500
From: Stockholm/Sweden
PM, WWW
Posted: 2005-11-03 16:02
Reply with quoteEdit/Delete This PostPrint this post
Johnex
P990
Joined: Nov 26, 2002
Posts: > 500
From: Stockholm/Sweden
PM, WWW
Posted: 2005-11-03 16:27
Reply with quoteEdit/Delete This PostPrint this post
// 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.
//=========================

<?
// PHP Counter v2.0 © Johnex 2005
//=============================

// 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 writeCounter() {
'."document.getElementById('counter').innerHTML = '<b>Hits: $new_count</b>';".'
}
//-->
';

?>

//=======================//
// HTML //
//=======================//
// Folow this "template", in the head
// tags of the source of the site write
// the script stuff, then, in the opening
// body tag, write the onload stuff.
// Lastly, paste the div stuff where
// you want the counter to be
// displayed. Change the
// "src" to the folder where
// the counter.php file is located
//===========================

<html>
<head>
<script type="text/javascript" src="counter.php"></script>
</head>
<body onload="writeCounter()">
<div id="counter"></div>
</body>
</html>

//=============================

Flat File Version v2.0

New changes to make it work, test it here: http://johnex.se/dev/counter/
EastCoastStar
S700
Joined: Dec 07, 2003
Posts: > 500
From: orlando fl US
PM
Posted: 2005-11-03 19:18
Reply with quoteEdit/Delete This PostPrint this post
almost got it... but... it wont increment for some odd reason?!? idk whats going on with it haha.
i want to try something, and see if it will work...

edit: hrm... still wont increment... i still get the 1 so i know it knows its there, but why it wont increment is beyond me...

[ This Message was edited by: EastCoastStar on 2005-11-03 18:21 ]
Access the forum with a mobile phone via esato.mobi