php-general Digest 25 Apr 2009 13:36:05 -0000 Issue 6086

Topics (messages 291960 through 291969):

Re: SMTP mail server
        291960 by: Adam Williams
        291961 by: kranthi
        291962 by: Ron Piggott
        291963 by: Ron Piggott
        291964 by: kranthi
        291966 by: Manuel Lemos

Re: Self-Process php forms or not?
        291965 by: Manuel Lemos

Re: I need ideas for things to code
        291967 by: tedd

PHP CLI vs WebServed
        291968 by: Simon
        291969 by: Richard Heyes

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


Ron Piggott wrote:
How do I specify an actual SMTP server?  (Like mail.host.com)

This is what I have so far:

mail($email, $subject, $message, $headers);

I was to http://ca2.php.net/manual/en/function.mail.php and saw this
syntax:

mail ( string $to , string $subject , string $message [, string
$additional_headers [, string $additional_parameters ]] )

Ronhttp://

http://www.php.net/manual/en/mail.configuration.php

looks like you can edit php.ini and change SMTP=localhost to something else and restart apache (if needed)


--- End Message ---
--- Begin Message ---
if u cant change the configuration settings of php.ini
use http://pear.php.net/package/Mail
alternatively u can also hav ini_set on top of every page.

--- End Message ---
--- Begin Message ---
I am on a shared web site hosting company.  They are asking me to edit
my PHP script to specify the SMTP using $aditional_parameters on the URL
below.  If this can't be achieved then I need to confirm this.

Ron


On Fri, 2009-04-24 at 20:04 -0500, Adam Williams wrote:

> 
> Ron Piggott wrote:
> > How do I specify an actual SMTP server?  (Like mail.host.com)
> >
> > This is what I have so far:
> >
> > mail($email, $subject, $message, $headers);
> >
> > I was to http://ca2.php.net/manual/en/function.mail.php and saw this
> > syntax:
> >
> > mail ( string $to , string $subject , string $message [, string
> > $additional_headers [, string $additional_parameters ]] )
> >
> > Ronhttp://
> >
> >   
> http://www.php.net/manual/en/mail.configuration.php
> 
> looks like you can edit php.ini and change SMTP=localhost to something 
> else and restart apache (if needed)
> 

--- End Message ---
--- Begin Message ---
I am needing to put this into one specific PHP script.  What would the
ini_set look like?  Ron


On Sat, 2009-04-25 at 06:43 +0530, kranthi wrote:

> if u cant change the configuration settings of php.ini
> use http://pear.php.net/package/Mail
> alternatively u can also hav ini_set on top of every page.

--- End Message ---
--- Begin Message ---
ini_set("SMTP", "mail.host.com");
ini_set("smtp_port", 25);

http://ca2.php.net/manual/en/mail.configuration.php
http://ca2.php.net/manual/en/function.ini-set.php

--- End Message ---
--- Begin Message ---
Hello,

on 04/24/2009 10:17 PM Ron Piggott said the following:
> I am on a shared web site hosting company.  They are asking me to edit
> my PHP script to specify the SMTP using $aditional_parameters on the URL
> below.  If this can't be achieved then I need to confirm this.

No, AFAIK you cannot configure the SMTP server that way, unless your Web
hosting company hacked the mail function. Otherwise, I think they have
no idea how to do it and are wild guessing.

The fact is that you do not need to use an SMTP server, especially if
your web host is run on Linux or any Unix like system.

In Linux the mail function just injects the message in the local mail
server queue and from then on the mail server sends the message to the
remote recipient domain SMTP server so it reaches the destination mailbox.

You may want to watch this slide presentation that has a slide that
explains exactly how mail messages are routed. Take a look at slide 13.

http://www.phpclasses.org/browse/video/3/package/9.html


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
Hello,

on 04/24/2009 09:34 AM MEM said the following:
> I’m trying to understand the advantages behind opting by using a
> Self-Process PHP Form, instead of having a form and then point the action of
> the form to another .php page. 
>  
> Can anyone point me some resources about this. Why using one instead of
> another. What are the main advantages?

You may want to watch this tutorial video that explains why presenting
and processing a form with a single script is a better solution.

http://www.phpclasses.org/browse/video/1/package/1/section/usage.html

Basically if you use the same script, if the form has invalid fields,
you can present the form with the previously submitted values.


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
At 7:00 PM -0400 4/24/09, Andrew Hucks wrote:
I've been coding PHP for about a year, and I'm running out of things to code
that force me to learn new things. If you have any suggestions, I'd greatly
appreciate it.

Andrew:

Here's an idea. Go through the php manuals and make small examples of everything you find.

That way not only do you learn, but you have examples to fall back on when the need rises.

Here's a small (believe me) portion of the demo's I've written over the years:

http://webbytedd.com/a.php

These cover different languages, but it will give you the idea. Just make a inventory of examples and post them with code. Not only will it help you, but might help others when you answer questions on this list showing the solution.

Cheers,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
Hi there,
  I've been using PHP for a very long time now, a few years ago
developing webapplications with apache and mysql, now and for a few
years using mostly the CLI (mostly as a replacement of all other
scripting languages available on linux, sh, pearl, etc...).  However,
I'm building a project that works very much like a webserver (and does
much custom stuff) and i would like to execute php files in a similar
way as they are executed by a server like apache.

  I've been executing php from my C/C++ executable simply by writing
the HTTP query string in a temp file (/dev/shm/...) and then executing
the php file like so:
// usage is:  phpfile.php  <input/querystring file>  <output file destination>
system("php /path/to/phpfile.php
/dev/shm/this_executions_querystring.txt
/dev/shm/this_execution_output_destination.txt");

  But the problem is that this phpfile.php has to be made to read the
content of the querystring file to get it, etc...  also this design
will write the output file to /dev/shm, which is then read and sent my
the main program.  I'm going to use popen in the future...
  I'd prefer if i could somehow, on the CLI, set the global variables
like $_SERVER and others...  this would make it so my software could
execute any php file that was built for another webserver
transparently.  Is this possible on the CLI?  Is there a simple way to
do what I want?  (Btw, the server is already handling all the HTTP
packaging/parsing, the problem is really just with the execution)

Thanks in advance for any suggestions!

Simon
-- 
When Earth was the only inhabited planet in the Galaxy, it was a
primitive place, militarily speaking.  The only weapon they had ever
invented worth mentioning was a crude and inefficient nuclear-reaction
bomb for which they had not even developed the logical defense. -
Asimov

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

>...

Never done this, but could you set environment variables, which would
then be picked up by PHP (and stuffed in $_ENV)?

-- 
Richard Heyes
HTML5 graphing: RGraph (www.rgraph.net)
PHP mail: RMail (www.phpguru.org/rmail)
PHP datagrid: RGrid (www.phpguru.org/rgrid)
PHP Template: RTemplate (www.phpguru.org/rtemplate)

--- End Message ---

Reply via email to