Hi,
This is my script:
(ryan_debug_write_to_file is my debug function that
writes stuff into a txt file instead of using a
print(), its working without a problem)
------------------------------
$stdin = fopen('php://stdin', 'r');
while ($line = fgets($stdin))
{
$line=trim($line);
ryan_debug_write_to_file('In while(),STDIN,
Start..'.$line.'---End ');
$pattern="/^(\d+\.\d+\.\d+\.\d+)\|(.+)\|(\d+)\|([\d-]+)\|(.+)\|(.+)$/";
if (preg_match($pattern,$line,$m))
/*\|(.+)\|(.+)*/
{
ryan_debug_write_to_file('Now in Preg match!');
/* This does not execute for some reason....ARRRRGH*/
....more code here
}
------------------------------
The problem is I never get the "Now in Preg match"
message... I have checked the preg_match by taking the
data and putting it in a file and reading it from
there like this:
-----------------------------------
<pre>
<?php
$stdin = fopen("test.txt", "r");
while ($line = fgets($stdin))
{
$line=trim($line);
echo '<b>In while(),Start..'.$line.'---End of
stdin<br></b>';
$pattern="/^(\d+\.\d+\.\d+\.\d+)\|(.+)\|(\d+)\|([\d-]+)\|(.+)\|(.+)$/";
if (preg_match($pattern,$line,$m))
/*\|(.+)\|(.+)*/
{
echo 'Now in Preg match!<br>';
}
}
?>
</pre>
-----------------------------------
and it works perfectly, so wheres the damn problem on
top? Spent the better part of 3 hours trying to find
the problem.
(you can download the test.txt script from
ezee.se/test/test.txt) basically, the preg_match is to
match this:
193.150.249.47|-|200|188|/usr/local/www/om/www/pass/coin|-
If you want to see the whole script you can download
it from ezee.se/test/coinpass_problem.php.txt
So pissed I want to take a print out of the script and
burn the sh*t.
Any help appreciated.
Thanks,
Ryan
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
-----
Fight back spam! Download the Blue Frog.
http://www.bluesecurity.com/register/s?user=bXVzaWNndTc%3D
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php