473,405 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

PHP Dazed and confused!

ok I have been potring a CGI script to PHP but have run into a small problem. I can't seem to get the script to find my data file even though I used the same code just fine in other scripts.



[PHP]function counter(){
################################################## ###########
# Set program parameters here #
################################################## ###########

# List of IP addresses to ignore, add your own IP to the list
$ignoreme = array("127.0.0.2");

# Time (in minutes) to show the user as online after the last request
$keep_online_time = 15;

# Time (in minutes) to save the user's IP after the last request. The counter is only increased for unknown IPs.
$keep_in_log_time = 60;

# Directory of the counter templates (counter_xxx.html)
$templ_dir = "../counter/";

# Directory of the counter data (log.txt and count.txt)
$data_dir = "../counter/data/";

################################################## ###########
# Program starts here #
# GTCounter 1.1 by Wladimir Palant (http://www.gtchat.de/) #
################################################## ###########

$current_time = time();

$fp = fopen($data_dir."log.db", "a") or die("Couldn't open file log.db.");
flock($fp, LOCK_EX);[/PHP]

I just keep getting a file not found unless I remove all path information and have the data file in the root directory. For some reason the file log.db just can't be found.
May 18 '06 #1
1 1532
Banfa
9,065 Expert Mod 8TB
The code doesn't look wrong unless you have got the wrong capitalisation on counter or data or unless you have the attributes of ../counter/data set wrong so that you can not open a writable file.
May 18 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Haoyu Zhang | last post by:
Dear Friends, Python assignment is a reference assignment. However, I really can't explain the difference in the following example. When the object is a list, the assignment seems to be a...
1
by: Benny Ng | last post by:
Hi,All, Export Method: ------------------------------------------------------------------------- strFileNameExport = "Results" Response.Clear() Response.Buffer = True...
2
by: Daniel | last post by:
I'm new to .Net and all of its abilities so I hope this makes sense. Basically I'm confused on when is the appropriate time to use web forms controls vs. regular HTML. For example in ASP...
11
by: timmu | last post by:
Someone asked me a question about integer division and printf yesterday, I tell him he should do a casting to float/double before you do any interger division. But he doesn't think so, so I try...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.