Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 06-01-2005, 05:24 PM PHP Script Help
Novice Talker

Posts: 6
Trades: 0
Hello all.
I have a log that I wish to extract certain peices of information from.

Here is one line from the log:

Quote:
M 05/31/2005 - 01:42:37: CONSOLE : System vote set nextmap to de_dust2
M 05/31/2005 - 01:47:06: CONSOLE : team balanced user [Chefkoch540] [STEAM_0:1:5059XXX]
M 05/31/2005 - 01:48:10: CONSOLE : team balanced user [UC || James [T]] [STEAM_0:1:7599XXX]
M 05/31/2005 - 02:16:53: CONSOLE : Banned (Hack detected) [KO-JACK] [STEAM_0:1:728XXX] banid 0 68 kick
M 05/31/2005 - 02:37:09: CONSOLE : team balanced user [cakes] [STEAM_0:0:1572XXX]
M 05/31/2005 - 02:40:51: CONSOLE : team balanced user [UC || James [T]] [STEAM_0:1:7599XXX]
I wish to take the line with the words Hack Detected in it and then extract certain parts from that line to put on a website.

I have made a variable for the hack detection line with the information I need as varibles.

Quote:
M 05/31/2005 - 02:16:53: CONSOLE : Banned (Hack detected) [KO-JACK] [STEAM_0:1:728XXX] banid 0 68 kick
M $date - $time: CONSOLE : $type (Hack detected) [$name] [$id] banid 0 242 kick
The last section of that line taken from the login "0 242" changes each time as the 0 is the ban time and the 242 is in the ingame id. The banid and kick will always be there.

I want to put the information taken from this line and put it in a table.

As such:

Quote:
$date | $time | $name | $id
So, basically I want the scripts to pull the certain aspects of lines containing hack Detected and put the information in a table.

Last edited by Kemik; 06-01-2005 at 05:26 PM..
Kemik is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-01-2005, 05:31 PM
Marvin Le Rouge's Avatar
Skilled Talker

Posts: 52
Trades: 0
What you need is regular expressions. Throw a look at PCRE section in the online php manual.
Marvin Le Rouge is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP Script Help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10107 seconds with 12 queries