PHP code ? $logpath = "logs"

Status
Not open for further replies.

holeepassion

New Member
Messages
110
Reaction score
0
Points
0
when I tried to load the php page for submitting info from users online. I have this issue of invalid message:

Parse error: syntax error, unexpected ':' in /home/holeepas/public_html/mailcode-includes/config.inc.php on line 94

Line 94 contains the

$logpath = "logs"

Do I need to provide the directory for the logs ? so where should I put it in ?

Thanks ...
Holeepassion.com administrator
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
Try the line before; PHP and other languages sometimes display an error on the line after that has code on it.

Example:

Code:
$php="this is an error because I'm going to forget my semicolon"
$php2="and this is where the error is shown as being.";

Unexpected ":" sounds like you maybe have a colon instead of a semi-colon on the line before the indicated one; see if it's missing a ; at the end of the previous line :)
 
Last edited:

holeepassion

New Member
Messages
110
Reaction score
0
Points
0
Thanks for that Livewire .. solved that issue

Now i have another one arggggggggggghhhhhhhhhhhhhhhhhhhhh pulling my hair out !!!

Warning: fopen(logs/2007-11-16.txt) [function.fopen]: failed to open stream: No such file or directory in /home/holeepas/public_html/mailcode-includes/mailer.php on line 43
Error opening file


line 43 ....
$fh = fopen("$logpath/$timestamp.txt", "a+") or die( "Error opening file" );
if (!fwrite($fh, $logmsg)) { die( "Error writing to file!" ); }
if (!fwrite($fh, "\n---------------\n\n")) { die( "Error writing to file!" ); }
fclose($fh) or die( "Error closing file!" );
 
Last edited:

holeepassion

New Member
Messages
110
Reaction score
0
Points
0
Where is $logpath set?

not sure what you mean but if you mean after $logpath = "logs"
does this mean anything to you ?

should give to you the whole code ? I just use some free codes so not particularly know much about PHP

thanks
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Did you create the directory logs? Also make sure it's chmod is 755, as you need to be able to write to it.

If that doesn't work, feel free to re-open this.
 
Status
Not open for further replies.
Top