php-windows Digest 21 May 2002 19:01:23 -0000 Issue 1155
Topics (messages 13880 through 13893):
Negative timestamp
13880 by: Karin van den Berg
13881 by: Rasmus Lerdorf
Bits
13882 by: Michael Reynolds
secure mail
13883 by: Rutger
Searching for many keywords simultaneously
13884 by: R.S. Herhuth
13885 by: Asendorf, John
13890 by: Scott Hurring
PHP and JavaScript
13886 by: Opere, James
world cup
13887 by: arthur franco
13888 by: Richard Black
Cache and Apache2?
13889 by: scott.eesco.com
COM Problem
13891 by: R.S. Herhuth
13892 by: Scott Hurring
13893 by: Scott Hurring
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hi,
I have a bit of a problem. I am trying to use a negative timestamp in
order to handle a birthdate. However, on my Win2k install, it doesn't
seem to work. I tried it on different PHP versions on different
machines, and I get an error each time i try to convert a datestring
before 1970 to timestamp. On a linux machine it works fine.
Is there a way around this? Or is this just another limitation of
running php on windows.?
Karin
--- End Message ---
--- Begin Message ---
It is a limitation on Windows.
On Mon, 20 May 2002, Karin van den Berg wrote:
> Hi,
>
> I have a bit of a problem. I am trying to use a negative timestamp in
> order to handle a birthdate. However, on my Win2k install, it doesn't
> seem to work. I tried it on different PHP versions on different
> machines, and I get an error each time i try to convert a datestring
> before 1970 to timestamp. On a linux machine it works fine.
> Is there a way around this? Or is this just another limitation of
> running php on windows.?
>
> Karin
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Are there any functions or operators, which will modify bits in a
variable? If so, which? For example, if I were to use C to set bit 4 on
for variable bit_set, I would use 'bit_set |= 4'.
__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
--- End Message ---
--- Begin Message ---
I have question.
I 've made a site with the possibility to send a mail with a formmail to the
webmaster, it uses PHP.
On this site you can buy products, and in the form, you must also fill in
you bank account number.
So what I want is that this mail will be send Secure!
Is that possible, and how
I hope someone can help me out
Thanks in advance
R.
--- End Message ---
--- Begin Message ---
I have a search and replace where the search for consists of 300 words.
Luckily this will only have to be done when a user uploads a file. The
file may contain several hundred words itself. My question is what is
the best way to approach searching for this many words? Should I use
an array and loop through the file for each of the search words? Or is
there a more efficient method?
Thanks,
Ron
--- End Message ---
--- Begin Message ---
Here is something that may help. It looks like a good start
http://www.phpbuilder.com/forum/read.php3?num=2&id=132692&thread=132689
---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit
> -----Original Message-----
> From: R.S. Herhuth [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 21, 2002 8:40 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Searching for many keywords simultaneously
>
>
>
> I have a search and replace where the search for consists of
> 300 words.
> Luckily this will only have to be done when a user uploads a
> file. The
> file may contain several hundred words itself. My question is what is
> the best way to approach searching for this many words? Should I use
> an array and loop through the file for each of the search
> words? Or is
> there a more efficient method?
>
> Thanks,
> Ron
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Personally, i'd go with preg_replace and/or preg_match_all.
http://www.php.net/manual/en/function.preg-replace.php
They might not be the fastest way, but certainly one of the
easiest for the programmer.
---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515
> -----Original Message-----
> From: R.S. Herhuth [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 21, 2002 8:40 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Searching for many keywords simultaneously
>
>
>
> I have a search and replace where the search for consists of
> 300 words.
> Luckily this will only have to be done when a user uploads a
> file. The
> file may contain several hundred words itself. My question is what is
> the best way to approach searching for this many words? Should I use
> an array and loop through the file for each of the search
> words? Or is
> there a more efficient method?
>
> Thanks,
> Ron
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Following the ChainedSelectors example, i've been able to populate fields
popup menu using a table selected from the database.
Now i want to populate more than one fields popup menus.This should enable
me select more than one field from the same table and pass them as variables
to be used in the next script.I've tried to populate different fields from
same table but it doesn't work unless i have each field being populated by
each table i.e one to one relationsip.
Does anyone have any idea on how one can go about populating more than one
fields using one table in JavaScript/Php?
--- End Message ---
--- Begin Message ---
Does anyone have a world cup mysql database or a script in php that can
create the tables or the world cup?
--- End Message ---
--- Begin Message ---
What is it you're wanting to do??? I'm running a World Cup competition
online, at
http://www.arbee.co.uk/worldcup/
I've got a fairly simple db structure behind it, but it does contain the
teams and game information which might be a start.
Richy
PS If anyone wants to enter, feel free... No prizes though, just for fun...
==========================================
Richard Black
Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 435 3504
Email: [EMAIL PROTECTED]
-----Original Message-----
From: arthur franco [mailto:[EMAIL PROTECTED]]
Sent: 21 May 2002 14:17
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] world cup
Does anyone have a world cup mysql database or a script in php that can
create the tables or the world cup?
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello,
I have been experimenting with Apache2 on Win32, and have noticed something
different when I access pages - it seems like things are being cached
different.
For example, phpmyadmin does not work correctly. Its like I have to always
click the "reload mysql" link...
Stuff like that...
I also have a gallery application (photo gallery), and the setup php when I
run it loads, but when I click the button to go to step 2, its like it just
reloads the page instead of going to the next page... seeming to me like
it has the page cached, so its not going to step 2....
Please if you know what this might be, any help is appriciated!
Thanks!
--- End Message ---
--- Begin Message ---
I built a script that converts a Microsoft Word file to text and removes
common characters. The text will then be stored in a database for searching.
The script below has been behaving a bit odd. It worked this morning
but now all I get back is a blank screen and the text file it writes is
blank. This worked all day yeasterday and this morning but now it
stopped working. the script works fine if you manually save the Word
doc in the text format, but it wont write the text file. I built the
COM code by creating a Macro in Word and then analyzing it in a VB editor.
Can anyone see what the problem might be? It's driving me nuts.
<?php
// Filenames
$wordDoc = "BHresume.doc";
$textDoc = "BHresume.txt";
// Perform Word Doc Conversion
$word=new COM("Word.Application") or die("There was a problem launching
MS Word");
$word->visible = 1 ;
$word->Documents->Add();
// Open Word File
$word->Documents->Open->FileName[$wordDoc]->ConfirmConversions[False]->ReadOnly[False]->
AddToRecentFiles[False]->PasswordDocument[""]->PasswordTemplate[""]->Revert[False]->WritePasswordDocument[""]->WritePasswordTemplate[""]->Format["wdOpenFormatAuto"];
// Convert and save file as type=text
$word->ActiveDocument->SaveAs->FileName[$textDoc]->FileFormat["wdFormatText"]->LockComments[False]->Password[""]->AddToRecentFiles[True]->WritePassword[""]->ReadOnlyRecommended[False]->EmbedTrueTypeFonts[False]->SaveNativePictureFormat[False]->SaveFormsData[False]->SaveAsAOCELetter[False];
$word->Quit();
// Open the text doc
$fp = @fopen($textDoc,"ab+");
$fileText = fread($fp,8048);
fpassthru($fp);
// Array of common words
$commonWords= array("*"," the "," with "," but"," of "," every "," at
"," by "," and "," as "," their "," not", " an "," if "," or "," on ","
I "," in "," had "," on "," all "," a "," my ","
on "," up "," for "," each "," to "," etc "," that "," made ","
up","-",".",",",")","(");
$finalString = $fileText;
// Delete common words
for($i=0;$i<count($commonWords);$i++){
$finalString = str_replace($commonWords[$i]," ", $finalString);
}
// Print final string to screen
echo $finalString;
?>
Thanks for any help!
Ron
--- End Message ---
--- Begin Message ---
Well, first off, CTL+ALT+DEL and see if you have any zombie
procs of MSword laying around and kill them. When i was
developing an Excel COM program, the EXCEL.exe would hang
around in memory and screw up the "legit" EXCEL process
(beucase of issues with the COM implementation < 4.2.1)
Lines like this are just asking for trouble:
> $word->Documents->Open->FileName[$wordDoc]->ConfirmConversions
> [False]->ReadOnly[False]->
> AddToRecentFiles[False]->PasswordDocument[""]->PasswordTemplat
> e[""]->Revert[False]->WritePasswordDocument[""]->WritePassword
> Template[""]->Format["wdOpenFormatAuto"];
I know it's a pain, but try splitting that up into one-call-per-line,
and then it'll be a pieced of cake to see where the error is.
*always* check error messages and return status of calls.
and upgrade to the newest version PHP (if not already running it).
---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515
> -----Original Message-----
> From: R.S. Herhuth [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 21, 2002 2:29 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] COM Problem
>
>
>
> I built a script that converts a Microsoft Word file to text
> and removes
> common characters. The text will then be stored in a
> database for searching.
>
> The script below has been behaving a bit odd. It worked this morning
> but now all I get back is a blank screen and the text file it
> writes is
> blank. This worked all day yeasterday and this morning but now it
> stopped working. the script works fine if you manually save the Word
> doc in the text format, but it wont write the text file. I built the
> COM code by creating a Macro in Word and then analyzing it in
> a VB editor.
>
> Can anyone see what the problem might be? It's driving me nuts.
>
> <?php
>
> // Filenames
> $wordDoc = "BHresume.doc";
> $textDoc = "BHresume.txt";
>
> // Perform Word Doc Conversion
> $word=new COM("Word.Application") or die("There was a problem
> launching
> MS Word");
>
> $word->visible = 1 ;
> $word->Documents->Add();
>
> // Open Word File
> $word->Documents->Open->FileName[$wordDoc]->ConfirmConversions
> [False]->ReadOnly[False]->
> AddToRecentFiles[False]->PasswordDocument[""]->PasswordTemplat
> e[""]->Revert[False]->WritePasswordDocument[""]->WritePassword
> Template[""]->Format["wdOpenFormatAuto"];
>
> // Convert and save file as type=text
> $word->ActiveDocument->SaveAs->FileName[$textDoc]->FileFormat[
> "wdFormatText"]->LockComments[False]->Password[""]->AddToRecen
> tFiles[True]->WritePassword[""]->ReadOnlyRecommended[False]->E
> mbedTrueTypeFonts[False]->SaveNativePictureFormat[False]->Save
> FormsData[False]->SaveAsAOCELetter[False];
>
> $word->Quit();
>
> // Open the text doc
> $fp = @fopen($textDoc,"ab+");
>
> $fileText = fread($fp,8048);
> fpassthru($fp);
>
> // Array of common words
> $commonWords= array("*"," the "," with "," but"," of "," every "," at
> "," by "," and "," as "," their "," not", " an "," if "," or
> "," on ","
> I "," in "," had "," on "," all "," a "," my ","
> on "," up "," for "," each "," to "," etc "," that "," made ","
> up","-",".",",",")","(");
>
> $finalString = $fileText;
>
> // Delete common words
> for($i=0;$i<count($commonWords);$i++){
> $finalString = str_replace($commonWords[$i]," ", $finalString);
> }
>
> // Print final string to screen
> echo $finalString;
> ?>
>
>
> Thanks for any help!
> Ron
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
You don't have to restart your computer, just Kill the
process.
The Excel COM Object won't print out error messages to
the screen, so if anything bad is happening, you
won't see it.
Check this out the object model and look for ways to get
error message info. from the object:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modcore/htm
l/deovrMicrosoftWord2000.asp
---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515
> -----Original Message-----
> From: R.S. Herhuth [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 21, 2002 2:53 PM
> To: Scott Hurring
> Subject: Re: [PHP-WIN] COM Problem
>
>
> Scott,
>
> Thanks for the quick reply.
>
> I checked for the zombie processes and as you suspected there were
> several...I restarted my computer.
>
> I converted the COM calls to a one per line format as you indicated.
>
> It still doesn't work, I get a blank screen with no errors...would the
> errors show up on screen like the rest of the php errors I get?
>
> I am running 4.2.1.
>
> Thanks for your help,
> Ron
>
>
>
>
> Scott Hurring wrote:
> >
> > Well, first off, CTL+ALT+DEL and see if you have any zombie
> > procs of MSword laying around and kill them. When i was
> > developing an Excel COM program, the EXCEL.exe would hang
> > around in memory and screw up the "legit" EXCEL process
> > (beucase of issues with the COM implementation < 4.2.1)
> >
> > Lines like this are just asking for trouble:
> >
> > > $word->Documents->Open->FileName[$wordDoc]->ConfirmConversions
> > > [False]->ReadOnly[False]->
> > > AddToRecentFiles[False]->PasswordDocument[""]->PasswordTemplat
> > > e[""]->Revert[False]->WritePasswordDocument[""]->WritePassword
> > > Template[""]->Format["wdOpenFormatAuto"];
> >
> > I know it's a pain, but try splitting that up into
> one-call-per-line,
> > and then it'll be a pieced of cake to see where the error is.
> >
> > *always* check error messages and return status of calls.
> >
> > and upgrade to the newest version PHP (if not already running it).
> >
> > ---
> > Scott Hurring
> > Systems Programmer
> > EAC Corporation
> > [EMAIL PROTECTED]
> > Voice: 201-462-2149
> > Fax: 201-288-1515
> >
> > > -----Original Message-----
> > > From: R.S. Herhuth [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, May 21, 2002 2:29 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP-WIN] COM Problem
> > >
> > >
> > >
> > > I built a script that converts a Microsoft Word file to text
> > > and removes
> > > common characters. The text will then be stored in a
> > > database for searching.
> > >
> > > The script below has been behaving a bit odd. It worked
> this morning
> > > but now all I get back is a blank screen and the text file it
> > > writes is
> > > blank. This worked all day yeasterday and this morning but now it
> > > stopped working. the script works fine if you manually
> save the Word
> > > doc in the text format, but it wont write the text file.
> I built the
> > > COM code by creating a Macro in Word and then analyzing it in
> > > a VB editor.
> > >
> > > Can anyone see what the problem might be? It's driving me nuts.
> > >
> > > <?php
> > >
> > > // Filenames
> > > $wordDoc = "BHresume.doc";
> > > $textDoc = "BHresume.txt";
> > >
> > > // Perform Word Doc Conversion
> > > $word=new COM("Word.Application") or die("There was a problem
> > > launching
> > > MS Word");
> > >
> > > $word->visible = 1 ;
> > > $word->Documents->Add();
> > >
> > > // Open Word File
> > > $word->Documents->Open->FileName[$wordDoc]->ConfirmConversions
> > > [False]->ReadOnly[False]->
> > > AddToRecentFiles[False]->PasswordDocument[""]->PasswordTemplat
> > > e[""]->Revert[False]->WritePasswordDocument[""]->WritePassword
> > > Template[""]->Format["wdOpenFormatAuto"];
> > >
> > > // Convert and save file as type=text
> > > $word->ActiveDocument->SaveAs->FileName[$textDoc]->FileFormat[
> > > "wdFormatText"]->LockComments[False]->Password[""]->AddToRecen
> > > tFiles[True]->WritePassword[""]->ReadOnlyRecommended[False]->E
> > > mbedTrueTypeFonts[False]->SaveNativePictureFormat[False]->Save
> > > FormsData[False]->SaveAsAOCELetter[False];
> > >
> > > $word->Quit();
> > >
> > > // Open the text doc
> > > $fp = @fopen($textDoc,"ab+");
> > >
> > > $fileText = fread($fp,8048);
> > > fpassthru($fp);
> > >
> > > // Array of common words
> > > $commonWords= array("*"," the "," with "," but"," of ","
> every "," at
> > > "," by "," and "," as "," their "," not", " an "," if "," or
> > > "," on ","
> > > I "," in "," had "," on "," all "," a "," my ","
> > > on "," up "," for "," each "," to "," etc "," that "," made ","
> > > up","-",".",",",")","(");
> > >
> > > $finalString = $fileText;
> > >
> > > // Delete common words
> > > for($i=0;$i<count($commonWords);$i++){
> > > $finalString = str_replace($commonWords[$i]," ", $finalString);
> > > }
> > >
> > > // Print final string to screen
> > > echo $finalString;
> > > ?>
> > >
> > >
> > > Thanks for any help!
> > > Ron
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---