php-general Digest 17 Jun 2007 13:13:17 -0000 Issue 4853

Topics (messages 257191 through 257211):

php framework, large site
        257191 by: martins

$_SERVER['HTTP_ACCEPT_ENCODING'] unavailable
        257192 by: Vlad Vlasceanu

I have a problem with nobody!
        257193 by: BSumrall
        257194 by: Stut
        257195 by: BSumrall
        257197 by: BSumrall
        257198 by: BSumrall
        257201 by: Robert Cummings

Appending to an Array
        257196 by: Keith Spiller
        257199 by: Vlad Vlasceanu
        257202 by: Keith Spiller

Re: I have a problem with nobody! SOLVED!
        257200 by: BSumrall
        257207 by: Stut
        257209 by: tedd
        257210 by: Stut

Previous and Next Month and Year
        257203 by: Keith Spiller
        257204 by: Vlad Vlasceanu
        257205 by: Keith Spiller
        257206 by: Tom Rogers
        257208 by: Larry Garfield

New htmlentities() '$double_enocde' Param Question
        257211 by: Chris

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, can some body help me, how to start php framwork for large site?

--- End Message ---
--- Begin Message ---
Did anyone experience this?

I am working on a script that compresses the output, thus relying on $_SERVER['HTTP_ACCEPT_ENCODING'] to figure out how to encode it. The problem is 'http_accept_encoding' is missing from $_SERVER. I realize the value may not be available all the time, but it seems to be missing regardless of browser / site / etc. Firebug on Firefox shows the http request containing the accept_encoding header being sent to the server and it looks like it gets lost on the way. Is it a config issue in PHP, or in Apache? Can anybody help?

Thanks a lot,

Vlad

My platform is: PHP 5.2.1 + Apache 2.0.58 on Gentoo 2006.0

My $_SERVER looks roughly like this:
    [HTTP_HOST] => lab.vvvlad.com
[HTTP_USER_AGENT] => Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 [HTTP_ACCEPT] => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5
    [HTTP________________] => ------------
    [HTTP_ACCEPT_CHARSET] => UTF-8,*
    [HTTP_KEEP_ALIVE] => 300
    [HTTP_CONNECTION] => keep-alive
[HTTP_COOKIE] => tid=b0005b4e81a3dd4d1067884308f4d9fbdc6b169e802298eacdecdb6e9c34aa1a; sid=a55f5a7ea8d512c7115d53fedbcf8375 [PATH] => /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/sbin:/usr/sbin
    [SERVER_SIGNATURE] =>
    [SERVER_SOFTWARE] => Apache
    [SERVER_NAME] => lab.vvvlad.com
    [SERVER_ADDR] => 192.168.2.6
    [SERVER_PORT] => 80
    [DOCUMENT_ROOT] => /srv/hosts/lab.vvvlad.com/htdocs
    [SERVER_ADMIN] => [EMAIL PROTECTED]
    [SCRIPT_FILENAME] => /srv/hosts/lab.vvvlad.com/htdocs/server.php
    [REMOTE_PORT] => 1752
    [GATEWAY_INTERFACE] => CGI/1.1
    [SERVER_PROTOCOL] => HTTP/1.1
    [REQUEST_METHOD] => GET
    [QUERY_STRING] =>
    [REQUEST_URI] => /server.php
    [SCRIPT_NAME] => /server.php
    [PHP_SELF] => /server.php
    [REQUEST_TIME] => 1182044854

--- End Message ---
--- Begin Message ---
I have been googling this to death and have many references to this, but all
solutions seem to either
1 not apply
2 result in parse error

The code:
mail ($to, $subject, $message, $header);

The error

Email is sent to recipient as [EMAIL PROTECTED]  (fqdn = fully qualified
domain name)

I have read about a -f function.
I tried 
mail ($to, $subject, $message, -f$header);
mail -f($to, $subject, $message, $header);

both result in parse error.

I read about changing a php_value in my httpd.conf
Couldn't find any reference.

So, I turn to my friends on the php_list

Any assistance would really be appreciated!

Running CentOS
Cpanel
Exim

--- End Message ---
--- Begin Message ---
BSumrall wrote:
> I have read about a -f function.
> I tried 
> mail ($to, $subject, $message, -f$header);
> mail -f($to, $subject, $message, $header);
> 
> both result in parse error.

Boy did you not read the documentation carefully!

mail($to, $subject, $message, $headers, '[EMAIL PROTECTED]');

Go back and read http://php.net/function.mail properly.

-Stut

--- End Message ---
--- Begin Message ---
PS
mail ($to, $subject, $message, $header, '-f
[EMAIL PROTECTED]');

doesn't work either.

Still have nobody to deal with.
As per being RFC compliant!

-----Original Message-----
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 17, 2007 12:15 AM
To: BSumrall
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] I have a problem with nobody!

BSumrall wrote:
> I have read about a -f function.
> I tried 
> mail ($to, $subject, $message, -f$header);
> mail -f($to, $subject, $message, $header);
> 
> both result in parse error.

Boy did you not read the documentation carefully!

mail($to, $subject, $message, $headers, '[EMAIL PROTECTED]');

Go back and read http://php.net/function.mail properly.

-Stut

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

--- End Message ---
--- Begin Message ---
Well, I am now 1 step closer

The php file do nor reference the importance of "having no spaces" between
the -f and email address.
[EMAIL PROTECTED] is key!

But, still can't get rid of nobody.

How do I make nobody disappear?

Here is my message header now.

Nobody [EMAIL PROTECTED]

Using:

mail ($to, $subject, $message, $header,
'[EMAIL PROTECTED]');

-----Original Message-----
From: BSumrall [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 17, 2007 12:19 AM
To: 'Stut'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] I have a problem with nobody!

PS
mail ($to, $subject, $message, $header, '-f
[EMAIL PROTECTED]');

doesn't work either.

Still have nobody to deal with.
As per being RFC compliant!

-----Original Message-----
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 17, 2007 12:15 AM
To: BSumrall
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] I have a problem with nobody!

BSumrall wrote:
> I have read about a -f function.
> I tried 
> mail ($to, $subject, $message, -f$header);
> mail -f($to, $subject, $message, $header);
> 
> both result in parse error.

Boy did you not read the documentation carefully!

mail($to, $subject, $message, $headers, '[EMAIL PROTECTED]');

Go back and read http://php.net/function.mail properly.

-Stut

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

--- End Message ---
--- Begin Message ---
Let's take it one step further for arguments sake.

What is I wanted to change "nobody" as the sender to, let's just say Larry
or Curly, or Moe?
Making message header as;
Larry Shmuckatelli  [EMAIL PROTECTED]
Or
Curly Shmuckatelli  [EMAIL PROTECTED]
Or
Moe Shmuckatelli  [EMAIL PROTECTED]

What is the php driving force that controls the "who sent me" function?

-----Original Message-----
From: BSumrall [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 17, 2007 12:31 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] I have a problem with nobody!

Well, I am now 1 step closer

The php file do nor reference the importance of "having no spaces" between
the -f and email address.
[EMAIL PROTECTED] is key!

But, still can't get rid of nobody.

How do I make nobody disappear?

Here is my message header now.

Nobody [EMAIL PROTECTED]

Using:

mail ($to, $subject, $message, $header,
'[EMAIL PROTECTED]');

-----Original Message-----
From: BSumrall [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 17, 2007 12:19 AM
To: 'Stut'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] I have a problem with nobody!

PS
mail ($to, $subject, $message, $header, '-f
[EMAIL PROTECTED]');

doesn't work either.

Still have nobody to deal with.
As per being RFC compliant!

-----Original Message-----
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 17, 2007 12:15 AM
To: BSumrall
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] I have a problem with nobody!

BSumrall wrote:
> I have read about a -f function.
> I tried 
> mail ($to, $subject, $message, -f$header);
> mail -f($to, $subject, $message, $header);
> 
> both result in parse error.

Boy did you not read the documentation carefully!

mail($to, $subject, $message, $headers, '[EMAIL PROTECTED]');

Go back and read http://php.net/function.mail properly.

-Stut

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

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

--- End Message ---
--- Begin Message ---
Can't you just set the "From" and "Reply-to" headers?

<?php

$headers =
    "From: [EMAIL PROTECTED]"
   ."Reply-to: [EMAIL PROTECTED]"
   ."\n";

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

?>

BTW, if you look at Stut's post, and you're response, you've placed the
"parameters" parameter in the "headers" parameter location, thus totally
borking the purpose of setting the "parameters" parameter >:)

Cheers,
Rob.


On Sun, 2007-06-17 at 00:39 -0400, BSumrall wrote:
> Let's take it one step further for arguments sake.
> 
> What is I wanted to change "nobody" as the sender to, let's just say Larry
> or Curly, or Moe?
> Making message header as;
> Larry Shmuckatelli  [EMAIL PROTECTED]
> Or
> Curly Shmuckatelli  [EMAIL PROTECTED]
> Or
> Moe Shmuckatelli  [EMAIL PROTECTED]
> 
> What is the php driving force that controls the "who sent me" function?
> 
> -----Original Message-----
> From: BSumrall [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, June 17, 2007 12:31 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] I have a problem with nobody!
> 
> Well, I am now 1 step closer
> 
> The php file do nor reference the importance of "having no spaces" between
> the -f and email address.
> [EMAIL PROTECTED] is key!
> 
> But, still can't get rid of nobody.
> 
> How do I make nobody disappear?
> 
> Here is my message header now.
> 
> Nobody [EMAIL PROTECTED]
> 
> Using:
> 
> mail ($to, $subject, $message, $header,
> '[EMAIL PROTECTED]');
> 
> -----Original Message-----
> From: BSumrall [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, June 17, 2007 12:19 AM
> To: 'Stut'
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] I have a problem with nobody!
> 
> PS
> mail ($to, $subject, $message, $header, '-f
> [EMAIL PROTECTED]');
> 
> doesn't work either.
> 
> Still have nobody to deal with.
> As per being RFC compliant!
> 
> -----Original Message-----
> From: Stut [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, June 17, 2007 12:15 AM
> To: BSumrall
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] I have a problem with nobody!
> 
> BSumrall wrote:
> > I have read about a -f function.
> > I tried 
> > mail ($to, $subject, $message, -f$header);
> > mail -f($to, $subject, $message, $header);
> > 
> > both result in parse error.
> 
> Boy did you not read the documentation carefully!
> 
> mail($to, $subject, $message, $headers, '[EMAIL PROTECTED]');
> 
> Go back and read http://php.net/function.mail properly.
> 
> -Stut

-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

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

RE:  Appending to an Array

Here is my code:

# PREVIOUS MONTH -------------------------------------------------------------
   $days = array(
       10=>array("/weblog/archive/2004/Jan/02","linked-day"),
       12=>array("/weblog/archive/2004/Jan/03","linked-day"),
       25=>array("/weblog/archive/2004/Jan/08","linked-day"));
   phpcalendar($year, $month-1, $days, $month_href);
 # ----------------------------------------------------------------------------

# CURRENT MONTH --------------------------------------------------------------
   $days = array(
       2=>array("/weblog/archive/2004/Jan/02","linked-day"),
       3=>array("/weblog/archive/2004/Jan/03","linked-day"),
       8=>array("/weblog/archive/2004/Jan/08","linked-day"),
       22=>array("/weblog/archive/2004/Jan/22","linked-day"));
   phpcalendar($year, $month, $days, $month_href);
 # ----------------------------------------------------------------------------

# NEXT MONTH -----------------------------------------------------------------
   $days = array(
       17=>array("/weblog/archive/2004/Jan/02","linked-day"),
       18=>array("/weblog/archive/2004/Jan/03","linked-day"),
       19=>array("/weblog/archive/2004/Jan/08","linked-day"));
   phpcalendar($year, $month+1, $days, $month_href);
 # ----------------------------------------------------------------------------


function phpcalendar($year, $month, $days, $month_href) {

 $weekday_lth = 1;

# TODAY ----------------------------------------------------------------------
   $this_day = date('j',time());
   $this_month = date('n', time());
   $this_year = date('Y', time());
   $month_href = "?year=$year&month=$month";
   $days .= array($this_day=>array("#","today-day"));
 # ----------------------------------------------------------------------------

 echo "<div class=\"divfloat\">";
 echo generate_calendar($year, $month, $days, $weekday_lth, $month_href);
 echo "</div>";
}


My problem is with the 7th line from the end:
   $days .= array($this_day=>array("#","today-day"));

I want to append these values to the $days array (if the month, day and year match) but this technique causes a parse error. Any ideas? Thanks for your help...


Keith
--- End Message ---
--- Begin Message ---
"." is the concatenation operator, usually applies only to strings

try:
$days[] = array($this_day=>array("#","today-day"));

or actually:
$days[$this_day] = array("#","today-day");

since it looks like you're indexing based on the day


Keith Spiller wrote:
Hi Folks,

RE:  Appending to an Array

Here is my code:

# PREVIOUS MONTH -------------------------------------------------------------
   $days = array(
       10=>array("/weblog/archive/2004/Jan/02","linked-day"),
       12=>array("/weblog/archive/2004/Jan/03","linked-day"),
       25=>array("/weblog/archive/2004/Jan/08","linked-day"));
   phpcalendar($year, $month-1, $days, $month_href);
# ----------------------------------------------------------------------------

# CURRENT MONTH --------------------------------------------------------------
   $days = array(
       2=>array("/weblog/archive/2004/Jan/02","linked-day"),
       3=>array("/weblog/archive/2004/Jan/03","linked-day"),
       8=>array("/weblog/archive/2004/Jan/08","linked-day"),
       22=>array("/weblog/archive/2004/Jan/22","linked-day"));
   phpcalendar($year, $month, $days, $month_href);
# ----------------------------------------------------------------------------

# NEXT MONTH -----------------------------------------------------------------
   $days = array(
       17=>array("/weblog/archive/2004/Jan/02","linked-day"),
       18=>array("/weblog/archive/2004/Jan/03","linked-day"),
       19=>array("/weblog/archive/2004/Jan/08","linked-day"));
   phpcalendar($year, $month+1, $days, $month_href);
# ----------------------------------------------------------------------------


function phpcalendar($year, $month, $days, $month_href) {

 $weekday_lth = 1;

# TODAY ----------------------------------------------------------------------
   $this_day = date('j',time());
   $this_month = date('n', time());
   $this_year = date('Y', time());
   $month_href = "?year=$year&month=$month";
   $days .= array($this_day=>array("#","today-day"));
# ----------------------------------------------------------------------------

 echo "<div class=\"divfloat\">";
 echo generate_calendar($year, $month, $days, $weekday_lth, $month_href);
 echo "</div>";
}


My problem is with the 7th line from the end:
   $days .= array($this_day=>array("#","today-day"));

I want to append these values to the $days array (if the month, day and year match) but this technique causes a parse error. Any ideas? Thanks for your help...


Keith

--- End Message ---
--- Begin Message --- Awesome Vlad. You fixed it with your second example perfectly! Thank you so much.

Keith

----- Original Message ----- From: "Vlad Vlasceanu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 16, 2007 10:43 PM
Subject: [PHP] Re: Appending to an Array


"." is the concatenation operator, usually applies only to strings

try:
$days[] = array($this_day=>array("#","today-day"));

or actually:
$days[$this_day] = array("#","today-day");

since it looks like you're indexing based on the day


Keith Spiller wrote:
Hi Folks,

RE:  Appending to an Array

Here is my code:

# PREVIOUS MONTH -------------------------------------------------------------
   $days = array(
       10=>array("/weblog/archive/2004/Jan/02","linked-day"),
       12=>array("/weblog/archive/2004/Jan/03","linked-day"),
       25=>array("/weblog/archive/2004/Jan/08","linked-day"));
   phpcalendar($year, $month-1, $days, $month_href);
 # ----------------------------------------------------------------------------


# CURRENT MONTH --------------------------------------------------------------
   $days = array(
       2=>array("/weblog/archive/2004/Jan/02","linked-day"),
       3=>array("/weblog/archive/2004/Jan/03","linked-day"),
       8=>array("/weblog/archive/2004/Jan/08","linked-day"),
       22=>array("/weblog/archive/2004/Jan/22","linked-day"));
   phpcalendar($year, $month, $days, $month_href);
 # ----------------------------------------------------------------------------


# NEXT MONTH -----------------------------------------------------------------
   $days = array(
       17=>array("/weblog/archive/2004/Jan/02","linked-day"),
       18=>array("/weblog/archive/2004/Jan/03","linked-day"),
       19=>array("/weblog/archive/2004/Jan/08","linked-day"));
   phpcalendar($year, $month+1, $days, $month_href);
 # ----------------------------------------------------------------------------



function phpcalendar($year, $month, $days, $month_href) {

 $weekday_lth = 1;

# TODAY ----------------------------------------------------------------------
   $this_day = date('j',time());
   $this_month = date('n', time());
   $this_year = date('Y', time());
   $month_href = "?year=$year&month=$month";
   $days .= array($this_day=>array("#","today-day"));
 # ----------------------------------------------------------------------------


 echo "<div class=\"divfloat\">";
 echo generate_calendar($year, $month, $days, $weekday_lth, $month_href);
 echo "</div>";
}


My problem is with the 7th line from the end:
   $days .= array($this_day=>array("#","today-day"));

I want to append these values to the $days array (if the month, day and year match) but this technique causes a parse error. Any ideas? Thanks for your help...


Keith

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


--- End Message ---
--- Begin Message ---
The last paragraph of the page

Go figure!

The appropriate code is;

mail ($to, $subject, $message, $header = 'From: "Larry, Curly and Moe"
<[EMAIL PROTECTED]>');


-----Original Message-----
From: BSumrall [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 17, 2007 12:39 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] I have a problem with nobody!

Let's take it one step further for arguments sake.

What is I wanted to change "nobody" as the sender to, let's just say Larry
or Curly, or Moe?
Making message header as;
Larry Shmuckatelli  [EMAIL PROTECTED]
Or
Curly Shmuckatelli  [EMAIL PROTECTED]
Or
Moe Shmuckatelli  [EMAIL PROTECTED]

What is the php driving force that controls the "who sent me" function?

-----Original Message-----
From: BSumrall [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 17, 2007 12:31 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] I have a problem with nobody!

Well, I am now 1 step closer

The php file do nor reference the importance of "having no spaces" between
the -f and email address.
[EMAIL PROTECTED] is key!

But, still can't get rid of nobody.

How do I make nobody disappear?

Here is my message header now.

Nobody [EMAIL PROTECTED]

Using:

mail ($to, $subject, $message, $header,
'[EMAIL PROTECTED]');

-----Original Message-----
From: BSumrall [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 17, 2007 12:19 AM
To: 'Stut'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] I have a problem with nobody!

PS
mail ($to, $subject, $message, $header, '-f
[EMAIL PROTECTED]');

doesn't work either.

Still have nobody to deal with.
As per being RFC compliant!

-----Original Message-----
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 17, 2007 12:15 AM
To: BSumrall
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] I have a problem with nobody!

BSumrall wrote:
> I have read about a -f function.
> I tried 
> mail ($to, $subject, $message, -f$header);
> mail -f($to, $subject, $message, $header);
> 
> both result in parse error.

Boy did you not read the documentation carefully!

mail($to, $subject, $message, $headers, '[EMAIL PROTECTED]');

Go back and read http://php.net/function.mail properly.

-Stut

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

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

--- End Message ---
--- Begin Message ---
BSumrall wrote:
> The last paragraph of the page
> 
> Go figure!
> 
> The appropriate code is;
> 
> mail ($to, $subject, $message, $header = 'From: "Larry, Curly and Moe"
> <[EMAIL PROTECTED]>');

The final parameter is important and should also be included. It sets
the envelope sender which is the address the email will get bounced to
if necessary.

-Stut

> -----Original Message-----
> From: BSumrall [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, June 17, 2007 12:39 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] I have a problem with nobody!
> 
> Let's take it one step further for arguments sake.
> 
> What is I wanted to change "nobody" as the sender to, let's just say Larry
> or Curly, or Moe?
> Making message header as;
> Larry Shmuckatelli  [EMAIL PROTECTED]
> Or
> Curly Shmuckatelli  [EMAIL PROTECTED]
> Or
> Moe Shmuckatelli  [EMAIL PROTECTED]
> 
> What is the php driving force that controls the "who sent me" function?
> 
> -----Original Message-----
> From: BSumrall [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, June 17, 2007 12:31 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] I have a problem with nobody!
> 
> Well, I am now 1 step closer
> 
> The php file do nor reference the importance of "having no spaces" between
> the -f and email address.
> [EMAIL PROTECTED] is key!
> 
> But, still can't get rid of nobody.
> 
> How do I make nobody disappear?
> 
> Here is my message header now.
> 
> Nobody [EMAIL PROTECTED]
> 
> Using:
> 
> mail ($to, $subject, $message, $header,
> '[EMAIL PROTECTED]');
> 
> -----Original Message-----
> From: BSumrall [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, June 17, 2007 12:19 AM
> To: 'Stut'
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] I have a problem with nobody!
> 
> PS
> mail ($to, $subject, $message, $header, '-f
> [EMAIL PROTECTED]');
> 
> doesn't work either.
> 
> Still have nobody to deal with.
> As per being RFC compliant!
> 
> -----Original Message-----
> From: Stut [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, June 17, 2007 12:15 AM
> To: BSumrall
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] I have a problem with nobody!
> 
> BSumrall wrote:
>> I have read about a -f function.
>> I tried 
>> mail ($to, $subject, $message, -f$header);
>> mail -f($to, $subject, $message, $header);
>>
>> both result in parse error.
> 
> Boy did you not read the documentation carefully!
> 
> mail($to, $subject, $message, $headers, '[EMAIL PROTECTED]');
> 
> Go back and read http://php.net/function.mail properly.
> 
> -Stut
> 

--- End Message ---
--- Begin Message ---
The last paragraph of the page

Go figure!

The appropriate code is;

mail ($to, $subject, $message, $header = 'From: "Larry, Curly and Moe"
<[EMAIL PROTECTED]>');

Brad:

Don't forget to add the content.

mail($to, $subject, $headers, $body);

And you can also add "Reply-to: "

Such as:

$headers ='From: "Larry, Curly and Moe"<[EMAIL PROTECTED]>')>\n";
$headers .= 'Reply-to: "Moe"<[EMAIL PROTECTED]>' >\n";

And, IF you are permitted to use the fifth parameter:

$extra = "-f" . $fromAddress;

mail($to, $subject, $headers, $body, $extra);

or

ini_set('sendmail_from', '[EMAIL PROTECTED]');
mail($to, $subject, $headers, $body);

Cheers,

tedd


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

--- End Message ---
--- Begin Message ---
tedd wrote:
>> The last paragraph of the page
>>
>> Go figure!
>>
>> The appropriate code is;
>>
>> mail ($to, $subject, $message, $header = 'From: "Larry, Curly and Moe"
>> <[EMAIL PROTECTED]>');
> 
> Brad:
> 
> Don't forget to add the content.
> 
> mail($to, $subject, $headers, $body);

Headers and body should be the other way around.

> And you can also add "Reply-to: "
> 
> Such as:
> 
> $headers ='From: "Larry, Curly and Moe"<[EMAIL PROTECTED]>')>\n";
> $headers .= 'Reply-to: "Moe"<[EMAIL PROTECTED]>' >\n";

Strictly speaking, those line endings should be \r\n.

> And, IF you are permitted to use the fifth parameter:
> 
> $extra = "-f" . $fromAddress;
> 
> mail($to, $subject, $headers, $body, $extra);
> 
> or
> 
> ini_set('sendmail_from', '[EMAIL PROTECTED]');
> mail($to, $subject, $headers, $body);

AFAIK, the sendmail_from setting only has an effect when running on Win32.

-Stut

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

RE: Previous and Next Month and Year
This is my code:

 $next_month = date('F Y', time()+$month);
 $prev_month = date('F Y', time()-$month);

 echo "$prev_month <br /> \n";  #Result "June 2007"
 echo "$next_month <br /> \n";  #Result "June 2007"

What I am trying to do is get the month and year
based upon a + or - $month value.

The variable $month being "6" for the month of June of
the present year of 2007.
For example ($month -7) would be December 2006,
and ($month +7) would be January 2006.

Please help...  Thank you.

Keith

--- End Message ---
--- Begin Message --- time() returns a unix timestamp of the current moment in time (now), so in effect you are adding or subtracting 6 seconds to that.
calling:
date('m/d/Y', time());
is the same as calling:
date('m/d/Y');

On the other hand:
mktime(hour, minute, second, month, day, year) generates a timestamp such that:
mktime(0, 0, 0, date('d'), date('m') + 6, date('Y'));
would generate a date timestamp 6 months in the future.
or
mktime(0, 0, 0, 0, date('m'), date('Y'));
would generate last day from last month this year.

Word of wisdom: don't rely solely on timestamp calculations e.g. now + 24 hours and so on, because you may need to take into account daylight savings times and such otherwise your calculations may be off.

Vlad

Keith Spiller wrote:
Hi,

RE: Previous and Next Month and Year This is my code:

 $next_month = date('F Y', time()+$month);
 $prev_month = date('F Y', time()-$month);

 echo "$prev_month <br /> \n";  #Result "June 2007"
 echo "$next_month <br /> \n";  #Result "June 2007"

What I am trying to do is get the month and year
based upon a + or - $month value.

The variable $month being "6" for the month of June of
the present year of 2007. For example ($month -7) would be December 2006,
and ($month +7) would be January 2006.

Please help...  Thank you.

Keith

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

Thank you for taking the time to help me.

The code:
 $prev_month = date('F Y', mktime(0, 0, 0, 0, date('m') - 6, date('Y')));
 $next_month = date('F Y', mktime(0, 0, 0, 0, date('m') + 6, date('Y')));

 echo "$prev_month <br /> \n";
 echo "$next_month <br /> \n";

Generates:
November 2006 December 2006
The $prev_month value seems correct,
but the $next_month value should be:
 December 2008

Do you see my mistake?


Keith

----- Original Message ----- From: "Vlad Vlasceanu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 17, 2007 12:13 AM
Subject: [PHP] Re: Previous and Next Month and Year


time() returns a unix timestamp of the current moment in time (now), so in effect you are adding or subtracting 6 seconds to that.
calling:
date('m/d/Y', time());
is the same as calling:
date('m/d/Y');

On the other hand:
mktime(hour, minute, second, month, day, year) generates a timestamp such that:
mktime(0, 0, 0, date('d'), date('m') + 6, date('Y'));
would generate a date timestamp 6 months in the future.
or
mktime(0, 0, 0, 0, date('m'), date('Y'));
would generate last day from last month this year.

Word of wisdom: don't rely solely on timestamp calculations e.g. now + 24 hours and so on, because you may need to take into account daylight savings times and such otherwise your calculations may be off.

Vlad

Keith Spiller wrote:
Hi,

RE: Previous and Next Month and Year This is my code:

 $next_month = date('F Y', time()+$month);
 $prev_month = date('F Y', time()-$month);

 echo "$prev_month <br /> \n";  #Result "June 2007"
 echo "$next_month <br /> \n";  #Result "June 2007"

What I am trying to do is get the month and year
based upon a + or - $month value.

The variable $month being "6" for the month of June of
the present year of 2007. For example ($month -7) would be December 2006,
and ($month +7) would be January 2006.

Please help...  Thank you.

Keith

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


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

Sunday, June 17, 2007, 3:54:01 PM, you wrote:
KS> Hi,

KS> RE:  Previous and Next Month and Year    

KS> This is my code:

KS>   $next_month = date('F Y', time()+$month);
KS>   $prev_month = date('F Y', time()-$month);

KS>   echo "$prev_month <br /> \n";  #Result "June 2007"
KS>   echo "$next_month <br /> \n";  #Result "June 2007"

KS> What I am trying to do is get the month and year
KS> based upon a + or - $month value.

KS> The variable $month being "6" for the month of June of
KS> the present year of 2007.   

KS> For example ($month -7) would be December 2006,
KS> and ($month +7) would be January 2006.

KS> Please help...  Thank you.

KS> Keith


$now = strtotime(date('Y-m-15'));
$current = date('F',$now);
$last = date('F', strtotime('-1  month', $now));
$next = date('F',strtotime('+1  month', $now));
echo "Current:$current Previous:$last Next:$next\n";

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
I generally use strtotime() as the swiss army knife of PHP date handling.  You 
give it a string and a timestamp to use as a base, and it gives you back a 
new timestamp.  So you can say:

strtotime("+6 months", $sometimestamp);

And it will give you back the time stamp six months after $sometimestamp, 
taking into account leap years, changes of year, I think daylight savings 
(although I'm not certain of that), etc.  Really, if you want to do any sort 
of time math that's not second-based, strtotime() will take most of the hard 
work off your hands.  It's simply amazing.

On Sunday 17 June 2007, Keith Spiller wrote:
> Hi,
>
> RE:  Previous and Next Month and Year
>
> This is my code:
>
>   $next_month = date('F Y', time()+$month);
>   $prev_month = date('F Y', time()-$month);
>
>   echo "$prev_month <br /> \n";  #Result "June 2007"
>   echo "$next_month <br /> \n";  #Result "June 2007"
>
> What I am trying to do is get the month and year
> based upon a + or - $month value.
>
> The variable $month being "6" for the month of June of
> the present year of 2007.
>
> For example ($month -7) would be December 2006,
> and ($month +7) would be January 2006.
>
> Please help...  Thank you.
>
> Keith


-- 
Larry Garfield                  AIM: LOLG42
[EMAIL PROTECTED]               ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

--- End Message ---
--- Begin Message --- I just need a clarification about the new "$double_encode" param for htmlentities() and htmlspecialchars().

Is it supposed to do as I expect it to do in the code below or am I misuderstanding its use?

// Output: &lt;
echo htmlentities('<', ENT_QUOTES, false);

// Expected Output: &lt;
// Actual Output: &amp;lt;
echo htmlentities(htmlentities('<', ENT_QUOTES, false), ENT_QUOTES, false);


Thanks,
Chris

--- End Message ---

Reply via email to