RE: [PHP] smpt server requiring authentication

2004-07-22 Thread PHP User
I had the same problem and found a script - phpmailer-1.72 - that works
great. Very little configuration to setup, and I have it working on a Linux
and Windows platform.

Beauford 

-Original Message-
From: Chris Hunt [mailto:[EMAIL PROTECTED] 
Sent: July 22, 2004 3:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] smpt server requiring authentication

Hi,

anyone know how to configure php's outgoing mail to use a smtp server that
requires authentication?

thanks for any help,

cheers,

Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Line breaks again....

2004-07-21 Thread PHP User
I am using Outlook 2003 in text mode to view messages (which is what I
want). This is the relevent code...

 Code for input from form .

$text=str_replace("\n","\r\n",$text);  
* this replaces \n before the email is sent. Not sure this is necessary or
right, but nothing else I have tried works either *

if($mail->Send()) * email gets sent
{

$text=str_replace("\n","",$text); 
$text=str_replace("","",$text); 
* these two lines make it display properly on my site *

. Code to display message 

Thanks

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: July 21, 2004 6:36 PM
To: PHP User
Cc: PHP
Subject: Re: [PHP] Line breaks again

PHP User wrote:

> I have managed to get the line breaks to show up on my site no problem,
but
> I still get one long line when it is sent to my email. I have looked and
> looked and have read all the stuff I could find on \r\n, so I'm not sure
> where to go from here since it's not working...

Are you viewing HTML email or plain text? Using \r\n or \n will work 
fine in most email viewers. Are you sure you're not stripping the \n 
from the text to show it with  in HTML and then screwing up the 
presentation in email? Hard to tell what you're doing without any 
code... hint hint...

-- 

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals - www.phparch.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Line breaks again....

2004-07-21 Thread PHP User
Hi,

I have managed to get the line breaks to show up on my site no problem, but
I still get one long line when it is sent to my email. I have looked and
looked and have read all the stuff I could find on \r\n, so I'm not sure
where to go from here since it's not working...

Suggestions are appreciated.

Thanks, Beauford


RE: [PHP] Need help with line breaks in a textarea form

2004-07-16 Thread PHP User
John,

If I just echo $text on the webpage now, everything shows as it should.

HOWEVER, another problem I didn't even clue into until now. This form gets
emailed to a specified address and all I get in my email is one long line
with no line breaks. How do I fix this? I was reading a thread in a web
based group you were having with another person, but none of your
suggestions there worked.   

Suggestions

Thanks again...

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: July 16, 2004 12:14 PM
To: PHP User
Cc: PHP
Subject: Re: [PHP] Need help with line breaks in a textarea form

PHP User wrote:
> Something came to mind as soon as I sent my last email, and it seems 
> to work. Not sure it will work in every circumstance but the few tests 
> I tried seemed ok. This is what I did. I added the two following lines to
my script.
> 
> $text=str_replace("\n","",$text);
> $text=str_replace("","",$text);

Okay... let's say you have $text that is text that was entered into a
textarea. To put it _back into_ a textare, you simply need to do this:



That's it. If you want to display $text to the user outside of a ,
then you do this:

echo nl2br(htmlentities($text));

If you want to insert $text into a database and magic_quotes_gpc is enabled,
you do this:

$query = "INSERT INTO yourtable (textcolumn) VALUES ('$text')";

If magic_quotes_gpc is not enabled (you can check with
get_magic_quotes_gpc(), btw), then you'd use this:

$text = addslashes($text);
$query = "INSERT INTO yourtable (textcolumn) VALUES ('$text')";

If you'd like to extract the winning lottery numbers from $text, you
simply...

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals - www.phparch.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Need help with line breaks in a textarea form

2004-07-16 Thread PHP User
 
John,

Something came to mind as soon as I sent my last email, and it seems to
work. Not sure it will work in every circumstance but the few tests I tried
seemed ok. This is what I did. I added the two following lines to my script.

$text=str_replace("\n","",$text);
$text=str_replace("","",$text);

Thanks for your input

CR

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: July 16, 2004 2:00 AM
To: PHP User
Cc: PHP
Subject: Re: [PHP] Need help with line breaks in a textarea form

PHP User wrote:

> Hi,
> 
> I have been trying to format the textarea output and have come across 
> some code that almost does what I need, but I still have one small
problem.
> 
> Look at the text below that was input into my textarea:
> 
> Now is the time for all young men to come to the aid of the party. Now 
> is the time for all young men to come to the aid of the party.
> Testing
> Now is the time for all young men to come to the aid of the party. Now 
> is the time for all young men to come to the aid of the party.
> Testing.
> 
> When I print this out to my webpage it has a line break before and 
> after the word Testing. I want it to be a wysiwyg - so in the case 
> above there should be no extra line breaks. It should look exactly as
typed.
> 
> The code I tried to change the \n to  are:
> 
> $text2= nl2br ($text);
> or
> $text2 str_replace("\n","",$text);
> 
> This is what I have in my form.
> 
> 



--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals - www.phparch.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Need help with line breaks in a textarea form

2004-07-16 Thread PHP User
 
Thanks for the info John, but your suggestion produces the same output. Look
at the source below to see what it produces.

Now is the time for all young men to come to the aid of the party. Now is
the time for all young men to come to the aid of the party.

Testing

Now is the time for all young men to come to the aid of the party. Now
is the time for all young men to come to the aid of the party.

Testing

After 'party' and 'Testing' I hit enter twice, but as you can see above it
adds a 3rd and 4th ...

Suggestions?

Thanks


-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: July 16, 2004 2:00 AM
To: PHP User
Cc: PHP
Subject: Re: [PHP] Need help with line breaks in a textarea form

PHP User wrote:

> Hi,
> 
> I have been trying to format the textarea output and have come across 
> some code that almost does what I need, but I still have one small
problem.
> 
> Look at the text below that was input into my textarea:
> 
> Now is the time for all young men to come to the aid of the party. Now 
> is the time for all young men to come to the aid of the party.
> Testing
> Now is the time for all young men to come to the aid of the party. Now 
> is the time for all young men to come to the aid of the party.
> Testing.
> 
> When I print this out to my webpage it has a line break before and 
> after the word Testing. I want it to be a wysiwyg - so in the case 
> above there should be no extra line breaks. It should look exactly as
typed.
> 
> The code I tried to change the \n to  are:
> 
> $text2= nl2br ($text);
> or
> $text2 str_replace("\n","",$text);
> 
> This is what I have in my form.
> 
> 



--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals - www.phparch.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Need help with line breaks in a textarea form

2004-07-15 Thread PHP User
Hi,

I have been trying to format the textarea output and have come across some
code that almost does what I need, but I still have one small problem.

Look at the text below that was input into my textarea:

Now is the time for all young men to come to the aid of the party. Now is
the time for all young men to come to the aid of the party.
Testing
Now is the time for all young men to come to the aid of the party. Now is
the time for all young men to come to the aid of the party.
Testing.

When I print this out to my webpage it has a line break before and after the
word Testing. I want it to be a wysiwyg - so in the case above there should
be no extra line breaks. It should look exactly as typed.

The code I tried to change the \n to  are:

$text2= nl2br ($text); 
or
$text2 str_replace("\n","",$text);

This is what I have in my form.



Thanks, any help is appreciated.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Email Forms

2004-07-15 Thread PHP User
Hi,

I am trying unsuccessfully to set up an email form and as far as I know my
code is fine, but it won't send. I suspect that it's because my server
requires authentication.

Running my script on my Windows machine I get the following.

Warning: mail() [function.mail  ]: SMTP
server response: 550 not local host myhost.ca, not a gateway in...

On Linux I don't get a specific error message, the mail just never shows up.

I am in the right ballpark here with the authentication, and if so, how can
I get around this..?

Thanks



[PHP] IMAP and I make... and what do I get recursion :)

2002-06-18 Thread php user

At this point in the make I get this error related to --with-imap and
--with-ssl-imap ...I believe

Making all in .
make[1]: Entering directory `/usr/lib/php-4.2.1'
/bin/sh /usr/lib/php-4.2.1/libtool --silent --mode=link gcc  -I.
-I/usr/lib/php-4.2.1/ -I/usr/lib/php-4.2.1/main -I/usr/lib/php-4.2.1
-I/usr/include/apache -I/usr/lib/php-4.2.1/Zend -I/usr/include/imap
-I/usr/libmcal/ -I/usr/lib/php-4.2.1/ext/mysql/libmysql
-I/usr/lib/php-4.2.1/ext/xml/expat  -DLINUX=22 -DDEV_RANDOM=/dev/random -DEAPI
-DEAPI_MM -I/usr/lib/php-4.2.1/TSRM -g -O2 -prefer-pic   -o libphp4.la -rpath
/usr/lib/php-4.2.1/libs -avoid-version -L/usr/bin/openssl/lib -L/usr/libmcal/ 
-R /usr/bin/openssl/lib -R /usr/libmcal/ stub.lo  Zend/libZend.la
sapi/apache/libsapi.la main/libmain.la regex/libregex.la
/usr/lib/php-4.2.1/ext/ctype/libctype.la /usr/lib/php-4.2.1/ext/ftp/libftp.la
/usr/lib/php-4.2.1/ext/gettext/libgettext.la
/usr/lib/php-4.2.1/ext/imap/libimap.la /usr/lib/php-4.2.1/ext/mcal/libmcal.la
/usr/lib/php-4.2.1/ext/mysql/libmysql.la /usr/lib/php-4.2.1/ext/pcre/libpcre.la
/usr/lib/php-4.2.1/ext/posix/libposix.la
/usr/lib/php-4.2.1/ext/session/libsession.la
/usr/lib/php-4.2.1/ext/standard/libstandard.la
/usr/lib/php-4.2.1/ext/xml/libxml.la TSRM/libtsrm.la -lmcal -lcrypto -lssl
-lc-client -lcrypt -lintl -lcrypt -lresolv -lm -ldl -lnsl -lresolv -lcrypt -ldl
make[1]: Leaving directory `/usr/lib/php-4.2.1'

I received this error message-->

/usr/bin/ld: cannot find -lcrypto
collect2: ld returned 1 exit status
make[1]: *** [libphp4.la] Error 1
make: *** [all-recursive] Error 1

Mandrake 8.2 PPC
Had to compile own php for use with horde's imp also this is DSO configure.
I hope someone thinks this is a simple question. ...with a simple answere...

Thank You,
-Eric


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] IMAP and make

2002-06-18 Thread php user

At this point in the make I get this error related to --with-imap and
--with-ssl-imap ...I believe

Making all in .
make[1]: Entering directory `/usr/lib/php-4.2.1'
/bin/sh /usr/lib/php-4.2.1/libtool --silent --mode=link gcc  -I.
-I/usr/lib/php-4.2.1/ -I/usr/lib/php-4.2.1/main -I/usr/lib/php-4.2.1
-I/usr/include/apache -I/usr/lib/php-4.2.1/Zend -I/usr/include/imap
-I/usr/libmcal/ -I/usr/lib/php-4.2.1/ext/mysql/libmysql
-I/usr/lib/php-4.2.1/ext/xml/expat  -DLINUX=22 -DDEV_RANDOM=/dev/random -DEAPI
-DEAPI_MM -I/usr/lib/php-4.2.1/TSRM -g -O2 -prefer-pic   -o libphp4.la -rpath
/usr/lib/php-4.2.1/libs -avoid-version -L/usr/bin/openssl/lib -L/usr/libmcal/ 
-R /usr/bin/openssl/lib -R /usr/libmcal/ stub.lo  Zend/libZend.la
sapi/apache/libsapi.la main/libmain.la regex/libregex.la
/usr/lib/php-4.2.1/ext/ctype/libctype.la /usr/lib/php-4.2.1/ext/ftp/libftp.la
/usr/lib/php-4.2.1/ext/gettext/libgettext.la
/usr/lib/php-4.2.1/ext/imap/libimap.la /usr/lib/php-4.2.1/ext/mcal/libmcal.la
/usr/lib/php-4.2.1/ext/mysql/libmysql.la /usr/lib/php-4.2.1/ext/pcre/libpcre.la
/usr/lib/php-4.2.1/ext/posix/libposix.la
/usr/lib/php-4.2.1/ext/session/libsession.la
/usr/lib/php-4.2.1/ext/standard/libstandard.la
/usr/lib/php-4.2.1/ext/xml/libxml.la TSRM/libtsrm.la -lmcal -lcrypto -lssl
-lc-client -lcrypt -lintl -lcrypt -lresolv -lm -ldl -lnsl -lresolv -lcrypt -ldl
make[1]: Leaving directory `/usr/lib/php-4.2.1'

I received this error message-->

/usr/bin/ld: cannot find -lcrypto
collect2: ld returned 1 exit status
make[1]: *** [libphp4.la] Error 1
make: *** [all-recursive] Error 1

Mandrake 8.2 PPC
Had to compile own php for use with horde's imp also this is DSO configure.
I hope someone thinks this is a simple question.

Thank You,
-Eric

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Combine 2 Db Columns with an Array?

2002-05-13 Thread PHP User

I am trying to find the best way to combine 2 columns in a MySQL Db call into
one by using an array. I’ve tried array_push, implode, explode, array_merge and
extract all with no luck. I feel I am close but have read all I can and still am
hitting a dead end.
I need to select a Title and Alternate title from a table, and then list the
results by BOTH the Title and Alternate Title. So the list that gets echoed out
would be a combined array of the Title column and the Alt_Title column. The idea
is to have each item listed twice, once by it’s title and once by it’s alternate
title.
I can not find a way to merge the 2 separate columns.
Here’s what I’m trying to do:

$result = mysql_query("SELECT Title, Alt_Title, Size, Price, More, Comment
ORDER BY title");

//magically combine the title & alt_title into on nice variable called
$Title
//or whatever
while ($db = mysql_fetch_array($result))
{
echo “$Title”;
}





[PHP] Mail() Speed?

2001-04-05 Thread PHP User

Would opening a direct connection to sendmail be a bad thing to do in terms of speed 
and server time?
Right now I loop through an array of email addresses, and just send them each out with 
mail() would something like this be better or worse in terms of the amount of time and 
resources it uses on the server?

0) { return 1; } else { return 0; } }
?>


*
Sign up for these FREE offers and have the chance to win money and prizes!
Click Here http://winwith.chek.com/promotions.php3?partnerid=7"
*

-- 
PHP General 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] max_execution_time && sleep()

2001-04-05 Thread PHP User

What is the deal with sleep(), does it break the 'max_execution_time' that is set in 
php.ini?

This is good, this is what I want, but I just want to double check that this is really 
happening.

I have an emial script that seems to run for about 15 minutes because I sleep() it 
between each email for a few seconds. It runs way longer than 'max_execution_time' is 
set for.

-

*
Sign up for these FREE offers and have the chance to win money and prizes!
Click Here http://winwith.chek.com/promotions.php3?partnerid=7"
*

-- 
PHP General 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] Executing a PHP file to write an html file

2001-03-31 Thread PHP User

Here is my problem.
I have a file, static.php
static.php writes to index.html by way of...
$filename = "/web/h16/docs/index.html";
$fp = fopen("$filename","w");
fwrite($fp, "\n");
etc..

If I hit static.php from the command line, index.html gets written just fine. 
static.php does it's job.

If I try to exec(), or  system() static.php from a browser the browser just hangs. eg. 

I add:
system ('/usr/local/bin/php web/h16/docs/index.html);
or
exec ('/usr/local/bin/php web/h16/docs/index.html);
To a file and get nothing. I tried with and without the absolute paths in the 
commands.

What I want to be able to do is every time I update a Db, at the same time I want the 
index page to be rewritten to reflect the changes in the Db. And I don't want to have 
to go to the command line everytime I want to rewrite the index page. So I would just 
hit "SAve" in the update.php page, it would save to the Db, which it does now, and at 
the same time it hits static.php and therefore rewrites index.html

I also tried header() but that was no good due to echo in the pages, gives that header 
already sent error.

Is there a funtion I am missing somehwere that does the job?

It's a Unix box running php 4.03, and the Db is MySQL

Thanks Much!!

-

*
Sign up for these FREE offers and have the chance to win money and prizes!
Click Here http://winwith.chek.com/promotions.php3?partnerid=7"
*

-- 
PHP General 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] PHP && mySQL

2001-02-07 Thread PHP user
HI!

I am Japanese in Tokyo.
How about you? I still have a question.

initial condition
1)  three are many *html in my SQL ex:xxx.html,and yyy.html 
2)I have domain ex: abc (ex: http://www.abc.com)
3)database  name : aaa
4)table name :bbb


I want to try next step.
when I type in URL from brouze ,ex http://www.abc.com/xxx.html .
I can get xxx.html from my SQL.
when I type in URL from brouze ,ex http://www.abc.com/yyy.html
I can get yyy.html from my SQL.
How can I do this?
Is it posible to create it?


Please answer for me.


Thank you
yui

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