Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

75 users online



i am going insane

i am going insane

Currently viewing this thread: 1 (0 members and 1 guests)


mo_jam

mo_jam

none
Status: Offline!

i am going insane

Hi guys,
it may sound stupid that is because you know it but for me it drives me insane. Sometimes I read some tutorials in which their explanations are based on unix. I cannot stop reading them because i choose to study php.
I have a counter code to do the counting of users on my page. Here is it:
<?php
$dfile = "count_data.txt";
if(file_exists($dfile)) {
$inf = fopen($dfile, "r");
$count = fread($inf, 10);
$count = (int)$count;
$count++;
fclose($inf);
$outf = fopen($dfile, "w");
fputs($outf, $count);
fclose($outf); }
else { echo "File, $dfile, not found!"; } ?>
<center>
You are the
<?
echo $count;
$rem = $count % 10;
if (($rem >= 1) && ($rem <= 3)) {
if((($count % 100) >= 11) && (($count % 100) <= 13)) {
echo "th "; }
else {
switch ($rem) {
case (1): { echo "st "; break;}
case (2): { echo "nd "; break;}
case (3): { echo "rd "; break;}
default : { break; }
}
}
}
else { echo "th "; } ?>
visitor since --insert date here-- .
</center>
Now the question is how to use it on the php page and what exactly is the equivalent of this command in windows
chmod 666 public_html/count_data.txt
Thanks
Mo Jam

___________________

:hmm

Oxy

Oxy

Neverside Newbie
Status: Offline!

You don't need to CHMOD on windows, but be sure to check that count_data.txt is not set to read only Smile

___________________

RAAAH

Utopia

Utopia

A few details cannot sum me up
Status: Offline!

theres no such thing as chmod in windows.

you have read, write, modify, change, full control.

read and write should satisfy most scripts under windows.

___________________

Matt M
Webmaster, Web Developer and Relaxation expert
- Free web development tutorials, scripts and more..
- Top 10 webmaster articles
- Nowt here, but I own the domain for something in the future.....

"Life's gotta be fun, if its not its crap." - Pritchard, Dirty Sanchez

teamdbr

teamdbr

Status: Offline!

You can use the code:

PHP:


<?PHP
chmod 
("file.ext"755);
?>

Make it give error traping by using this code:

PHP:


<?PHP
if(chmod ("file.ext"755)){
echo(
"Ok");
} else {
echo(
"Not Ok!");
}
?>

Smile Ben Smile

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0076 seconds.