php-windows Digest 15 Nov 2001 12:29:06 -0000 Issue 855

Topics (messages 10414 through 10424):

Re: I need urgent problem help with php!
        10414 by: Ross Fleming
        10415 by: Ross Fleming
        10416 by: Ignatius Teo

Re: PHP and Lotus Notes
        10417 by: Richard Black

Re: [PHP-I18N] Re: [PHP-WIN] how to get php_gettext.dll work on windows2000 / iis5 
server?
        10418 by: Hace
        10423 by: Hace

apache loading php script twice
        10419 by: Mika Laine

Re: strings chopped in half using COM objects
        10420 by: Harald Radi

Re: function to put array into $k=$v&...etc
        10421 by: Michel Laine

Web newsgroup
        10422 by: FPU.WHITES1.FRIENDSPROVIDENT.CO.UK

PHP as Apache module
        10424 by: astenios

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 ---
Looks to me like you're in the wrong newsgroup!!!  ;)

Oh trust me I've been needing a laugh like this for ages!!  Too many
deadlines!!

Do you think your problem might be the result of an evil nasty computer
virus!!?

Let's hope not.  See?  You should use nice safe IIS on NT...  I'm sure that
will
get you all the problems you desire.  :)  You'll find that your tactic of
not
reading the manual will give you the same result, but don't worry!!  Just
come
back here, give us no details, and when our crystal balls come back from the
repair shop we'll do our best as usual!!  :)

Cheers dude, you really have cheered me up!!  :) :)

Ross

PS I'm fighting with the beast that is PowerPoint at the moment in order to
give
a presentation tomorrow... it's the one case where RTFM really doesn't
help!! :)

PPS  Have you tried emailing a newsgroup?  I hear [EMAIL PROTECTED]
is a
good place to try...

-----Original Message-----
From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]]
Sent: 14 November 2001 21:47
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] I need urgent problem help with php!


Hi,

I have absolutely no problems at all with php.
I have tried not to read the manual, but that
does not help either. What is wrong?

Can someone please help me?

        /Anders

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--- End Message ---
--- Begin Message ---
D'oh!! Silly me, I've just realised what's wrong!!  You've been
sticking that power lead thingy into that socket in the wall
again, haven't you!..  tch, I dunno...  ;)

Ross

-----Original Message-----
From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]]
Sent: 14 November 2001 21:47
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] I need urgent problem help with php!


Hi,

I have absolutely no problems at all with php.
I have tried not to read the manual, but that
does not help either. What is wrong?

Can someone please help me?

        /Anders

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--- End Message ---
--- Begin Message ---
What's wrong - not enough drugs....probably?

If you are obsessive or compulsive, press 1 repeatedly.
      
If you are co-dependant, please ask someone to press 2 for you.
      
If you have multiple personalities, please press 3,4,5 and 6
      
If you are paranoid, we already know who you are, but stay on
      the line while we trace your call.
      
If you are delusional, press 7 and your call will be
      transferred to the mother ship.
      
If you are schizophrenic, listen carefully and a small voice
      will tell you which number to press.
      
If you have short term memory loss, press 9, if you have short
      term memory loss, press 9, if you have short term memory loss,
      press 9.
      
If you have low self esteem, please hang up. All our operators
      are too busy to talk to you.


Ignatius


----- Original Message ----- 
From: "Svensson, B.A.T. (HKG)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 15, 2001 8:46 AM
Subject: [PHP-WIN] I need urgent problem help with php!


> Hi,
> 
> I have absolutely no problems at all with php.
> I have tried not to read the manual, but that
> does not help either. What is wrong?
> 
> Can someone please help me?
> 
> /Anders
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

--- End Message ---
--- Begin Message ---
Hi,

Any suggestions where I might find out about the Notes PHP extension??? I 
been looking for ages, and as far as I can see its almost developed but 
nobody seems to know much more about it.

Where can I get hold of it???

Richy

-----Original Message-----
From:   Frank M. Kromann [SMTP:[EMAIL PROTECTED]]
Sent:   13 November 2001 23:10
To:     [EMAIL PROTECTED]
Cc:     [EMAIL PROTECTED]; Kevin
Subject:        Re: RE: [PHP-WIN] PHP and Lotus Notes

Hi,

LDAP is one way and it requires that LDAP is enabled on the Notes server. 
There is also a notes extension for php where you can read and write to all 
notes bases.
There is no documentation on this extension at this point.

- Frank

> > Is there a way to have a PHP script display a Lotus Notes
> > database such as the address book?
>
> I think (but I could be wrong on this) that you can use LDAP functions
> to access a Lotus Notes address book. For more information try searching
> for 'ldap' on http://php.net.
>
> For example, to search for people called 'Smith' on server
> 'lotus1.domain.com', return their full name and mail and dump the
> results to the page so you can see what you got:
> <?php
>   $connection = ldap_connect('lotus1.domain.com');
>   $bind = ldap_bind($connection);
>   $search = ldap_search($ldap, '', 'cn=*smith*', array('cn', 'mail'));
>   $results_array = ldap_get_entries($connection, $search);
>   ldap_close($connection);
>   echo '<pre>';
>   print_r($results_array);
>   echo '</pre>';
> ?>
>
> HTH,
> D.
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>




--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
On Wed, 14 Nov 2001 08:01:54 -0700, [EMAIL PROTECTED] (Zak Greant) wrote:


>Drop by http://www.php-er.com and take a look at the chapter on 
>gettext.
>
>I have written a complete overview of using gettext with PHP. It is 
>also Unix-centric, but it is easier to understand than the gettext 
>docs. : )

Your page at:
http://www.php-er.com/chapters/Gettext_Functions.html
is very clear!

I have also completed the 'msgfmt' utility, so I have succesfully
created a "binary language file" (the .mo file from the .po file)
But.. unfortunately I still could not manage to get it work :-(

This is what I have done.

On the W2000-webserver, I've put the nl.mo file in the following
folder (directory):

[webroot]\melle\includes\translations\nl\LC_MESSAGES

so, in that directory resides the 'nl.mo' file.

I've altered your .php example to read:

=========
<HTML>
<BODY>
<?
// Bind a domain to directory
// Gettext uses domains to know what directories to
// search for translations to messages passed to gettext
bindtextdomain ('greetings', './includes/translations'); // Set the
current domain that gettext will use
textdomain ('greetings'); # Make an array
# Use the ISO two-letter codes as keys
# Use the language names as values
$iso_codes = array (
    'en'=>'English',
    'fr'=>'French',
    'it'=>'Italian',
    'pt'=>'Portuguese',
    'es'=>'Spanish',
    'nl'=>'Nederlands'
); foreach ($iso_codes as $iso_code => $language) {
    # Set the LANGUAGE environment variable to the desired language
    putenv ('LANGUAGE='.$iso_code); # Print out the language name and
greeting
# Filter the greeting through gettext
printf ("<b>%12s:</b> %s\n", $language, _("str_hello"));
}
?></BODY></HTML>
=======

I've put the above .php file in the [webroot]\melle folder.

The (wrong) output is:

     English: str_hello
      French: str_hello
     Italian: str_hello
  Portuguese: str_hello
     Spanish: str_hello
  Nederlands: str_hello

And, in the nl.po file, I have entered:

======
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2001-11-14 17:11+0100\n"
"Last-Translator: Melle Koning <[EMAIL PROTECTED]>\n"
"Language-Team:  <>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "str_hello"
msgstr "hallo"
======

So, what I expected was:

===
     English: str_hello
      French: str_hello
     Italian: str_hello
  Portuguese: str_hello
     Spanish: str_hello
  Nederlands: hallo
===

So this does not work!

Now, what I think could still be going wrong is that 'gettext' is
unable to find the nl.mo file, in other words gettext is unable to
find the right folder(directory)...

My question:
How should I alter:
bindtextdomain ('greetings', './includes/translations'); 

I have already done this:

echo bindtextdomain ('greetings', '.\includes\translations'); 

This returns:
C:/Inetpub/PowerPlate/melle/includes/translations

Which seems to be ok, with the difference that I guess windows wants
to have:
C:\Inetpub\PowerPlate\melle\includes\translations
(backslashes instead of forward slashes)?

Any other hints to get gettext to find the .mo files???

Thanks,








-- 
  http://hace.dyndns.org/ 
  Everything I say is my own opinion and not necessarily that of my employer.

--- End Message ---
--- Begin Message ---
On Wed, 14 Nov 2001 08:01:54 -0700, [EMAIL PROTECTED] (Zak Greant) wrote:

>I have written a complete overview of using gettext with PHP. It is 
>also Unix-centric, but it is easier to understand than the gettext 
>docs. : )

Whooaa!

I finally! got it working!

===
C:/Inetpub/PowerPlate/melle/includes/translations
     English: str_hello
      French: allo
     Italian: str_hello
  Portuguese: str_hello
     Spanish: str_hello
  Nederlands: hallo
===

What I had to change (back) was:

bindtextdomain ("greetings", ".\includes\translations"); 

Above does not work. When I changed this to:

bindtextdomain ("greetings", ".\\includes\\translations"); 


ALSO, I had to change the filename to be 'greetings.mo': This was NOT
clear from all the gnu-pages I read. I had named those files: nl.mo
(for dutch) and fr.mo (for french etcetera). I simply tried to change
the *.mo filename to be the same as the 'domain' and it worked...

gettext suddenly worked on windows! :-)

I provide my code and folder-structure here for other windows-users:

<?
// Bind a domain to directory
// Gettext uses domains to know what directories to
// search for translations to messages passed to gettext
bindtextdomain ("greetings", ".\\includes\\translations"); // Set the
current domain that gettext will use
textdomain ('greetings'); # Make an array
# Use the ISO two-letter codes as keys
# Use the language names as values
$iso_codes = array (
    'en'=>'English',
    'fr'=>'French',
    'it'=>'Italian',
    'pt'=>'Portuguese',
    'es'=>'Spanish',
    'nl'=>'Nederlands'
); foreach ($iso_codes as $iso_code => $language) {
    # Set the LANGUAGE environment variable to the desired language
    putenv ('LANGUAGE='.$iso_code); # Print out the language name and
greeting
# Filter the greeting through gettext
printf ("<b>%12s:</b> %s\n", $language, gettext("str_hello")) & "\n";

}
?>

In the windows-webfolder I have the following directory-structure:

==
\includes\translations
 \includes\translations\en
 \includes\translations\en\LC_MESSAGES
 \includes\translations\en\LC_MESSAGES\greetings.po
 \includes\translations\fr
 \includes\translations\fr\LC_MESSAGES
 \includes\translations\fr\LC_MESSAGES\greetings.mo
 \includes\translations\fr\LC_MESSAGES\greetings.po
 \includes\translations\it
 \includes\translations\it\LC_MESSAGES
 \includes\translations\it\LC_MESSAGES\greetings.po
 \includes\translations\nl
 \includes\translations\nl\LC_MESSAGES
 \includes\translations\nl\LC_MESSAGES\greetings.mo
 \includes\translations\nl\LC_MESSAGES\greetings.po
 \includes\translations\pt
 \includes\translations\pt\LC_MESSAGES
 \includes\translations\pt\LC_MESSAGES\greetings.po
 \includes\translations\sp
 \includes\translations\sp\LC_MESSAGES
 \includes\translations\sp\LC_MESSAGES\greetings.po
===

To get this working you will need a greetings.po file like this:

(this one is in the 'nl' subdir for dutch language:
===
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2001-11-14 17:11+0100\n"
"Last-Translator: Melle Koning <[EMAIL PROTECTED]>\n"
"Language-Team:  <>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "str_hello"
msgstr "hallo"
===

and you have to 'compile' this .po file to a .mo file with the
following command-line (go to 'command prompt'):

==
msgfmt -o greetings.mo greetings.po
==

To get msgfmt working on your windows machine, you will need to have
libiconv.dll, libintl.dll and msgfmt.exe in your path. What I did was
put these three files in a new c:\utils folder and than run the
command:
path=%path%;c:\utils

I hope this helps some windows-users like me to get gettext() to work
on their systems.......

Cheers,
Melle
[EMAIL PROTECTED]


-- 
  http://hace.dyndns.org/ 
  Everything I say is my own opinion and not necessarily that of my employer.

--- End Message ---
--- Begin Message ---
For some reason Apache loads my php script twice. I have two php files.
"search.php" which has form that posts data to "result.php". After
submitting (POST) it loads result.php for a while. THis is so far ok. But it
then reloads it and of course alla post data is lost by now. Below is the
apache log. Notice the exact times.


XXX.XXX.XXX.XXX - - [14/Nov/2001:18:39:17 +0200] "POST /result.php HTTP/1.1"
200 89924
XXX.XXX.XXX.XXX - - [14/Nov/2001:18:39:17 +0200] "GET /result.php HTTP/1.1"
200 160


I'm using Windows XP, Apache 1.3.22, php 4.0.6 (ISAPI php module)



--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> eg., $word->Tasks->Item[$i] in this snip:

either use

$word->Tasks[$i]

or

$word->Tasks->Item($i)


Item() is a getter method and not a property.

harald.
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBO/OVLK1+myS9SSHxEQJ6BgCgiq19GHZ4DRARst/miA+FWgfkPjIAn1yf
91AYt5fDAUGhJhf3BUlWsrbb
=MRrZ
-----END PGP SIGNATURE-----



--- End Message ---
--- Begin Message ---
Noah Spitzer-Williams wrote:

> is there a function that will convert an array to "get variables"
>
> ie:
>
> array ("a" => "b", "c" => "d")    ==>     "a=b&c=d"
>
> any help is appreciated!
>
> Noah
>
> www.trademytraffic.com
> --------
> TradeMyTraffic! Banner Exchange
> [EMAIL PROTECTED]

I am not sure, but i think that the array functions Compact and Extract
can be of use here.
Look them up in the PHP manual.

Otherwise i believe you'll have to do it 'manually'...


--

Michel Laine


--- End Message ---
--- Begin Message ---
--- Received from FPU.WHITES1 799 3703              15-11-01 11:01

  -> [EMAIL PROTECTED]

Hey dudes,

I'm looking to put a web driven newsgroup on my website, and I'm
sure I've heard that there is a good free one that someone wrote
in php.  Any ideas which one it is/where I can get it?

Any other ideas would be appreciated!  Basically it needs to be
free 8-), have a nice web GUI, and be data driven (obviously).  No
hard requirements about which db it has to use.

Any thoughts?

Cheers - Steve

This e-mail may contain confidential information and/or copyright
material. This e-mail is intended for the use of the addressee
only. Any unauthorised use may be unlawful.

If you receive this e-mail by mistake please advise the sender
immediately by using the reply facility in your e-mail software.

Friends Provident Marketing Group consists of the following
companies:

Friends Provident Life and Pensions Limited.
Registered number 4096141.
Friends' Provident Unit Trust Managers Limited.
Registered number 970641
FP Life Assurance Limited.
Registered number 782698
Friends Provident Pensions Limited.
Registered number 475201
Friends Ivory & Sime Managed Pensions Funds Limited.
Registered number 1020044
Registered and Head Office of each of the above companies is at Pixham End,
Dorking, Surrey RH4 1QA.
Registered in England. Incorporated companies limited by shares.
Ivory & Sime Trustlink Limited. Registered number 151198
Registered and Head Office: One Charlotte Square, Edinburgh EH2
4DZ.  Registered in Scotland. Incorporated company limited by
shares.

Companies within this Group transact life assurance, pension,
permanent health, unit trust and investment trust business

All are regulated by the Personal Investment Authority.
Friends' Provident Unit Trust Managers Limited is also regulated
by IMRO.
--- End Message ---
--- Begin Message ---
How can I install PHP4 as Apache module on Win2K??

Thanks in advance.

xavi


--- End Message ---

Reply via email to