ly
because of what CTRL-Z can do on non-safe systems!)
=dn
(who file-opened in binary, just in case!)
> >-Original Message-
> >From: DL Neil [mailto:[EMAIL PROTECTED]]
> >Sent: Thursday, February 14, 2002 2:04 PM
> >To: Svensson, B.A.T. (HKG); [EMAIL PROTECTED]
>
/Anders - who was tempted to sporadically insert some ctrl-Z in this
message. :)
>-Original Message-
>From: DL Neil [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, February 14, 2002 2:04 PM
>To: Svensson, B.A.T. (HKG); [EMAIL PROTECTED]
>Cc: 'alain'
>Subject: Re: [P
Sorry B.A.T,
Alain's quote is taken directly from http://www.php.net/manual/en/function.fopen.php
Using/not "b" does make a difference under Windows - haven't tested it under *nix!
The 'end' of a Windows file can be defined in two ways: an ASCII file ends with
CTRL+Z, a 'binary' file ends
wher
ERRATA:
>neither CC, cc, gcc or g++ does in this behavior.
Should be:
neither CC, cc, gcc or g++ does inherent this behavior.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
From: alain
>From the manual - Last thing to read ;)
>"Note: The mode may contain the letter 'b'. This is useful only on systems
>which differentiate between binary and text files (i.e. Windows. It's
>useless on Unix). If not needed, this will be ignored. "
If UNIX system doesn't difference betw
Don't turst that. Word can saw back up information in the (very same)
document to.
-Original Message-
From: Ross Fleming
To: Todd Williamsen; 'alain'
Cc: [EMAIL PROTECTED]
Sent: 11-2-02 18:30
Subject: RE: [PHP-WIN] Re: Searching MS Word Docs
Erm... why are you here
to present to them!
>
> I am sure I am not the only one that could/would use this!
>
>
>
> -Original Message-
> From: Ross Fleming [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 11, 2002 11:30 AM
> To: Todd Williamsen; 'alain'
> Cc: [EMAIL PR
MS Word document are binary.
From: Todd Williamsen
>I have no idea if its ASCII formatted or not. I wonder if there is a way
to
>find out?
>
>
>"Nicole Amashta" wrote in message
>> OK, I am not exactly sure of the format of word docs off hand. But if
they
>> are an ascii format, you can just
Say you entere keywords on the form. If you enter more than one word, you
need to break them up before using the regex.
This is good for one word at a time, other wise your search will be to
specific.
So, let a user add comma separated or space separated keywords like so:
ex1.programmer, ph
I was using a word I saw in the resume... so I know it exists
"Nicole Amashta" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> What keywords are being used? IF they aren't found, then nothing is being
> printed out. YOu need to add the else clause to this:
>
> i
What keywords are being used? IF they aren't found, then nothing is being
printed out. YOu need to add the else clause to this:
if ( eregi (. ) ) {
}
else { ## add this to catch if keywords not found for debugging purposes at
least so you see what is not found
echo "The keywords $keywords
here is the code:
returns nothing, not even an error... the process is fast too, so I know it
isn't doing anything...
GRR!
0)
{
while ($row = mysql_fetch_array($result))
{
$id = $row['id'];
$FirstName = $row['FirstName'];
$LastName = $row['LastName'];
$filename = $row['ResumeUp'];
$fd =
fopen(
> > Aren't you suppose to do the array before doing the $numrows?
not in this case. Mysql already returned the number of rows, so i use the
mysql function to get the number of rows.
then, i use the result pointer to return a record as an array for each
record in the result set returned.
-nicol
I tried that too, and it returns nothing
"Nicole Amashta" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >>while ($row = mysql_fetch_array($row))
>
> Sorry, that should be:
>
> while ($row = mysql_fetch_array($result))
>
> =[
>
>
>
> "Todd Williamsen" <[EMAIL
>>while ($row = mysql_fetch_array($row))
Sorry, that should be:
while ($row = mysql_fetch_array($result))
=[
"Todd Williamsen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Nicole
>
> It doesn't like this line:
>
> while ($row = mysql_fetch_array($row))
Nicole
It doesn't like this line:
while ($row = mysql_fetch_array($row))
Aren't you suppose to do the array before doing the $numrows?
"Nicole Amashta" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Of course, I was quick to send w/out checking for errors,
Yeah, your query was specifying just one file. The query I sent you will
grab alll the resumes in the table.
"Todd Williamsen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Well, it did the search... but only checked one file... lol!
>
> I did the query wro
Well, it did the search... but only checked one file... lol!
I did the query wrong... I tried something too complex!
I will try yours in a bit.. I want to find a key word that it would return a
result
"Nicole Amashta" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED
Of course, I was quick to send w/out checking for errors, so here again is
corrected:
==
0 )
{
while( $row = mysql_fetch_array($row) )
{
$filename = $row["filename"];
$fd = fopen($filename, "r");
$contents = fread($fd, filesize($filename));
fclose($
IF $ResumeUp is the actual path and filename to the file you want to search,
then that can work.
For each file retrieved from your table, you can search the file for the
keywords.
Pretend you have the table called resume ( I am also assuming you are using
mysql database )
create table resume(i
ok... so for me I would do this... just wanted to confirm it.
$filename = "$ResumeUp"; /// the file name variable stored in the DB
$fd = fopen($filename, "r");
$contents = fread($fd, filesize($filename));
fclose($fd);
$keyword = "$words"; /// $words = the search word(s) from the form
if(ere
Here is an example:
--
$filename = "thefile.doc";
$fd = fopen ( $filename, "r" );
$contents = fread ( $fd, filesize($filename) ); ## contents of file are
now in a string
fclose ($fd);
## now, since you have contents of file in string $contents, you can
interesting... cool eh?
i will give it a whirl...
now I got to figure out the regex function
"Nicole Amashta" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I made a test file in word. It's funky, but it still has the actual text
in
> ascii. You should - j
I made a test file in word. It's funky, but it still has the actual text in
ascii. You should - just an assumption - be able to open the doc with php
and read through the file doing a keyword search.
Can't hurt to experiment with it.
good luck,
Nicole Amashta
www.aeontrek.com
"Todd Williamsen"
Nicole,
I have no idea if its ASCII formatted or not. I wonder if there is a way to
find out?
"Nicole Amashta" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> OK, I am not exactly sure of the format of word docs off hand. But if they
> are an ascii format, y
OK, I am not exactly sure of the format of word docs off hand. But if they
are an ascii format, you can just read through the file using PHP and use
regular expressions to search for the words. Just a suggestion.
That's just if it's ascii format. Read the whole file into a string, then
search the
26 matches
Mail list logo