php-windows Digest 26 Oct 2001 14:08:03 -0000 Issue 823

Topics (messages 10044 through 10054):

Re: Recommendations for books for beginners for PHP & mySQL?
        10044 by: Daniel Parsons

Re: Page Not Found
        10045 by: Gaylen Fraley
        10047 by: Jim & Carrie Lucas

Unable to load extensions
        10046 by: Daniel Parsons
        10048 by: Philippe Saladin

Redirect stderr/Suppress imap_open error
        10049 by: FPU.WHITES1.FRIENDSPROVIDENT.CO.UK
        10050 by: FPU.WHITES1.FRIENDSPROVIDENT.CO.UK

Re: Sendmail...
        10051 by: DL Neil
        10052 by: Ross Fleming
        10054 by: DL Neil

Re: [PHP] variable gets lost in function problem again...
        10053 by: DL Neil

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]


----------------------------------------------------------------------


I used their book to learn the basics and found it really good. They
have a chapter on the basics of relational database design and using
MySQL, as well as chapters devoted to specific examples (building a
shopping cart or a web-based mail client &c.). I'd certainly recommend
it.

That book, php.net and phpbuilder.com have been able to answer just
about all of my questions so far between them.

D.

> -----Original Message-----
> From: Asendorf, John [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 26 October 2001 7:43 a.m.
> To: Todd Williamsen; [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] Recommendations for books for
> beginners for PHP &
> mySQL?
>
>
> I saw Luke Welling and Laura Thompson at OSCON and they have
> a book out.  If
> it's half as good as their presentation, it'd be the winner
> hands down.
> Please note that is meant to infer that I haven't read it,
> but probably
> will.
>
> PHP and MySQL Web Development
>
> http://www.amazon.com/exec/obidos/ASIN/0672317842/qid=10040353
> 94/sr=2-1/ref=
> sr_2_15_1/104-7983120-7151924
>
>
> ---------------------
> 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: Todd Williamsen [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, October 25, 2001 1:28 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-WIN] Recommendations for books for beginners for PHP &
> > mySQL?
> >
> >
> > anyone have any suggestions?
> >
> > Thanks
> >
> >
> >
> > --
> > 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]
>





You don't mention the load module directive.  Are you trying to load the
module?  If so, you should see a line like

LoadModule php4_module .....

--
Gaylen
[EMAIL PROTECTED]
http://www.gaylenandmargie.com
PHP KISGB v2.1 Guestbook http://www.gaylenandmargie.com/phpwebsite

"Peter Vertes" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello All,
>
>     I'm having trouble installing PHP on a W2K workstation.  I've got
mySql
> and Apache working on it fine but I can't get it to display a PHP test
page.
> When I do http://localhost/ it shows the test HTML page fine.  When I do
> http://localhost/test.php I get an error message saying that the page can
> not be found.  Now the page is there, it is called test.php and it
contains
> the following line:
>
> <? phpinfo() ?>
>
> Now, in my httpd.conf file I have the following:
>
>     AddType application/x-httpd-php .php
>     AddType application/x-httpd-php-source .phps
>     AddType application/x-httpd-php .phtml
>     AddType application/x-httpd-php .phtml
>
>     AddType application/x-tar .tgz
>
>     Action application/x-httpd-php "/php/php.exe "
>
>     Can anyone hit at what could be wrong ?  Thanks in advance...
>
> -Pete
>






you might need to put a ; after the function call.

<?
phpinfo();
?>

and make sure that the "/php/php.exe" is actually located in the ServerRoot
= "c:/apache"
the php folder has to be located in the location that the ServerRoot points
to.

Jim
----- Original Message -----
From: "Gaylen Fraley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 25, 2001 8:42 PM
Subject: [PHP-WIN] Re: Page Not Found


> You don't mention the load module directive.  Are you trying to load the
> module?  If so, you should see a line like
>
> LoadModule php4_module .....
>
> --
> Gaylen
> [EMAIL PROTECTED]
> http://www.gaylenandmargie.com
> PHP KISGB v2.1 Guestbook http://www.gaylenandmargie.com/phpwebsite
>
> "Peter Vertes" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hello All,
> >
> >     I'm having trouble installing PHP on a W2K workstation.  I've got
> mySql
> > and Apache working on it fine but I can't get it to display a PHP test
> page.
> > When I do http://localhost/ it shows the test HTML page fine.  When I do
> > http://localhost/test.php I get an error message saying that the page
can
> > not be found.  Now the page is there, it is called test.php and it
> contains
> > the following line:
> >
> > <? phpinfo() ?>
> >
> > Now, in my httpd.conf file I have the following:
> >
> >     AddType application/x-httpd-php .php
> >     AddType application/x-httpd-php-source .phps
> >     AddType application/x-httpd-php .phtml
> >     AddType application/x-httpd-php .phtml
> >
> >     AddType application/x-tar .tgz
> >
> >     Action application/x-httpd-php "/php/php.exe "
> >
> >     Can anyone hit at what could be wrong ?  Thanks in advance...
> >
> > -Pete
> >
>
>
>
> --
> 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]
>
>





Hi,

I'm using PHP 4.0.4 with IIS 4 on WinNT. When I try to load an extension
I get an error telling me that it cannot be found. The extensions
directory line of my PHP ini file is:
  extension_dir  = C:\WINNT\system32\
I've tried forward slashes, back slashes, absolute paths and relative
paths but nothing seems to make the error go away. The correct dll is
definitely in the directory but PHP jusy won't find it.

Can anyone help?

D.





It would work with c:\winnt\system32 (without back slash at the end).
Otherwise, you would try to download the free Dependency Walker
(http://www.dependencywalker.com/) to find all depedencies of your dll. Hope
it will help you ?
Regards,
    Philippe

"Daniel Parsons" <[EMAIL PROTECTED]> a écrit dans le message
news: [EMAIL PROTECTED]
> Hi,
>
> I'm using PHP 4.0.4 with IIS 4 on WinNT. When I try to load an extension
> I get an error telling me that it cannot be found. The extensions
> directory line of my PHP ini file is:
>   extension_dir  = C:\WINNT\system32\
> I've tried forward slashes, back slashes, absolute paths and relative
> paths but nothing seems to make the error go away. The correct dll is
> definitely in the directory but PHP jusy won't find it.
>
> Can anyone help?
>
> D.
>
>






--- Received from FPU.WHITES1 799 3703                    26-10-01 09:17

  -> [EMAIL PROTECTED]

Anyone know how to redirect stderr so it doesn't appear on the screen?

I'm battling with imap_open writing an error to the screen when the
(valid) mailbox is empty.

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.




--- Received from FPU.WHITES1 799 3703                       26-10-01 09:46

  -> [EMAIL PROTECTED]

Ahah... sorted.

Setting:

error_reporting = E_ALL & ~E_NOTICE

in php.ini does the trick, though quite why imap decides to flag it up as a
"notice" (described as Warning in the message) just because the mailbox is
empty beats me! 8-)

-Steve

---------------------------------------------------------------------------

From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Redirect stderr/Suppress imap_open error

--- Received from FPU.WHITES1 799 3703                    26-10-01 09:17

  -> [EMAIL PROTECTED]

Anyone know how to redirect stderr so it doesn't appear on the screen?

I'm battling with imap_open writing an error to the screen when the
(valid) mailbox is empty.

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.

--
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]

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.




Ross,

Apologies if I've confused the issue: "TLD" is "top level domain" otherwise known as 
"country level domain", ie in your
case ".uk".
thus your ISP's SMTP server MIGHT be smtp.clara.co.uk (it won't PING for me, so please 
clara-fy that). Thus

-----
> > [mail function]
> > ; For Win32 only.
> > SMTP = smtp.clara.co.uk
> >
> > ; For Win32 only.
> > sendmail_from = [EMAIL PROTECTED]
> >
> > ; For Unix only.  You may supply arguments as well (default: 'sendmail -t -i').
> > ;sendmail_path =
-----

suitably edited, might work.
Let us know,
=dn

PS have put this conversation back on the list, in case others can benefit/improve...



> That sounds better.  I'm at uni just now so I can't try it till I get
> home.
>
> I take it the TLD has a bearing on things?  I tried it before (granted
> without the .TLD at the end) and it didn't work
>
> I'll give it a go and let you know what happens
>
> Cheers for your info! Appreciate it :)
>
> Ross
>
> DL Neil wrote:
> >
> > Ross,
> >
> > If you're still dissatisfied, here is my PHP.ini mail section - I'm using WinNT 
>4.0 SP6a and link into my ISP's SMTP
> > server (I don't run a local SMTP or POP server because the less I run on the 
>(portable) box itself, the
faster/better I
> > like it!)
> >
> > -----
> > [mail function]
> > ; For Win32 only.
> > SMTP = smtp.isp.address.TLD
> >
> > ; For Win32 only.
> > sendmail_from = [EMAIL PROTECTED]
> >
> > ; For Unix only.  You may supply arguments as well (default: 'sendmail -t -i').
> > ;sendmail_path =
> > -----
> >
> > NB I didn't do anything with the last line - the "Unix only" bit seemed a warning! 
>Also no 30-day wonder...
> >
> > Hope it helps,
> > =dn
> >
> > ----- Original Message -----
> > From: "Ross Fleming" <[EMAIL PROTECTED]>
> > To: "Eric Pankoke" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: 25 October 2001 12:11
> > Subject: Re: [PHP-WIN] Sendmail...
> >
> > > Searched google with the string "sendmail for windows".
> > >
> > > http://www.indigostar.com/sendmail.htm
> > >
> > > It's a shareware version of sendmail though, not sure how long it will
> > > last.  I'm thinking about using Blat (freeware) which is just a command
> > > line mailer and just calling it from exec() or system() etc.  Either
> > > that or actually using sendmail through cygwin or something.
> > >
> > > Ross
> > >
> > >
> > > Eric Pankoke wrote:
> > > >
> > > > Just curious, where did you find the win32 version of sendmail?
> > > >
> > > > At 11:49 PM 10/24/01 +0100, Ross Fleming wrote:
> > > > >Never mind people, I found a win32 version of sendmail and it works now.
> > > > >
> > > > >Ta anyway
> > > > >
> > > > >Ross
> > > > >
> > > > >-----Original Message-----
> > > > >From: Ross Fleming [mailto:[EMAIL PROTECTED]]
> > > > >Sent: 24 October 2001 23:29
> > > > >To: [EMAIL PROTECTED]
> > > > >Subject: [PHP-WIN] Sendmail...
> > > > >
> > > > >
> > > > >Hello, I'm probably just being a bit thick, but how exactly do I get the
> > > > >mail function to work?..
> > > > >
> > > > >Do I need a sendmail replacement? (I downloaded blat to see if that would
> > > > >help but can't see that it does.)
> > > > >
> > > > >------
> > > > >php.ini
> > > > >
> > > > >
> > > > >[mail function]
> > > > >; For Win32 only.
> > > > >SMTP= mail.totalise.co.uk ; for Win32 only
> > > > >
> > > > >; For Win32 only.
> > > > >sendmail_from= [EMAIL PROTECTED] ; for Win32 only
> > > > >
> > > > >----------
> > > > >
> > > > >Do I need to have this in?..
> > > > >
> > > > >; For Unix only.  You may supply arguments as well (default:
> > > > >'sendmail -t -i').
> > > > >;sendmail_path=
> > > > >
> > > > >I tried uncommenting the sendmail_path and pointed to c:\windows\blat.exe
> > > > >
> > > > >Called it from within a php page
> > > > >mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3");
> > > > >
> > > > >Got:
> > > > >Warning: Server Error in C:\Program Files\Apache
> > > > >Group\Apache\htdocs/email.php on line 11
> > > > >
> > > > >whether I uncommented the sendmail_path line or not.
> > > > >
> > > > >Any help appreciated.  I'm running Windows 98.
> > > > >
> > > > >Thanks
> > > > >
> > > > >Ross
> > > > >
> > > > >
> > > > >--
> > > > >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]
> > > >
> > > > --
> > > > 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]
> > >
> > >
> >
> > --
> > 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]
>





Hmm... that didn't work for me when I tried it.  It was the 1st thing I
tried.  I kept getting "Server error" on the PHP page when I ran it.

I'll certainly try it again.

It won't be clara I use anyway but I do know the server address from
Outlook etc. and it just didn't seem to work.  Don't know what magic
your PC seems to do but consider yourself lucky.  :)

Ross

PS You should be shot for that "clara-fy" pun!!!  ;)


DL Neil wrote:
> 
> Ross,
> 
> Apologies if I've confused the issue: "TLD" is "top level domain" otherwise known as 
>"country level domain", ie in your
> case ".uk".
> thus your ISP's SMTP server MIGHT be smtp.clara.co.uk (it won't PING for me, so 
>please clara-fy that). Thus
> 
> -----
> > > [mail function]
> > > ; For Win32 only.
> > > SMTP = smtp.clara.co.uk
> > >
> > > ; For Win32 only.
> > > sendmail_from = [EMAIL PROTECTED]
> > >
> > > ; For Unix only.  You may supply arguments as well (default: 'sendmail -t -i').
> > > ;sendmail_path =
> -----
> 
> suitably edited, might work.
> Let us know,
> =dn
> 
> PS have put this conversation back on the list, in case others can benefit/improve...
> 
> > That sounds better.  I'm at uni just now so I can't try it till I get
> > home.
> >
> > I take it the TLD has a bearing on things?  I tried it before (granted
> > without the .TLD at the end) and it didn't work
> >
> > I'll give it a go and let you know what happens
> >
> > Cheers for your info! Appreciate it :)
> >
> > Ross
> >
> > DL Neil wrote:
> > >
> > > Ross,
> > >
> > > If you're still dissatisfied, here is my PHP.ini mail section - I'm using WinNT 
>4.0 SP6a and link into my ISP's SMTP
> > > server (I don't run a local SMTP or POP server because the less I run on the 
>(portable) box itself, the
> faster/better I
> > > like it!)
> > >
> > > -----
> > > [mail function]
> > > ; For Win32 only.
> > > SMTP = smtp.isp.address.TLD
> > >
> > > ; For Win32 only.
> > > sendmail_from = [EMAIL PROTECTED]
> > >
> > > ; For Unix only.  You may supply arguments as well (default: 'sendmail -t -i').
> > > ;sendmail_path =
> > > -----
> > >
> > > NB I didn't do anything with the last line - the "Unix only" bit seemed a 
>warning! Also no 30-day wonder...
> > >
> > > Hope it helps,
> > > =dn
> > >
> > > ----- Original Message -----
> > > From: "Ross Fleming" <[EMAIL PROTECTED]>
> > > To: "Eric Pankoke" <[EMAIL PROTECTED]>
> > > Cc: <[EMAIL PROTECTED]>
> > > Sent: 25 October 2001 12:11
> > > Subject: Re: [PHP-WIN] Sendmail...
> > >
> > > > Searched google with the string "sendmail for windows".
> > > >
> > > > http://www.indigostar.com/sendmail.htm
> > > >
> > > > It's a shareware version of sendmail though, not sure how long it will
> > > > last.  I'm thinking about using Blat (freeware) which is just a command
> > > > line mailer and just calling it from exec() or system() etc.  Either
> > > > that or actually using sendmail through cygwin or something.
> > > >
> > > > Ross
> > > >
> > > >
> > > > Eric Pankoke wrote:
> > > > >
> > > > > Just curious, where did you find the win32 version of sendmail?
> > > > >
> > > > > At 11:49 PM 10/24/01 +0100, Ross Fleming wrote:
> > > > > >Never mind people, I found a win32 version of sendmail and it works now.
> > > > > >
> > > > > >Ta anyway
> > > > > >
> > > > > >Ross
> > > > > >
> > > > > >-----Original Message-----
> > > > > >From: Ross Fleming [mailto:[EMAIL PROTECTED]]
> > > > > >Sent: 24 October 2001 23:29
> > > > > >To: [EMAIL PROTECTED]
> > > > > >Subject: [PHP-WIN] Sendmail...
> > > > > >
> > > > > >
> > > > > >Hello, I'm probably just being a bit thick, but how exactly do I get the
> > > > > >mail function to work?..
> > > > > >
> > > > > >Do I need a sendmail replacement? (I downloaded blat to see if that would
> > > > > >help but can't see that it does.)
> > > > > >
> > > > > >------
> > > > > >php.ini
> > > > > >
> > > > > >
> > > > > >[mail function]
> > > > > >; For Win32 only.
> > > > > >SMTP= mail.totalise.co.uk ; for Win32 only
> > > > > >
> > > > > >; For Win32 only.
> > > > > >sendmail_from= [EMAIL PROTECTED] ; for Win32 only
> > > > > >
> > > > > >----------
> > > > > >
> > > > > >Do I need to have this in?..
> > > > > >
> > > > > >; For Unix only.  You may supply arguments as well (default:
> > > > > >'sendmail -t -i').
> > > > > >;sendmail_path=
> > > > > >
> > > > > >I tried uncommenting the sendmail_path and pointed to c:\windows\blat.exe
> > > > > >
> > > > > >Called it from within a php page
> > > > > >mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3");
> > > > > >
> > > > > >Got:
> > > > > >Warning: Server Error in C:\Program Files\Apache
> > > > > >Group\Apache\htdocs/email.php on line 11
> > > > > >
> > > > > >whether I uncommented the sendmail_path line or not.
> > > > > >
> > > > > >Any help appreciated.  I'm running Windows 98.
> > > > > >
> > > > > >Thanks
> > > > > >
> > > > > >Ross
> > > > > >
> > > > > >
> > > > > >--
> > > > > >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]
> > > > >
> > > > > --
> > > > > 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]
> > > >
> > > >
> > >
> > > --
> > > 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]




Ross,

> Hmm... that didn't work for me when I tried it.  It was the 1st thing I
> tried.  I kept getting "Server error" on the PHP page when I ran it.

=yes I must admit I couldn't see any particular difference. If it helps I'll send the 
whole .ini file to your
private address (but you'd still have to edit it). Have you tried tracking the error 
back through the Apache
documentation? There's an article by Richard Heyes (who sometimes appears here) about 
using his email classes to
email-enable PHP. I used a lot of his advice/setups to get started. I wonder if 
there's something in there...

> I'll certainly try it again.

=ok, let us know.

> It won't be clara I use anyway but I do know the server address from
> Outlook etc. and it just didn't seem to work.  Don't know what magic
> your PC seems to do but consider yourself lucky.  :)
> PS You should be shot for that "clara-fy" pun!!!  ;)
> DL Neil wrote:

=yes "lucky" is my middle name - in part because I've had people attempt to shoot me 
for less... at last,
someone who appreciates lousy puns!
=dn



> > Ross,
> >
> > Apologies if I've confused the issue: "TLD" is "top level domain" otherwise known 
>as "country level domain",
ie in your
> > case ".uk".
> > thus your ISP's SMTP server MIGHT be smtp.clara.co.uk (it won't PING for me, so 
>please clara-fy that). Thus
> >
> > -----
> > > > [mail function]
> > > > ; For Win32 only.
> > > > SMTP = smtp.clara.co.uk
> > > >
> > > > ; For Win32 only.
> > > > sendmail_from = [EMAIL PROTECTED]
> > > >
> > > > ; For Unix only.  You may supply arguments as well (default: 'sendmail -t -i').
> > > > ;sendmail_path =
> > -----
> >
> > suitably edited, might work.
> > Let us know,
> > =dn
> >
> > PS have put this conversation back on the list, in case others can 
>benefit/improve...
> >
> > > That sounds better.  I'm at uni just now so I can't try it till I get
> > > home.
> > >
> > > I take it the TLD has a bearing on things?  I tried it before (granted
> > > without the .TLD at the end) and it didn't work
> > >
> > > I'll give it a go and let you know what happens
> > >
> > > Cheers for your info! Appreciate it :)
> > >
> > > Ross
> > >
> > > DL Neil wrote:
> > > >
> > > > Ross,
> > > >
> > > > If you're still dissatisfied, here is my PHP.ini mail section - I'm using 
>WinNT 4.0 SP6a and link into
my ISP's SMTP
> > > > server (I don't run a local SMTP or POP server because the less I run on the 
>(portable) box itself, the
> > faster/better I
> > > > like it!)
> > > >
> > > > -----
> > > > [mail function]
> > > > ; For Win32 only.
> > > > SMTP = smtp.isp.address.TLD
> > > >
> > > > ; For Win32 only.
> > > > sendmail_from = [EMAIL PROTECTED]
> > > >
> > > > ; For Unix only.  You may supply arguments as well (default: 'sendmail -t -i').
> > > > ;sendmail_path =
> > > > -----
> > > >
> > > > NB I didn't do anything with the last line - the "Unix only" bit seemed a 
>warning! Also no 30-day
wonder...
> > > >
> > > > Hope it helps,
> > > > =dn
> > > >
> > > > ----- Original Message -----
> > > > From: "Ross Fleming" <[EMAIL PROTECTED]>
> > > > To: "Eric Pankoke" <[EMAIL PROTECTED]>
> > > > Cc: <[EMAIL PROTECTED]>
> > > > Sent: 25 October 2001 12:11
> > > > Subject: Re: [PHP-WIN] Sendmail...
> > > >
> > > > > Searched google with the string "sendmail for windows".
> > > > >
> > > > > http://www.indigostar.com/sendmail.htm
> > > > >
> > > > > It's a shareware version of sendmail though, not sure how long it will
> > > > > last.  I'm thinking about using Blat (freeware) which is just a command
> > > > > line mailer and just calling it from exec() or system() etc.  Either
> > > > > that or actually using sendmail through cygwin or something.
> > > > >
> > > > > Ross
> > > > >
> > > > >
> > > > > Eric Pankoke wrote:
> > > > > >
> > > > > > Just curious, where did you find the win32 version of sendmail?
> > > > > >
> > > > > > At 11:49 PM 10/24/01 +0100, Ross Fleming wrote:
> > > > > > >Never mind people, I found a win32 version of sendmail and it works now.
> > > > > > >
> > > > > > >Ta anyway
> > > > > > >
> > > > > > >Ross
> > > > > > >
> > > > > > >-----Original Message-----
> > > > > > >From: Ross Fleming [mailto:[EMAIL PROTECTED]]
> > > > > > >Sent: 24 October 2001 23:29
> > > > > > >To: [EMAIL PROTECTED]
> > > > > > >Subject: [PHP-WIN] Sendmail...
> > > > > > >
> > > > > > >
> > > > > > >Hello, I'm probably just being a bit thick, but how exactly do I get the
> > > > > > >mail function to work?..
> > > > > > >
> > > > > > >Do I need a sendmail replacement? (I downloaded blat to see if that would
> > > > > > >help but can't see that it does.)
> > > > > > >
> > > > > > >------
> > > > > > >php.ini
> > > > > > >
> > > > > > >
> > > > > > >[mail function]
> > > > > > >; For Win32 only.
> > > > > > >SMTP= mail.totalise.co.uk ; for Win32 only
> > > > > > >
> > > > > > >; For Win32 only.
> > > > > > >sendmail_from= [EMAIL PROTECTED] ; for Win32 only
> > > > > > >
> > > > > > >----------
> > > > > > >
> > > > > > >Do I need to have this in?..
> > > > > > >
> > > > > > >; For Unix only.  You may supply arguments as well (default:
> > > > > > >'sendmail -t -i').
> > > > > > >;sendmail_path=
> > > > > > >
> > > > > > >I tried uncommenting the sendmail_path and pointed to c:\windows\blat.exe
> > > > > > >
> > > > > > >Called it from within a php page
> > > > > > >mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3");
> > > > > > >
> > > > > > >Got:
> > > > > > >Warning: Server Error in C:\Program Files\Apache
> > > > > > >Group\Apache\htdocs/email.php on line 11
> > > > > > >
> > > > > > >whether I uncommented the sendmail_path line or not.
> > > > > > >
> > > > > > >Any help appreciated.  I'm running Windows 98.
> > > > > > >
> > > > > > >Thanks
> > > > > > >
> > > > > > >Ross
> > > > > > >
> > > > > > >
> > > > > > >--
> > > > > > >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]
> > > > > >
> > > > > > --
> > > > > > 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]
> > > > >
> > > > >
> > > >
> > > > --
> > > > 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]
>
> --
> 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]
>
>





Thanks for the added data, Spunk. I guess I should have asked for a view of the 
screen/echo conversation too...

I'm not strong on RegExps so took a look at the manual 
(http://www.php.net/manual/en/function.ereg-replace.php),
which says:
-----
string ereg_replace (string pattern, string replacement, string string)
This function scans string for matches to pattern, then replaces the matched text with 
replacement.
The modified string is returned. (Which may mean that the original string is returned 
if there are no matches to
be replaced.)
-----
It seems to answer your question about "strings cf arrays". A string can be a 
character or an array of
characters. An array can contain a list of strings -  and we might thus call it a 
"string array" but that does
not make it A "string".

So it seems to me [medium-high ignorance factor present] that you would definitely 
need to loop the array
through the RegExp an element at a time; and that appears to be exactly what you're 
doing, but once again,
without echo-ing so that you/we can see the data fore-and-aft, it's difficult to spot 
a problem within the
crucial function call (lacking those RegExp skills as I do).

NB in talking about 'pass by reference' I was refering to the function you had 
written, NOT the call to
ereg_replace()!

However [he continuous ponderously] again dipping into the manual
(http://www.php.net/manual/en/function.str-replace.php), we see:
-----
mixed str_replace (mixed search, mixed replace, mixed subject)

This function returns a string or an array with all occurences of search in subject 
replaced with the given
replace value. If you don't need fancy replacing rules, you should always use this 
function instead of
ereg_replace() or preg_replace().

In PHP 4.0.5 and later, every parameter to str_replace() can be an array.

If subject is an array, then the search and replace is performed with every entry of 
subject, and the return
value is an array as well.

If search and replace are arrays, then str_replace() takes a value from each array and 
uses them to do search
and replace on subject. If replace has fewer values than search, then an empty string 
is used for the rest of
replacement values. If search is an array and replace is a string; then this 
replacement string is used for
every value of search. The converse would not make sense, though.
-----
Note the comment about replace cf RegExp - a frequent refrain on this list is the 
improved efficiency for simple
search/replace operations.

I feel sure that the idea of an array-search against an array-replace should come with 
a Surgeon-General's
health warning to protect one's sanity, but this sort of challenge might appeal to you?

Unsought/pedantic advice: try putting a simple string (extracted from your data) 
through the chosen
transformation/function first, then replace the string with a string array element, 
then work up to whole arrays
at a time... It seems so simplistic, but everyone should have a short 'testbench.php' 
script into which code
fragments can be dropped, so that tests can be made on 'new' constructs. Then to use 
this in a process of
gradual 'construction' (ie "make it work (simply) before you make it better"), rather 
than starting from
something complex and having to dismantle/simplify it back down, in order to 
debug/check your logic and
assumptions.

Hope it's helping,
=dn

PS I put this contribution back on the list in case it will help others/provoke a more 
learned response



> Thanks for responding. Odly, my site is down at the moment so I will need
> some time to investigate. Here's what I know so far:
>
> I did debug with echo inside one of my functions and the string was fine
> until it used ereg_replace(). The same thing happens outside of my function
> (in the body of the script, calling ereg_replace($variable);). I tried
> passing the variable to my function as a reference but the same problem
> occurred. I didn't try to pass it as a reference to ereg_replace though...
> but I would guess ereg_replace accepts arguments as reference by default...
> Maybe this is the problem?
>
> I was planning on throwing all the code into one file to see if that worked
> but I have to wait till my server's back up.
>
> The problem seems to stem from passing a variable whose data is from an
> array that through ereg_replace ... should this be a problem? I define the
> variable with the array data in the body of my code... I can't see why this
> would be a problem but I'll check.
>
> Here's an example of my code:
>
> <?php
>
> include("getid3.php");
>
> function RemoveSpaces($stufftoreplace) //My function
> {
>     // Removes spaces and other characters that could cause problems.
>     $stufftoreplace = ereg_replace(" ", "_", "$stufftoreplace");
>     return $stufftoreplace;
> }
>
> $id3info = (getID3("music.mp3"));
> $song = $id3info["TIT2"]["data"];
> $newsong = RemoveSpaces("$song");
> //$newsong = ereg_replace(" ", "_", "$song"); //This also shows problem!
> echo "$newsong"; //string is now empty
>
> Weird... Any thoughts?
>
> Spunk
>
>
> ?>
> >
> > Could you post some excerpted code please?
> >
> > You seem to have multiple issues:
> > 1 communication between a 'mainline' and INCLUDEd code
> > 2 communication between a 'mainline' and a function
> > 3 working with scalars and arrays
> > 4 working with text strings and ?text arrays
> > - which may or may not be related/relevant
> >
> > Let's start with simple ideas:
> > 0 put debug echo statements into the function (or everywhere) to track
> > progress
> > 1 if you take the processing code out of the INCLUDE file and put it in the
> > 'mainline', does it then work as planned?
> > 2 do you have an & to indicate a pass by reference cf a pass by value (see
> > manual)?
> > 3 and 4 does the processing use tools/approach/functions that only work with
> > scalars/arrays/strings?
> > A process of elimination...
> >
> > Keep us posted,
> > =dn
>
>



Reply via email to