[PHP] FW: No Subject

2013-03-16 Thread Ryan S
http://www.coachholidays.co.uk/ramlm/hfoqauyyvomdvio.kaxkucbebccxpzq



[PHP] Joining fixed text to a SUBJECT variable

2013-03-02 Thread Michael CALDER


-- G'day ,

I have a basically simple problem the solution to which has eluded me
for several days.

I have a form being handled by a .php file.

I want the received email sent by the form to have as its SUBJECT the
combination of the form name RVRA Contact Form -  and the MESSAGE
SUBJECT as chosen in the form drop down box.

Here is the current contact2.php file - but the SUBJECT only shows as
RVRA Contact Form -

?php

// get posted data into local variables
$EmailAddress = Trim(stripslashes($_POST['EmailAddress']));
$EmailTo = mikecal...@optusnet.com.au;
$Subject = RVRA Contact Form - ,$MessageSubject;
$Name = Trim(stripslashes($_POST['Name']));
$EmailAddress = Trim(stripslashes($_POST['EmailAddress']));
$YesNo = Trim(stripslashes($_POST['YesNo']));

$MessageSubject = Trim(stripslashes($_POST['MessageSubject']));
$Message = Trim(stripslashes($_POST['Message']));

// send email
if(!isset($_REQUEST['identiPIC_selected'])){exit;}

$identiPIC[1] = Bird;
$identiPIC[2] = Logo;
$identiPIC[3] = Flower;

if($_REQUEST['identiPIC_selected'] !== $identiPIC){print meta
http-equiv=\refresh\ content=\0;URL=error-pic.html\; exit;}




// prepare email body text
$Body = ;

$Body .= Name: ;
$Body .= $Name;
$Body .= \n;

$Body .= EmailAddress: ;
$Body .= $EmailAddress;
$Body .= \n;

$Body .= RVRA Member;
$Body .= $YesNo;
$Body .= \n;



$Body .= Message Subject: ;
$Body .= $MessageSubject;
$Body .= \n;

$Body .= Message: ;
$Body .= $Message;
$Body .= \n;


// send email
$success = mail($EmailTo, $Subject, $Body, From: $EmailAddress);

// redirect to success page
if ($success){
print meta http-equiv=\refresh\ content=\0;URL=thanks.html\;
}
else{
print meta http-equiv=\refresh\ content=\0;URL=error-pic.html\;
}

?

The critical line is line 4:

$Subject = RVRA Contact Form - ,$MessageSubject;

Can anyone please advise or point me in the right direction for
instructions on how to combine the fixed text with the variable
$MessageSubject.

Thanks

Mike

Michael CALDER
73/81 Willandra Road,
CROMER NSW 2099
02 9981 6327


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



Re: [PHP] Joining fixed text to a SUBJECT variable

2013-03-02 Thread Lester Caine

Michael CALDER wrote:

$Subject = RVRA Contact Form - ,$MessageSubject;

Can anyone please advise or point me in the right direction for
instructions on how to combine the fixed text with the variable
$MessageSubject.


The quick fix is simply
$Subject = RVRA Contact Form - .$MessageSubject;

but
$Subject = RVRA Contact Form - ,$MessageSubject;
should work, what is the error? ... you don't actually want the ','

$Subject = RVRA Contact Form - $MessageSubject;
Should work as well

--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP] Joining fixed text to a SUBJECT variable

2013-03-02 Thread Maciek Sokolewicz

On 2-3-2013 12:23, Lester Caine wrote:

Michael CALDER wrote:

$Subject = RVRA Contact Form - ,$MessageSubject;

Can anyone please advise or point me in the right direction for
instructions on how to combine the fixed text with the variable
$MessageSubject.


The quick fix is simply
$Subject = RVRA Contact Form - .$MessageSubject;

but
$Subject = RVRA Contact Form - ,$MessageSubject;
should work, what is the error? ... you don't actually want the ','

$Subject = RVRA Contact Form - $MessageSubject;
Should work as well



No it shouldn't, unless you have register_globals turned On. Which most 
hosts don't (and shouldn't) do.


The problem is the simple fact that the variable $MessageSubject is not 
defined until 4 lines farther into the script. Changing the variable to 
$_POST['MessageSubject'] (and concatenating using the concatenation 
operator (the period: '.' )) should fix this for you.


If Michael had E_NOTICE errors turned on, he would see an E_NOTICE: 
Undefined variable on line 6. Apparently, he doesn't show E_NOTICEs 
either.


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



Re: [PHP] Joining fixed text to a SUBJECT variable

2013-03-02 Thread Jim Giner

On 3/2/2013 7:03 AM, Maciek Sokolewicz wrote:


The problem is the simple fact that the variable $MessageSubject is not
defined until 4 lines farther into the script. Changing the variable to
$_POST['MessageSubject'] (and concatenating using the concatenation
operator (the period: '.' )) should fix this for you.

If Michael had E_NOTICE errors turned on, he would see an E_NOTICE:
Undefined variable on line 6. Apparently, he doesn't show E_NOTICEs
either.


Exactly.

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



Re: [PHP] Joining fixed text to a SUBJECT variable

2013-03-02 Thread tamouse mailing lists
On Sat, Mar 2, 2013 at 5:04 AM, Michael CALDER
mikecal...@optusnet.com.au wrote:

 -- G'day ,

G'day, cobber!

 Here is the current contact2.php file - but the SUBJECT only shows as
 RVRA Contact Form -

Others have addressed that, as well as not needing the stripslashes.
If you will permit, I have a few other comments. If not, simply
delete. No worries!

I added line numbers to make notation easier.


 1   ?php
 2  
 3   // get posted data into local variables
 4   $EmailAddress = Trim(stripslashes($_POST['EmailAddress']));
 5   $EmailTo = mikecal...@optusnet.com.au;

You might want to use a configured value instead of the direct string.
If you have to change the email address, or other similar things, it's
easier to change a configuration file than looking through code.

 6   $Subject = RVRA Contact Form - ,$MessageSubject;

Similarly here, the subject of the email could be a configured item.

 7   $Name = Trim(stripslashes($_POST['Name']));
 8   $EmailAddress = Trim(stripslashes($_POST['EmailAddress']));

You've duplicated this from line 4.


 9   $YesNo = Trim(stripslashes($_POST['YesNo']));
10  
11   $MessageSubject = Trim(stripslashes($_POST['MessageSubject']));
12   $Message = Trim(stripslashes($_POST['Message']));
13  
14   // send email
15   if(!isset($_REQUEST['identiPIC_selected'])){exit;}

Instead of just throwing an exit here, and giving the user a blank
page, maybe better to redirect to some landing page. This is done by
issuing a header before any other text is sent:

header(Location: your-error-landing-page.html);

16  
17   $identiPIC[1] = Bird;
18   $identiPIC[2] = Logo;
19   $identiPIC[3] = Flower;
20  
21   if($_REQUEST['identiPIC_selected'] !== $identiPIC){print meta
22   http-equiv=\refresh\ content=\0;URL=error-pic.html\; exit;}

Here, instead of making the browser refresh, do a redirect to a landing page.
See above for header.

23  
24  
25  
26  
27   // prepare email body text
28   $Body = ;
29  
30   $Body .= Name: ;
31   $Body .= $Name;
32   $Body .= \n;
33  
34   $Body .= EmailAddress: ;
35   $Body .= $EmailAddress;
36   $Body .= \n;
37  
38   $Body .= RVRA Member;
39   $Body .= $YesNo;
40   $Body .= \n;
41  
42  
43  
44   $Body .= Message Subject: ;
45   $Body .= $MessageSubject;
46   $Body .= \n;
47  
48   $Body .= Message: ;
49   $Body .= $Message;
50   $Body .= \n;

This is the ideal place for a HEREDOC
(http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc)
to make your code more readable and maintainable:

$Body ENDOFMAIL

Name: $Name
EmailAddress: $EmailAddress
RVRA Member: $YesNo
Message Subject: $MessageSubject

$Message

ENDOFMAIL

51  
52  
53   // send email
54   $success = mail($EmailTo, $Subject, $Body, From: $EmailAddress);

The fourth parameter is actually any additional headers, and should be
constructed in the standard mail format, the header name, the proper
contents and terminated by a CR-LF.

In this case, the From: header needs to correspond to an RFC2922
address, or list of such addresses. If you want to use the angle
brackets, you need to put in a user name before it. Otherwise, simply
omit the brackets. All the additional headers specified in the fourth
parameter need to end with a CR-LF as well, not just a LF, or in this
case, nothing. The way this is set up, the following would be proper
setup:

$AdditionalParms = From: \$Name\ $EmailAddress\r\n;

Then:

$success = mail ($EmailTo, $Subject, $Body, $AdditionalParms);

The escaped quotes around $Name allow for such things as
non-alnum+space characters, i.e., something like this would be
allowed:

From: Samuel L. Jackson, Jr. sammyj...@example.com


However, in this case, the email is NOT actually being sent from
$EmailAddress, it is being sent from your server, so putting in that
address is technically a spoof. While that's not illegal, some mailing
systems will call that a spam message, as the From and Sender do not
match, and From won't be found at the originating mail node.

55  
56   // redirect to success page
57   if ($success){
58   print meta http-equiv=\refresh\
content=\0;URL=thanks.html\;
59   }
60   else{
61   print meta http-equiv=\refresh\
content=\0;URL=error-pic.html\;
62   }
63  

Here again, give the idea of using a header redirect instead of a
browser refresh a go.


64   ?

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



Re: [PHP] Joining fixed text to a SUBJECT variable

2013-03-02 Thread Michael CALDER



G'day ,

Thanks to you both I have muddled through. The actual answer was

$Subject = RVRA Contact Form - .$_POST['MessageSubject'];

I had tried something like that but I used a comma instead of the period.

And, yes, I was getting error messages Undefined variable on line 6. 
etc but was too dumb to work out the fix :-(


The other bloke talking strine on 'tamouse' has given me plenty to work 
on. I see you were also talking about spring chickens and autumn 
turkeys. I reckon I am almost a dodo at 82 :-)


Thanks again to you all.

Cheers

Mike

Michael CALDER
73/81 Willandra Road,
CROMER NSW 2099
02 9981 6327

On 02/03/13 23:03, Maciek Sokolewicz wrote:

On 2-3-2013 12:23, Lester Caine wrote:

Michael CALDER wrote:

$Subject = RVRA Contact Form - ,$MessageSubject;

Can anyone please advise or point me in the right direction for
instructions on how to combine the fixed text with the variable
$MessageSubject.


The quick fix is simply
$Subject = RVRA Contact Form - .$MessageSubject;

but
$Subject = RVRA Contact Form - ,$MessageSubject;
should work, what is the error? ... you don't actually want the ','

$Subject = RVRA Contact Form - $MessageSubject;
Should work as well



No it shouldn't, unless you have register_globals turned On. Which most
hosts don't (and shouldn't) do.

The problem is the simple fact that the variable $MessageSubject is not
defined until 4 lines farther into the script. Changing the variable to
$_POST['MessageSubject'] (and concatenating using the concatenation
operator (the period: '.' )) should fix this for you.

If Michael had E_NOTICE errors turned on, he would see an E_NOTICE:
Undefined variable on line 6. Apparently, he doesn't show E_NOTICEs
either.



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



Re: [PHP] Joining fixed text to a SUBJECT variable

2013-03-02 Thread Jim Lucas

On 3/2/2013 11:56 AM, tamouse mailing lists wrote:

Ah, crikey, syntax error!!



$Body ENDOFMAIL


should be:

$Body = ENDOFMAIL

assignment operator necessary!!



AND...  it should have 3  instead of 2 

http://www.php.net/manual/en/language.types.string.php \
#language.types.string.syntax.heredoc

--
Jim Lucas

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



[PHP] How to enable UTF-8 Subject String ? Only Body is set ok

2011-05-17 Thread Eli Orr (Office)

Hi,

I'm trying to enable a whole Email as UTF-8 - The Body is OK but the 
Subject remains ANSI - Please help


  $headers = From:$from. \r\n .
   Reply-To:$from . \r\n .
   *Content-type:text/html;charset=utf-8;*.\r\n .
   X-Mailer: PHP/.phpversion();



--
Best Regards,

*Eli Orr*
CTO  Founder
*LogoDial Ltd.*
M:+972-54-7379604
O:+972-74-703-2034
F: +972-77-3379604

Plaut 10, Rehovot, Israel
Email: _Eli.Orr@LogoDial.com_
Skype: _eliorr.com_


Re: [PHP] How to enable UTF-8 Subject String ? Only Body is set ok

2011-05-17 Thread Bálint Horváth
Hi,
For the subject you can use sg. like this:

?php

function mail_utf8($to, $subject = '(No subject)', $message = '', $header =
'') {
  $header_ = 'MIME-Version: 1.0' . \r\n . 'Content-type: text/plain;
charset=UTF-8' . \r\n;
  mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ .
$header);
}

?

So first you have to try encode your string to set as subject.
Could be utf8_encode or base64_encode...

http://php.net/manual/en/function.utf8-encode.php
http://php.net/manual/en/function.mail.php

*Valentine*

On Tue, May 17, 2011 at 4:59 PM, Eli Orr (Office) eli@logodial.comwrote:

 Hi,

 I'm trying to enable a whole Email as UTF-8 - The Body is OK but the
 Subject remains ANSI - Please help

  $headers = From:$from. \r\n .
   Reply-To:$from . \r\n .
   *Content-type:text/html;charset=utf-8;*.\r\n .
   X-Mailer: PHP/.phpversion();



 --
 Best Regards,

 *Eli Orr*
 CTO  Founder
 *LogoDial Ltd.*
 M:+972-54-7379604
 O:+972-74-703-2034
 F: +972-77-3379604

 Plaut 10, Rehovot, Israel
 Email: _Eli.Orr@LogoDial.com_
 Skype: _eliorr.com_





Re: [PHP] How to enable UTF-8 Subject String ? Only Body is set ok

2011-05-17 Thread Andre Polykanine
Hello Eli,

  I'm using this code:

private function HeaderEncode ($str) {
// For the compatibility with PHP versions lower than 5.3.0
if (!function_exists ('quoted_printable_encode')) {
function quoted_printable_encode ($str) {
$res=str_replace (+, _, str_replace (%, =, urlencode($str)));
return $res;
}
}
$result='=?utf-8?Q?'.quoted_printable_encode($str).'?=';
return $result;
}

If  you  want  to  send  mail through an SMTP server, consider using a
class written by myself :-):
http://hkc.im/Y
The class is documented and ships with examples.

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

 Original message 
From: Eli Orr (Office) eli@logodial.com
To: php-general@lists.php.net
Date created: , 5:59:26 PM
Subject: [PHP] How to enable UTF-8 Subject String  ? Only Body is set ok


  
Hi,

I'm trying to enable a whole Email as UTF-8 - The Body is OK but the 
Subject remains ANSI - Please help

   $headers = From:$from. \r\n .
Reply-To:$from . \r\n .
*Content-type:text/html;charset=utf-8;*.\r\n .
X-Mailer: PHP/.phpversion();



-- 
Best Regards,

*Eli Orr*
CTO  Founder
*LogoDial Ltd.*
M:+972-54-7379604
O:+972-74-703-2034
F: +972-77-3379604

Plaut 10, Rehovot, Israel
Email: _Eli.Orr@LogoDial.com_
Skype: _eliorr.com_


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



Re: [PHP] preg_match fails to resolve variable as a subject

2010-12-03 Thread Da Rock

On 12/03/10 16:33, Tamara Temple wrote:


On Dec 2, 2010, at 11:33 PM, Da Rock wrote:


On 11/29/10 09:10, Richard Quadling wrote:
On 27 November 2010 04:45, Da 
Rockphp-l...@herveybayaustralia.com.au  wrote:



On 11/27/10 13:51, Tamara Temple wrote:


On Nov 26, 2010, at 7:28 PM, Da Rock wrote:



On 11/27/10 00:57, Richard Quadling wrote:

On 26 November 2010 00:07, Da 
Rockphp-l...@herveybayaustralia.com.au

 wrote:


preg_match(/(\d{1,3})(\.)$/, exec($mixer . ' ' . 
$command),$matches)




Can you ...

var_dump(exec($mixer . ' ' . $command));

I wonder if the output includes a new line which you are not
accounting for in the regex.




Haven't tried yet, but isn't that what $ is for? End of line?




$ matches end of line, but since your last match expression is to 
match
explicitly the character '.' before end of line, and there's a 
newline, it
won't match. Again, use trim() to get rid of the newline character 
at the

end of the string returned by exec(). Looking at the output or


And exec only gives one line- the last line of the output of the 
command.

You have to provide a reference to an array for the entire output.

var_dump gives:
string(41) Mixer vol is currently set to 75:75


It also looks like \d{1,3}\. won't match anything in the output 
string

given by the command.





Thank you for that- that did it. I removed the \.

I am a little confused though; that regex was tested on several 
test sites

and was deemed accurate on them, and one of them actually supplied the
preg_match code. And if I run the command on a shell it actually 
outputs

exactly the right subject for the regex- not to mention it got printed
inadvertently (using system() ) via the php exactly the same. So I 
don't

think I missed it somehow.

What I have constantly seen come up (shell and php/html) is: Mixer 
vol is

currently set to 75:75. (including the period)

Don't get me wrong- you guys make sense; my system doesn't. I need 
to get to
the bottom of this so I can ensure my code will port well. I don't 
want to

get it all working and find it breaks when I run it on another system,
albeit same OS (FreeBSD). Could be updates or variations of releases.

Just to check again, I ran the command on the shell again and sure 
enough
the period is no longer there- but I can't for the life of me 
figure out
when that changed as this code has never worked (and yes, I added 
in the \.
to match the end of line because it originally wasn't working). 
Another

great mystery? Weird... :)

Thanks again guys.

The regex is a valid regex. It's just useless for the data you are 
providing it.


I'm wondering what is missing from your output? The var_dump says the
text is a 41 character string, but the data you provided only has 36
characters in it.

What elements of the string do you want to capture?

/:(\d++)/ would catch the number after the :




Apologies for the delay.

That works, except it will catch all instances. I need it to catch 
the last number specifically and not the period. The output will also 
output a previous and new reading- I need the new reading. And I also 
need to allow for the possibility of a period. So here's what I 
have:


/(\d++)[^.]?$

Which works as long as there is no period at the end. I just can't 
seem to get my head around it. I need a guru... :)


Did you miss the : at the beginning of RIchard's suggested regex? 
/:(\d++)/ would gather up all digits following a :. If the output 
from the mixer command is always something like dd:dd (irrespective of 
trailing period), the regex above would always return the second set 
of digits.



Sorry I probably didn't make it clear. The output can be the above or 
Setting the mixer vol from 70:70 to 75:75. Hence the $ for end of 
line. So I obviously need the last number (75) and nothing else.


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



Re: [PHP] preg_match fails to resolve variable as a subject

2010-12-03 Thread Richard Quadling
On 3 December 2010 11:13, Da Rock php-l...@herveybayaustralia.com.au wrote:
 On 12/03/10 16:33, Tamara Temple wrote:

 On Dec 2, 2010, at 11:33 PM, Da Rock wrote:

 On 11/29/10 09:10, Richard Quadling wrote:

 On 27 November 2010 04:45, Da Rockphp-l...@herveybayaustralia.com.au
  wrote:

 On 11/27/10 13:51, Tamara Temple wrote:

 On Nov 26, 2010, at 7:28 PM, Da Rock wrote:


 On 11/27/10 00:57, Richard Quadling wrote:

 On 26 November 2010 00:07, Da
 Rockphp-l...@herveybayaustralia.com.au
  wrote:


 preg_match(/(\d{1,3})(\.)$/, exec($mixer . ' ' .
 $command),$matches)


 Can you ...

 var_dump(exec($mixer . ' ' . $command));

 I wonder if the output includes a new line which you are not
 accounting for in the regex.



 Haven't tried yet, but isn't that what $ is for? End of line?



 $ matches end of line, but since your last match expression is to
 match
 explicitly the character '.' before end of line, and there's a
 newline, it
 won't match. Again, use trim() to get rid of the newline character at
 the
 end of the string returned by exec(). Looking at the output or


 And exec only gives one line- the last line of the output of the
 command.
 You have to provide a reference to an array for the entire output.

 var_dump gives:
 string(41) Mixer vol is currently set to 75:75


 It also looks like \d{1,3}\. won't match anything in the output string
 given by the command.




 Thank you for that- that did it. I removed the \.

 I am a little confused though; that regex was tested on several test
 sites
 and was deemed accurate on them, and one of them actually supplied the
 preg_match code. And if I run the command on a shell it actually
 outputs
 exactly the right subject for the regex- not to mention it got printed
 inadvertently (using system() ) via the php exactly the same. So I
 don't
 think I missed it somehow.

 What I have constantly seen come up (shell and php/html) is: Mixer vol
 is
 currently set to 75:75. (including the period)

 Don't get me wrong- you guys make sense; my system doesn't. I need to
 get to
 the bottom of this so I can ensure my code will port well. I don't want
 to
 get it all working and find it breaks when I run it on another system,
 albeit same OS (FreeBSD). Could be updates or variations of releases.

 Just to check again, I ran the command on the shell again and sure
 enough
 the period is no longer there- but I can't for the life of me figure
 out
 when that changed as this code has never worked (and yes, I added in
 the \.
 to match the end of line because it originally wasn't working). Another
 great mystery? Weird... :)

 Thanks again guys.

 The regex is a valid regex. It's just useless for the data you are
 providing it.

 I'm wondering what is missing from your output? The var_dump says the
 text is a 41 character string, but the data you provided only has 36
 characters in it.

 What elements of the string do you want to capture?

 /:(\d++)/ would catch the number after the :



 Apologies for the delay.

 That works, except it will catch all instances. I need it to catch the
 last number specifically and not the period. The output will also output a
 previous and new reading- I need the new reading. And I also need to allow
 for the possibility of a period. So here's what I have:

 /(\d++)[^.]?$

 Which works as long as there is no period at the end. I just can't seem
 to get my head around it. I need a guru... :)

 Did you miss the : at the beginning of RIchard's suggested regex?
 /:(\d++)/ would gather up all digits following a :. If the output from the
 mixer command is always something like dd:dd (irrespective of trailing
 period), the regex above would always return the second set of digits.


 Sorry I probably didn't make it clear. The output can be the above or
 Setting the mixer vol from 70:70 to 75:75. Hence the $ for end of line. So
 I obviously need the last number (75) and nothing else.

(\d++)[^\d]*?$


-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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



Re: [PHP] preg_match fails to resolve variable as a subject

2010-12-03 Thread Richard Quadling
On 3 December 2010 11:13, Da Rock php-l...@herveybayaustralia.com.au wrote:
 On 12/03/10 16:33, Tamara Temple wrote:

 On Dec 2, 2010, at 11:33 PM, Da Rock wrote:

 On 11/29/10 09:10, Richard Quadling wrote:

 On 27 November 2010 04:45, Da Rockphp-l...@herveybayaustralia.com.au
  wrote:

 On 11/27/10 13:51, Tamara Temple wrote:

 On Nov 26, 2010, at 7:28 PM, Da Rock wrote:


 On 11/27/10 00:57, Richard Quadling wrote:

 On 26 November 2010 00:07, Da
 Rockphp-l...@herveybayaustralia.com.au
  wrote:


 preg_match(/(\d{1,3})(\.)$/, exec($mixer . ' ' .
 $command),$matches)


 Can you ...

 var_dump(exec($mixer . ' ' . $command));

 I wonder if the output includes a new line which you are not
 accounting for in the regex.



 Haven't tried yet, but isn't that what $ is for? End of line?



 $ matches end of line, but since your last match expression is to
 match
 explicitly the character '.' before end of line, and there's a
 newline, it
 won't match. Again, use trim() to get rid of the newline character at
 the
 end of the string returned by exec(). Looking at the output or


 And exec only gives one line- the last line of the output of the
 command.
 You have to provide a reference to an array for the entire output.

 var_dump gives:
 string(41) Mixer vol is currently set to 75:75


 It also looks like \d{1,3}\. won't match anything in the output string
 given by the command.




 Thank you for that- that did it. I removed the \.

 I am a little confused though; that regex was tested on several test
 sites
 and was deemed accurate on them, and one of them actually supplied the
 preg_match code. And if I run the command on a shell it actually
 outputs
 exactly the right subject for the regex- not to mention it got printed
 inadvertently (using system() ) via the php exactly the same. So I
 don't
 think I missed it somehow.

 What I have constantly seen come up (shell and php/html) is: Mixer vol
 is
 currently set to 75:75. (including the period)

 Don't get me wrong- you guys make sense; my system doesn't. I need to
 get to
 the bottom of this so I can ensure my code will port well. I don't want
 to
 get it all working and find it breaks when I run it on another system,
 albeit same OS (FreeBSD). Could be updates or variations of releases.

 Just to check again, I ran the command on the shell again and sure
 enough
 the period is no longer there- but I can't for the life of me figure
 out
 when that changed as this code has never worked (and yes, I added in
 the \.
 to match the end of line because it originally wasn't working). Another
 great mystery? Weird... :)

 Thanks again guys.

 The regex is a valid regex. It's just useless for the data you are
 providing it.

 I'm wondering what is missing from your output? The var_dump says the
 text is a 41 character string, but the data you provided only has 36
 characters in it.

 What elements of the string do you want to capture?

 /:(\d++)/ would catch the number after the :



 Apologies for the delay.

 That works, except it will catch all instances. I need it to catch the
 last number specifically and not the period. The output will also output a
 previous and new reading- I need the new reading. And I also need to allow
 for the possibility of a period. So here's what I have:

 /(\d++)[^.]?$

 Which works as long as there is no period at the end. I just can't seem
 to get my head around it. I need a guru... :)

 Did you miss the : at the beginning of RIchard's suggested regex?
 /:(\d++)/ would gather up all digits following a :. If the output from the
 mixer command is always something like dd:dd (irrespective of trailing
 period), the regex above would always return the second set of digits.


 Sorry I probably didn't make it clear. The output can be the above or
 Setting the mixer vol from 70:70 to 75:75. Hence the $ for end of line. So
 I obviously need the last number (75) and nothing else.

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



Get the last number.

(\d++)[^\d]*?$

Options: case insensitive; ^ and $ match at line breaks

Match the regular expression below and capture its match into
backreference number 1 «(\d++)»
   Match a single digit 0..9 «\d++»
  Between one and unlimited times, as many times as possible,
without giving back (possessive) «++»
Match a single character that is not a digit 0..9 «[^\d]*?»
   Between zero and unlimited times, as few times as possible,
expanding as needed (lazy) «*?»
Assert position at the end of a line (at the end of the string or
before a line break character) «$»


Created with RegexBuddy


if (preg_match('/(\d++)[^\d]*?$/sim', $subject, $matches)) {
$result = $matches[0];
} else {
$result = ;
}


-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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



Re: [PHP] preg_match fails to resolve variable as a subject

2010-12-02 Thread Da Rock

On 11/29/10 09:10, Richard Quadling wrote:

On 27 November 2010 04:45, Da Rockphp-l...@herveybayaustralia.com.au  wrote:
   

On 11/27/10 13:51, Tamara Temple wrote:
 

On Nov 26, 2010, at 7:28 PM, Da Rock wrote:

   

On 11/27/10 00:57, Richard Quadling wrote:
 

On 26 November 2010 00:07, Da Rockphp-l...@herveybayaustralia.com.au
  wrote:

   

preg_match(/(\d{1,3})(\.)$/, exec($mixer . ' ' . $command),$matches)

 

Can you ...

var_dump(exec($mixer . ' ' . $command));

I wonder if the output includes a new line which you are not
accounting for in the regex.


   

Haven't tried yet, but isn't that what $ is for? End of line?

 


$ matches end of line, but since your last match expression is to match
explicitly the character '.' before end of line, and there's a newline, it
won't match. Again, use trim() to get rid of the newline character at the
end of the string returned by exec(). Looking at the output or

   

And exec only gives one line- the last line of the output of the command.
You have to provide a reference to an array for the entire output.

var_dump gives:
string(41) Mixer vol is currently set to 75:75

 

It also looks like \d{1,3}\. won't match anything in the output string
given by the command.



   

Thank you for that- that did it. I removed the \.

I am a little confused though; that regex was tested on several test sites
and was deemed accurate on them, and one of them actually supplied the
preg_match code. And if I run the command on a shell it actually outputs
exactly the right subject for the regex- not to mention it got printed
inadvertently (using system() ) via the php exactly the same. So I don't
think I missed it somehow.

What I have constantly seen come up (shell and php/html) is: Mixer vol is
currently set to 75:75. (including the period)

Don't get me wrong- you guys make sense; my system doesn't. I need to get to
the bottom of this so I can ensure my code will port well. I don't want to
get it all working and find it breaks when I run it on another system,
albeit same OS (FreeBSD). Could be updates or variations of releases.

Just to check again, I ran the command on the shell again and sure enough
the period is no longer there- but I can't for the life of me figure out
when that changed as this code has never worked (and yes, I added in the \.
to match the end of line because it originally wasn't working). Another
great mystery? Weird... :)

Thanks again guys.
 

The regex is a valid regex. It's just useless for the data you are providing it.

I'm wondering what is missing from your output? The var_dump says the
text is a 41 character string, but the data you provided only has 36
characters in it.

What elements of the string do you want to capture?

/:(\d++)/ would catch the number after the :


   

Apologies for the delay.

That works, except it will catch all instances. I need it to catch the 
last number specifically and not the period. The output will also output 
a previous and new reading- I need the new reading. And I also need to 
allow for the possibility of a period. So here's what I have:


/(\d++)[^.]?$

Which works as long as there is no period at the end. I just can't seem 
to get my head around it. I need a guru... :)


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



Re: [PHP] preg_match fails to resolve variable as a subject

2010-12-02 Thread Tamara Temple


On Dec 2, 2010, at 11:33 PM, Da Rock wrote:


On 11/29/10 09:10, Richard Quadling wrote:
On 27 November 2010 04:45, Da Rockphp- 
l...@herveybayaustralia.com.au  wrote:



On 11/27/10 13:51, Tamara Temple wrote:


On Nov 26, 2010, at 7:28 PM, Da Rock wrote:



On 11/27/10 00:57, Richard Quadling wrote:

On 26 November 2010 00:07, Da Rockphp-l...@herveybayaustralia.com.au 


 wrote:


preg_match(/(\d{1,3})(\.)$/, exec($mixer . ' ' . $command), 
$matches)




Can you ...

var_dump(exec($mixer . ' ' . $command));

I wonder if the output includes a new line which you are not
accounting for in the regex.




Haven't tried yet, but isn't that what $ is for? End of line?




$ matches end of line, but since your last match expression is to  
match
explicitly the character '.' before end of line, and there's a  
newline, it
won't match. Again, use trim() to get rid of the newline  
character at the

end of the string returned by exec(). Looking at the output or


And exec only gives one line- the last line of the output of the  
command.

You have to provide a reference to an array for the entire output.

var_dump gives:
string(41) Mixer vol is currently set to 75:75


It also looks like \d{1,3}\. won't match anything in the output  
string

given by the command.





Thank you for that- that did it. I removed the \.

I am a little confused though; that regex was tested on several  
test sites
and was deemed accurate on them, and one of them actually supplied  
the
preg_match code. And if I run the command on a shell it actually  
outputs
exactly the right subject for the regex- not to mention it got  
printed
inadvertently (using system() ) via the php exactly the same. So I  
don't

think I missed it somehow.

What I have constantly seen come up (shell and php/html) is: Mixer  
vol is

currently set to 75:75. (including the period)

Don't get me wrong- you guys make sense; my system doesn't. I need  
to get to
the bottom of this so I can ensure my code will port well. I don't  
want to
get it all working and find it breaks when I run it on another  
system,
albeit same OS (FreeBSD). Could be updates or variations of  
releases.


Just to check again, I ran the command on the shell again and sure  
enough
the period is no longer there- but I can't for the life of me  
figure out
when that changed as this code has never worked (and yes, I added  
in the \.
to match the end of line because it originally wasn't working).  
Another

great mystery? Weird... :)

Thanks again guys.

The regex is a valid regex. It's just useless for the data you are  
providing it.


I'm wondering what is missing from your output? The var_dump says the
text is a 41 character string, but the data you provided only has 36
characters in it.

What elements of the string do you want to capture?

/:(\d++)/ would catch the number after the :




Apologies for the delay.

That works, except it will catch all instances. I need it to catch  
the last number specifically and not the period. The output will  
also output a previous and new reading- I need the new reading. And  
I also need to allow for the possibility of a period. So here's  
what I have:


/(\d++)[^.]?$

Which works as long as there is no period at the end. I just can't  
seem to get my head around it. I need a guru... :)


Did you miss the : at the beginning of RIchard's suggested regex? /: 
(\d++)/ would gather up all digits following a :. If the output from  
the mixer command is always something like dd:dd (irrespective of  
trailing period), the regex above would always return the second set  
of digits.



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



Re: [PHP] preg_match fails to resolve variable as a subject

2010-11-28 Thread Richard Quadling
On 27 November 2010 04:45, Da Rock php-l...@herveybayaustralia.com.au wrote:
 On 11/27/10 13:51, Tamara Temple wrote:

 On Nov 26, 2010, at 7:28 PM, Da Rock wrote:

 On 11/27/10 00:57, Richard Quadling wrote:

 On 26 November 2010 00:07, Da Rockphp-l...@herveybayaustralia.com.au
  wrote:

 preg_match(/(\d{1,3})(\.)$/, exec($mixer . ' ' . $command),$matches)

 Can you ...

 var_dump(exec($mixer . ' ' . $command));

 I wonder if the output includes a new line which you are not
 accounting for in the regex.


 Haven't tried yet, but isn't that what $ is for? End of line?



 $ matches end of line, but since your last match expression is to match
 explicitly the character '.' before end of line, and there's a newline, it
 won't match. Again, use trim() to get rid of the newline character at the
 end of the string returned by exec(). Looking at the output or

 And exec only gives one line- the last line of the output of the command.
 You have to provide a reference to an array for the entire output.

 var_dump gives:
 string(41) Mixer vol is currently set to 75:75


 It also looks like \d{1,3}\. won't match anything in the output string
 given by the command.



 Thank you for that- that did it. I removed the \.

 I am a little confused though; that regex was tested on several test sites
 and was deemed accurate on them, and one of them actually supplied the
 preg_match code. And if I run the command on a shell it actually outputs
 exactly the right subject for the regex- not to mention it got printed
 inadvertently (using system() ) via the php exactly the same. So I don't
 think I missed it somehow.

 What I have constantly seen come up (shell and php/html) is: Mixer vol is
 currently set to 75:75. (including the period)

 Don't get me wrong- you guys make sense; my system doesn't. I need to get to
 the bottom of this so I can ensure my code will port well. I don't want to
 get it all working and find it breaks when I run it on another system,
 albeit same OS (FreeBSD). Could be updates or variations of releases.

 Just to check again, I ran the command on the shell again and sure enough
 the period is no longer there- but I can't for the life of me figure out
 when that changed as this code has never worked (and yes, I added in the \.
 to match the end of line because it originally wasn't working). Another
 great mystery? Weird... :)

 Thanks again guys.

The regex is a valid regex. It's just useless for the data you are providing it.

I'm wondering what is missing from your output? The var_dump says the
text is a 41 character string, but the data you provided only has 36
characters in it.

What elements of the string do you want to capture?

/:(\d++)/ would catch the number after the :


-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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



Re: [PHP] preg_match fails to resolve variable as a subject

2010-11-26 Thread Richard Quadling
On 26 November 2010 00:07, Da Rock php-l...@herveybayaustralia.com.au wrote:
 preg_match(/(\d{1,3})(\.)$/, exec($mixer . ' ' . $command), $matches)

Can you ...

var_dump(exec($mixer . ' ' . $command));

I wonder if the output includes a new line which you are not
accounting for in the regex.

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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



Re: [PHP] preg_match fails to resolve variable as a subject

2010-11-26 Thread Tamara Temple


On Nov 25, 2010, at 6:07 PM, Da Rock wrote:
preg_match(/(\d{1,3})(\.)$/, exec($mixer . ' ' . $command),  
$matches)


it looks like you're failing to account for the newline that comes  
back in a command execution. Add trim() around the exec() call and try  
again.


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



Re: [PHP] preg_match fails to resolve variable as a subject

2010-11-26 Thread Da Rock

On 11/27/10 00:57, Richard Quadling wrote:

On 26 November 2010 00:07, Da Rockphp-l...@herveybayaustralia.com.au  wrote:
   

preg_match(/(\d{1,3})(\.)$/, exec($mixer . ' ' . $command),$matches)
 

Can you ...

var_dump(exec($mixer . ' ' . $command));

I wonder if the output includes a new line which you are not
accounting for in the regex.

   

Haven't tried yet, but isn't that what $ is for? End of line?

And exec only gives one line- the last line of the output of the 
command. You have to provide a reference to an array for the entire output.


var_dump gives:
string(41) Mixer vol is currently set to 75:75

Any thoughts?

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



Re: [PHP] preg_match fails to resolve variable as a subject

2010-11-26 Thread Tamara Temple


On Nov 26, 2010, at 7:28 PM, Da Rock wrote:


On 11/27/10 00:57, Richard Quadling wrote:
On 26 November 2010 00:07, Da Rockphp- 
l...@herveybayaustralia.com.au  wrote:


preg_match(/(\d{1,3})(\.)$/, exec($mixer . ' ' . $command), 
$matches)



Can you ...

var_dump(exec($mixer . ' ' . $command));

I wonder if the output includes a new line which you are not
accounting for in the regex.



Haven't tried yet, but isn't that what $ is for? End of line?




$ matches end of line, but since your last match expression is to  
match explicitly the character '.' before end of line, and there's a  
newline, it won't match. Again, use trim() to get rid of the newline  
character at the end of the string returned by exec(). Looking at the  
output or


And exec only gives one line- the last line of the output of the  
command. You have to provide a reference to an array for the entire  
output.


var_dump gives:
string(41) Mixer vol is currently set to 75:75



It also looks like \d{1,3}\. won't match anything in the output string  
given by the command.




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



Re: [PHP] preg_match fails to resolve variable as a subject

2010-11-26 Thread Da Rock

On 11/27/10 13:51, Tamara Temple wrote:


On Nov 26, 2010, at 7:28 PM, Da Rock wrote:


On 11/27/10 00:57, Richard Quadling wrote:
On 26 November 2010 00:07, Da 
Rockphp-l...@herveybayaustralia.com.au  wrote:


preg_match(/(\d{1,3})(\.)$/, exec($mixer . ' ' . 
$command),$matches)



Can you ...

var_dump(exec($mixer . ' ' . $command));

I wonder if the output includes a new line which you are not
accounting for in the regex.



Haven't tried yet, but isn't that what $ is for? End of line?




$ matches end of line, but since your last match expression is to 
match explicitly the character '.' before end of line, and there's a 
newline, it won't match. Again, use trim() to get rid of the newline 
character at the end of the string returned by exec(). Looking at the 
output or


And exec only gives one line- the last line of the output of the 
command. You have to provide a reference to an array for the entire 
output.


var_dump gives:
string(41) Mixer vol is currently set to 75:75



It also looks like \d{1,3}\. won't match anything in the output string 
given by the command.





Thank you for that- that did it. I removed the \.

I am a little confused though; that regex was tested on several test 
sites and was deemed accurate on them, and one of them actually supplied 
the preg_match code. And if I run the command on a shell it actually 
outputs exactly the right subject for the regex- not to mention it got 
printed inadvertently (using system() ) via the php exactly the same. So 
I don't think I missed it somehow.


What I have constantly seen come up (shell and php/html) is: Mixer vol 
is currently set to 75:75. (including the period)


Don't get me wrong- you guys make sense; my system doesn't. I need to 
get to the bottom of this so I can ensure my code will port well. I 
don't want to get it all working and find it breaks when I run it on 
another system, albeit same OS (FreeBSD). Could be updates or variations 
of releases.


Just to check again, I ran the command on the shell again and sure 
enough the period is no longer there- but I can't for the life of me 
figure out when that changed as this code has never worked (and yes, I 
added in the \. to match the end of line because it originally wasn't 
working). Another great mystery? Weird... :)


Thanks again guys.

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



[PHP] preg_match fails to resolve variable as a subject

2010-11-25 Thread Da Rock
I have been scratching on this for some time now, and throughout I've 
been trying subscribe to this list.


Pardon if this is a stupid question, but I googled for days on this and 
still couldn't get it to work.


Is there a known issue with php's preg_match? I can get it to work on a 
string directly, but if I use a variable it fails with no match. 
pcretest works, and the variable prints correctly. I also used a number 
of online regex testers and worked, one gave me the basis of the code.


I can only post a piece of the code as I don't wish to offend, give you 
some clue as to how far strung I am.


preg_match(/(\d{1,3})(\.)$/, exec($mixer . ' ' . $command), $matches)

I've separated the command so it outputs to a variable, and placed the 
variable as the subject with the same result. It also fails with 
system() as well.


A little light on the subject (pardon the pun :) ) would be very 
helpful. I know its very simple code, but its just a base to something else.



Cheers

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



[PHP] php imap_search fails for subject strings which have apostrophe

2010-10-22 Thread nitesh nandy
I've to search for messages from Gmail Inbox over IMAP using search by
SUBJECT . The php-imap imap_search()  works fine when the subject is pure
alphanumeric. If the subject string has an apostrophe or a dash then the
search fails.

imap_seach($mbox, 'ALL SUBJECT search string');

imap_seach($mbox, 'ALL SUBJECT this is a string without quote'); //Works
imap_seach($mbox, 'ALL SUBJECT this is a string with quote's and da-sh');
//Doesn't Work

I've tried using the Zend Framework IMAP library too, it fails too. I've
been talking to people over some forums, they say subject search via imap on
gmail works for them.

What can be the problem here? I've tried escaping them but it did not help.

Any help is appreciated.

-- 
Regards,

Nitesh Nandy


Re: [PHP] php imap_search fails for subject strings which have apostrophe

2010-10-22 Thread Govinda

I've to search for messages from Gmail Inbox over IMAP using search by
SUBJECT . The php-imap imap_search()  works fine when the subject is  
pure
alphanumeric. If the subject string has an apostrophe or a dash then  
the

search fails.

imap_seach($mbox, 'ALL SUBJECT search string');

imap_seach($mbox, 'ALL SUBJECT this is a string without quote'); // 
Works
imap_seach($mbox, 'ALL SUBJECT this is a string with quote's and da- 
sh');

//Doesn't Work

I've tried using the Zend Framework IMAP library too, it fails too.  
I've
been talking to people over some forums, they say subject search via  
imap on

gmail works for them.

What can be the problem here? I've tried escaping them but it did  
not help.


Any help is appreciated.

--
Regards,

Nitesh Nandy



Hi Nitesh,

I am a newbie in PHP, but I would guess the way you are attempting to  
escape the non-alphanumeric chars is faulty.

Can you please show the code you are using to do the escaping?


Govinda


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



RE: [PHP] Microsoft outlook takes out all stressed letters on subject.

2010-03-05 Thread Bob McConnell
From: João Cândido de Souza Neto

 When I send an e-mail from PHP (not using the mail function) everithing 
 works fine, but when such e-mail´s got in Microsoft Outlook it takes out all 
 stressed letters in mail´s subject what doesn´t happen in Outlook Express?
 
 My question is?
 
 Is there any header that can avoid it?

What code page is Lookout using? Does that page have those letters in it? Does 
it use the same character encoding that the source did?

Bob McConnell

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



Re: [PHP] Microsoft outlook takes out all stressed letters on subject.

2010-03-05 Thread Jo�o C�ndido de Souza Neto
Yes, it does.

Thanks.
João Cândido

Bob McConnell r...@cbord.com escreveu na mensagem 
news:ff8482a96323694490c194babeac24a0058c5...@email.cbord.com...
From: João Cândido de Souza Neto

 When I send an e-mail from PHP (not using the mail function) everithing
 works fine, but when such e-mail´s got in Microsoft Outlook it takes out 
 all
 stressed letters in mail´s subject what doesn´t happen in Outlook Express?

 My question is?

 Is there any header that can avoid it?

What code page is Lookout using? Does that page have those letters in it? 
Does it use the same character encoding that the source did?

Bob McConnell 



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



[PHP] Off Subject / Feedback Needed

2009-07-06 Thread Karl James
 
Team,

http://www.theufl.com/css/corners.css

http://www.theufl.com/indexb.htm

I am trying to get the rounded corners to show in the first row in the HTML
table.
Can someone review the code for me?

I think it has something to do with the images, but I corrected the path and
uploaded images.
 
Karl James
 mailto:karlja...@tampabay.rr.com karlja...@tampabay.rr.com
My Website:  http://www.theufl.com www.theufl.com
 


Re: [PHP] Off Subject / Feedback Needed

2009-07-06 Thread Daniel Brown
On Mon, Jul 6, 2009 at 03:03, Karl Jameskarlja...@tampabay.rr.com wrote:
 Team,

 http://www.theufl.com/css/corners.css

 http://www.theufl.com/indexb.htm

 I am trying to get the rounded corners to show in the first row in the HTML
 table.
 Can someone review the code for me?

No, Karl, and please don't ask such questions again on this list.

 I think it has something to do with the images, but I corrected the path and
 uploaded images.

Ask on a CSS or design list instead, please.

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig

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



Re: [PHP] Re: Mail subject encoding breaks

2009-05-12 Thread Thodoris



Hello,

on 05/11/2009 12:25 PM Thodoris said the following:
  

This script seems to work ok in a freebsd development server I have but
a linux production machine breaks the subject's encoding for some
unexpected reason. The subject has a mix of English and Greek characters
that FreeBSD seems to handle like a charm.

Both machines have the same php version (5.2.9) and the scripts encoding
is UTF-8. Iconv and mbstring are configured the same way in php.ini
(although I am not aware whether phpmailer uses iconv or mbstring).

Has anyone had a similar experience? Is it possible that sendmail (which
is the underlying tool) breaks the mail encoding?



I am not sure what you mean by breaking the mail encoding. I use the
MIME message class and it works perfectly with any encoding, even
multibyte character sets. Take a look at the examples test_email_message
and test_multibyte_message.php .

http://www.phpclasses.org/mimemessage


  


I am not sure what is happening exactly but I think that for some reason 
the subject of the e-mail includes more than one encoding while using 
linux. The English part is encoded in ISO-8859-1 and the Greek part into 
something that I can't detect (probably because thunderbird doesn't 
support all encodings).  The body of the message is UTF-8 as expected.


I didn't try the suggested solution since I have solved this, but the 
original question was about phpmailer. I will give it a try however 
because it seems like a better solution and more robust than mail_utf8.


--
Thodoris



Re: [PHP] Mail subject encoding breaks

2009-05-12 Thread Tom Worster
On 5/11/09 11:58 AM, Thodoris t...@kinetix.gr wrote:

 
 On 11 May 2009 at 18:25, Thodoris wrote:
 
   
 Hi gang,
 I am using phpmailer to send some mail notifications in an intranet
 I've made. This is a sample code:
 
 
   
 $e-Subject = This is δφκξγκδφη garbidge κηδφκξγσ;
 
 
 Hi,
 
 I have had success with this in the past:
 
 $subject  = This is δφκξγκδφη garbidge κηδφκξγσ; 
 $e-Subject = mb_encode_mimeheader($subject, UTF-8, Q) ;
 
 Regards
 
 Ian
   
 
 Thanks Ian this works in most cases but there are times that still
 breaks the subject. I have experimented with:
 
 mb_encode_mimeheader($subject, UTF-8, B)
 
 as well but nothing seems to be working without problems.

is it possible that in the problem cases the subject string isn't valid
utf-8?

you can check with mb_check_encoding($subject)

you can sanitize bad utf-8 with iconv(UTF-8,UTF-8//IGNORE,$subject)
though you probably won't get the string you want with that. when you don't
have other options, this will at least clean up bad encoding.



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



[PHP] Mail subject encoding breaks

2009-05-11 Thread Thodoris

Hi gang,
   I am using phpmailer to send some mail notifications in an intranet 
I've made. This is a sample code:


?php
// Include PHP Mailer
require 'class/class.phpmailer.php';

// Instantiate the mailer
$e = new phpmailer();

$e-From = aco...@host.gr;
$e-FromName = Test;
$e-Mailer = mail;
$e-Subject = This is δφκξγκδφη garbidge κηδφκξγσ;
$e-CharSet = UTF-8;
$e-Body = H εργασία id: 122 έκλεισε με σχόλια.;


$e-AddReplyTo(supp...@kinetix.gr);
$e-AddAddress(t...@kinetix.gr);
// $e-to = array(t...@kinetix.gr);


if ($e-Send()) {
   print Mail has been sent successfully.;
} else {
   print Failed to send mail.br.$e-ErrorInfo;
}
?

Where mailer class is:

?php
require 'class.phpmailer.php';
class mailer extends phpmailer {
   var $From = aco...@host.gr;
   var $FromName = Test;
   var $Mailer   = mail;
   var $WordWrap = 200;
   var $CharSet = UTF-8;
   var $Encoding = quoted-printable;
   // var $Encoding = base64;
}
?

This script seems to work ok in a freebsd development server I have but 
a linux production machine breaks the subject's encoding for some 
unexpected reason. The subject has a mix of English and Greek characters 
that FreeBSD seems to handle like a charm.


Both machines have the same php version (5.2.9) and the scripts encoding 
is UTF-8. Iconv and mbstring are configured the same way in php.ini 
(although I am not aware whether phpmailer uses iconv or mbstring).


Has anyone had a similar experience? Is it possible that sendmail (which 
is the underlying tool) breaks the mail encoding?


Please any help would be appreciated because this is really driving me 
crazy.


--
Thodoris


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



Re: [PHP] Mail subject encoding breaks

2009-05-11 Thread Ian
On 11 May 2009 at 18:25, Thodoris wrote:

 Hi gang,
 I am using phpmailer to send some mail notifications in an intranet
 I've made. This is a sample code:

 $e-Subject = This is δφκξγκδφη garbidge κηδφκξγσ;

Hi,

I have had success with this in the past:

$subject= This is δφκξγκδφη garbidge κηδφκξγσ;
$e-Subject = mb_encode_mimeheader($subject, UTF-8, Q) ;

Regards

Ian
--



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



Re: [PHP] Mail subject encoding breaks

2009-05-11 Thread Thodoris



On 11 May 2009 at 18:25, Thodoris wrote:

  

Hi gang,
I am using phpmailer to send some mail notifications in an intranet 
I've made. This is a sample code:



  

$e-Subject = This is δφκξγκδφη garbidge κηδφκξγσ;



Hi,

I have had success with this in the past:

$subject= This is δφκξγκδφη garbidge κηδφκξγσ;  
$e-Subject  = mb_encode_mimeheader($subject, UTF-8, Q) ;

Regards

Ian
  


Thanks Ian this works in most cases but there are times that still 
breaks the subject. I have experimented with:


mb_encode_mimeheader($subject, UTF-8, B)

as well but nothing seems to be working without problems.

I think that this solved my problems since I noticed that it works fine 
until this moment.


function mail_utf8($to, $subject = '(No subject)', $message = '', $header = '') 
{
 $header_ = 'MIME-Version: 1.0' . \r\n . 'Content-type: text/plain; charset=UTF-8' . 
\r\n;
 mail($to, =?UTF-8?B?.base64_encode($subject).'?=', $message, $header_ . 
$header);
}


--
Thodoris



[PHP] Re: Mail subject encoding breaks

2009-05-11 Thread Manuel Lemos
Hello,

on 05/11/2009 12:25 PM Thodoris said the following:
 This script seems to work ok in a freebsd development server I have but
 a linux production machine breaks the subject's encoding for some
 unexpected reason. The subject has a mix of English and Greek characters
 that FreeBSD seems to handle like a charm.
 
 Both machines have the same php version (5.2.9) and the scripts encoding
 is UTF-8. Iconv and mbstring are configured the same way in php.ini
 (although I am not aware whether phpmailer uses iconv or mbstring).
 
 Has anyone had a similar experience? Is it possible that sendmail (which
 is the underlying tool) breaks the mail encoding?

I am not sure what you mean by breaking the mail encoding. I use the
MIME message class and it works perfectly with any encoding, even
multibyte character sets. Take a look at the examples test_email_message
and test_multibyte_message.php .

http://www.phpclasses.org/mimemessage


-- 

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/

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



Re: [PHP] How can I echo a javascript var in an email subject line? Possible? (Yes!)RESOLVED

2009-04-10 Thread Terion Miller
Thanks
Terion

Happy Freecycling
Free the List !!
www.freecycle.org
Over Moderation of Freecycle List Prevents Post Timeliness.
Report Moderator Abuse Here:
http://www.freecycle.org/faq/faq/contact-info
Or Email Your Complaint to:
f...@freecycle.org or i...@freecycle.org

Twitter?
http://twitter.com/terionmiller

Facebook:
a href=http://www.facebook.com/people/Terion-Miller/1542024891;
title=Terion Miller's Facebook profile target=_TOPimg src=
http://badge.facebook.com/badge/1542024891.237.919247960.png; border=0
alt=Terion Miller's Facebook profile/a


On Wed, Apr 8, 2009 at 7:43 PM, Raymond Irving xwis...@yahoo.com wrote:


 For me its very easy to pass php values to the client:

 echo _var($value,'name');

 But the best part is taking control of what your client sees from the
 server-side:

 C('#info')-show(); // now you see it
 ...
 C('#info')-hide(); // now you don't!

 Take control and start building powerful web apps with Raxan PDI -
 http://raxanpdi.com

 __
 Raymond Irving
 Create Rich Ajax/PHP Web Apps today!
 Raxan PDI - http://raxanpdi


 --- On Wed, 4/8/09, Michael A. Peters mpet...@mac.com wrote:

  From: Michael A. Peters mpet...@mac.com
  Subject: Re: [PHP] How can I echo a javascript var in an email subject
 line? Possible?
  To: Terion Miller webdev.ter...@gmail.com
  Cc: PHP General php-general@lists.php.net
  Date: Wednesday, April 8, 2009, 2:34 PM
  Terion Miller wrote:
  
  
  
  
   On Wed, Apr 8, 2009 at 12:50 PM, Michael A. Peters
  mpet...@mac.com
  mailto:mpet...@mac.com
  wrote:
  
   Terion Miller wrote:
  
  
  
  javascript is
  client side.
  php is server
  side.
  To use
  something client side in a server side script, the web
   page
  has to send
  it to the server from the client.
  
  The best way
  to do what you want to do is probably to do the work
  count server
  side, but if you really want to use what javascript
  produced you
  can create a hidden input with a specified id,
   and use
  dhtml via
  javascript to modify the input and insert the value
   into
  the value
  field of the hidden input. Then it will get sent to the
  server when
  the user hits the post button.
  
  However,
  since you should be validating any user input server
   side,
  you'll need
  to validate that the variable is accurate - might as
  well just do
  the count with php server side.
  
  
  
   Thanks Michael I
  was kind of moving in the right direction as
   far as the
  hidden input goes, going to have to google on how to
   do it with the
  dhtml and all like you suggested.
  
  
   Look at the various DOM
  functions - IE for
  
   input type=hidden
  name=wordcount id=hiddenStudd value=
  
   you coud do in your js:
  
   var myHidden =
  document.getElementById('hiddenStuff');
  
 myHidden.setAttribute('value',$yourvalue);
  
  
   Thought I would go ahead and post a bit more on this,
  so here is my wordcount little function on the textarea of
  the form:
  
   textarea name=Comments
  cols=55 rows=5 wrap=hard
  onKeyDown=wordCounter(this.form.Comments,this.form.remLen,
  300);
  onKeyUp=wordCounter(this.form.Comments,this.form.remLen,
  300);?php if (isset($_SESSION['Comments'])) {echo
  $_SESSION['Comments'];}
  ?/textareabrLetters to the Editor are
  limited to 300 words or less.brWords remaining:
  input type=box readonly name=remLen size=3
  value=300
  
   So I was thinking I should be able to pass that again
  to the next page which is the emailform.php page that is
  taking all the id= and printing them to an email 
   should be able to reuse that function right?
  
   input type=hidden id=words  value=
  onSubmit=return
  wordCounter(this.form.Comments,this.form.remLen); 
  
   or do I need to define the variable? think I'm
  starting to confuse myself lol
 
  You don't want the onSubmit in the the hidden input.
 
  I'm not a javascript guru - but I believe you can have the
  form onSubmit do the word count and insert it into the input
  field before the actual submit happens, I've never tried
  having an onsubmit function alter a value field though.
 
  I would change the textarea to have an id=Comments field
  and the remLen input to have an id=remLen field to make it
  easy to find via getElementById (as id attributes have to be
  unique), count the words and set them to a variable that
  then gets put into the hidden input before whatever function
  you run on the submit type onSubmit returns true.
 
  not tested - but something like this:
 
  function countTheWords() {
 var comment =
  $document.getElementById('Comments');
 var remLen  =
  $document.getElementById('remLen').value;
 var count =
  wordCounter

Re: [PHP] How can I echo a javascript var in an email subject line? Possible?

2009-04-09 Thread tedd

At 1:00 PM -0500 4/8/09, Terion Miller wrote:

Thought I would go ahead and post a bit more on this, so here is my
wordcount little function on the textarea of the form:


-snip-


or do I need to define the variable? think I'm starting to confuse myself
lol


The reason why you are starting to confuse yourself is that you are 
still considering doing some part of this by including javascript in 
the solution -- there is NO need.


Just receive what the user submits and process it server-side before 
mailing -- pure and simple.


That way not only can you clean the submission, but you can count the 
words and put that count in the subject line like you wanted. This 
really a simple problem. You are complicating it by including 
javascript.


Cheers,

tedd

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

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



[PHP] How can I echo a javascript var in an email subject line? Possible?

2009-04-08 Thread Terion Miller
I have a php form, that uses a javascript word counter to make sure
submissions are a certain number of words, I have now been tasked with
taking that word count and having it pass in the email that gets sent when
someone submits a form ..in the subject line.
Here is the code I'm using so far.  Is it possible to just echo a
javascript  variable on a page like you can a php var?
CODE=

// Enter in a subject line for the email.
$_SESSION['EmailSubject'] = Letter to the Editor  echo('submitcount');
 I want to just echo it..possible??

//Thank you text
$_SESSION['ThankYou'] = Thank you for participating\\n\\nYour comments have
been sent to our newsroom. \\nIf our writers or editors have any questions
about your letter, you will receive a reply via phone or e-mail. ;

?


script language=javascript
  var submitcount=0;
   function checkSubmit() {

  if (submitcount == 0)
  {
  submitcount++;
  document.Surv.submit();
  }
   }


function wordCounter(field, countfield, maxlimit) {
wordcounter=0;
for (x=0;xfield.value.length;x++) {
  if (field.value.charAt(x) ==field.value.charAt(x-1) !=  )
{wordcounter++}  // Counts the spaces while ignoring double spaces, usually
one in between each word.
  if (wordcounter  300) {field.value = field.value.substring(0, x);}
  else {countfield.value = maxlimit - wordcounter;}
  }
   }

function textCounter(field, countfield, maxlimit) {
  if (field.value.length  maxlimit)
  {field.value = field.value.substring(0, maxlimit);}
  else
  {countfield.value = maxlimit - field.value.length;}
  }
/script

===END CODE==
Thanks
Terion

Happy Freecycling
Free the List !!
www.freecycle.org
Over Moderation of Freecycle List Prevents Post Timeliness.
Report Moderator Abuse Here:
http://www.freecycle.org/faq/faq/contact-info
Or Email Your Complaint to:
f...@freecycle.org or i...@freecycle.org

Twitter?
http://twitter.com/terionmiller

Facebook:
a href=http://www.facebook.com/people/Terion-Miller/1542024891;
title=Terion Miller's Facebook profile target=_TOPimg src=
http://badge.facebook.com/badge/1542024891.237.919247960.png; border=0
alt=Terion Miller's Facebook profile/a


Re: [PHP] How can I echo a javascript var in an email subject line? Possible?

2009-04-08 Thread Michael A. Peters

Terion Miller wrote:

I have a php form, that uses a javascript word counter to make sure
submissions are a certain number of words, I have now been tasked with
taking that word count and having it pass in the email that gets sent when
someone submits a form ..in the subject line.
Here is the code I'm using so far.  Is it possible to just echo a
javascript  variable on a page like you can a php var?


javascript is client side.
php is server side.
To use something client side in a server side script, the web page has 
to send it to the server from the client.


The best way to do what you want to do is probably to do the work count 
server side, but if you really want to use what javascript produced you 
can create a hidden input with a specified id, and use dhtml via 
javascript to modify the input and insert the value into the value field 
of the hidden input. Then it will get sent to the server when the user 
hits the post button.


However, since you should be validating any user input server side, 
you'll need to validate that the variable is accurate - might as well 
just do the count with php server side.


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



Re: [PHP] How can I echo a javascript var in an email subject line? Possible?

2009-04-08 Thread Terion Miller
javascript is client side.
 php is server side.
 To use something client side in a server side script, the web page has to
 send it to the server from the client.

 The best way to do what you want to do is probably to do the work count
 server side, but if you really want to use what javascript produced you can
 create a hidden input with a specified id, and use dhtml via javascript to
 modify the input and insert the value into the value field of the hidden
 input. Then it will get sent to the server when the user hits the post
 button.

 However, since you should be validating any user input server side, you'll
 need to validate that the variable is accurate - might as well just do the
 count with php server side.



Thanks Michael I was kind of moving in the right direction as far as the
hidden input goes, going to have to google on how to do it with the dhtml
and all like you suggested.

Thanks


Re: [PHP] How can I echo a javascript var in an email subject line? Possible?

2009-04-08 Thread Michael A. Peters

Terion Miller wrote:



javascript is client side.
php is server side.
To use something client side in a server side script, the web page
has to send it to the server from the client.

The best way to do what you want to do is probably to do the work
count server side, but if you really want to use what javascript
produced you can create a hidden input with a specified id, and use
dhtml via javascript to modify the input and insert the value into
the value field of the hidden input. Then it will get sent to the
server when the user hits the post button.

However, since you should be validating any user input server side,
you'll need to validate that the variable is accurate - might as
well just do the count with php server side.



Thanks Michael I was kind of moving in the right direction as far as the 
hidden input goes, going to have to google on how to do it with the 
dhtml and all like you suggested.


Look at the various DOM functions - IE for

input type=hidden name=wordcount id=hiddenStudd value=

you coud do in your js:

var myHidden = document.getElementById('hiddenStuff');
myHidden.setAttribute('value',$yourvalue);

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



Re: [PHP] How can I echo a javascript var in an email subject line? Possible?

2009-04-08 Thread Terion Miller
On Wed, Apr 8, 2009 at 12:50 PM, Michael A. Peters mpet...@mac.com wrote:

 Terion Miller wrote:



javascript is client side.
php is server side.
To use something client side in a server side script, the web page
has to send it to the server from the client.

The best way to do what you want to do is probably to do the work
count server side, but if you really want to use what javascript
produced you can create a hidden input with a specified id, and use
dhtml via javascript to modify the input and insert the value into
the value field of the hidden input. Then it will get sent to the
server when the user hits the post button.

However, since you should be validating any user input server side,
you'll need to validate that the variable is accurate - might as
well just do the count with php server side.



 Thanks Michael I was kind of moving in the right direction as far as the
 hidden input goes, going to have to google on how to do it with the dhtml
 and all like you suggested.


 Look at the various DOM functions - IE for

 input type=hidden name=wordcount id=hiddenStudd value=

 you coud do in your js:

 var myHidden = document.getElementById('hiddenStuff');
 myHidden.setAttribute('value',$yourvalue);


Thought I would go ahead and post a bit more on this, so here is my
wordcount little function on the textarea of the form:

textarea name=Comments cols=55 rows=5 wrap=hard
onKeyDown=wordCounter(this.form.Comments,this.form.remLen, 300);
onKeyUp=wordCounter(this.form.Comments,this.form.remLen, 300);?php if
(isset($_SESSION['Comments'])) {echo $_SESSION['Comments'];}
?/textareabrLetters to the Editor are limited to 300 words or
less.brWords remaining: input type=box readonly name=remLen size=3
value=300

So I was thinking I should be able to pass that again to the next page which
is the emailform.php page that is taking all the id= and printing them to an
email 
should be able to reuse that function right?

input type=hidden id=words  value= onSubmit=return
wordCounter(this.form.Comments,this.form.remLen); 

or do I need to define the variable? think I'm starting to confuse myself
lol


Re: [PHP] How can I echo a javascript var in an email subject line? Possible?

2009-04-08 Thread Michael A. Peters

Terion Miller wrote:





On Wed, Apr 8, 2009 at 12:50 PM, Michael A. Peters mpet...@mac.com 
mailto:mpet...@mac.com wrote:


Terion Miller wrote:



   javascript is client side.
   php is server side.
   To use something client side in a server side script, the web
page
   has to send it to the server from the client.

   The best way to do what you want to do is probably to do the work
   count server side, but if you really want to use what javascript
   produced you can create a hidden input with a specified id,
and use
   dhtml via javascript to modify the input and insert the value
into
   the value field of the hidden input. Then it will get sent to the
   server when the user hits the post button.

   However, since you should be validating any user input server
side,
   you'll need to validate that the variable is accurate - might as
   well just do the count with php server side.



Thanks Michael I was kind of moving in the right direction as
far as the hidden input goes, going to have to google on how to
do it with the dhtml and all like you suggested.


Look at the various DOM functions - IE for

input type=hidden name=wordcount id=hiddenStudd value=

you coud do in your js:

var myHidden = document.getElementById('hiddenStuff');
myHidden.setAttribute('value',$yourvalue);


Thought I would go ahead and post a bit more on this, so here is my 
wordcount little function on the textarea of the form:


textarea name=Comments cols=55 rows=5 wrap=hard 
onKeyDown=wordCounter(this.form.Comments,this.form.remLen, 300); 
onKeyUp=wordCounter(this.form.Comments,this.form.remLen, 300);?php 
if (isset($_SESSION['Comments'])) {echo $_SESSION['Comments'];} 
?/textareabrLetters to the Editor are limited to 300 words or 
less.brWords remaining: input type=box readonly name=remLen size=3 
value=300


So I was thinking I should be able to pass that again to the next page 
which is the emailform.php page that is taking all the id= and printing 
them to an email 

should be able to reuse that function right?

input type=hidden id=words  value= onSubmit=return 
wordCounter(this.form.Comments,this.form.remLen); 


or do I need to define the variable? think I'm starting to confuse 
myself lol


You don't want the onSubmit in the the hidden input.

I'm not a javascript guru - but I believe you can have the form onSubmit 
do the word count and insert it into the input field before the actual 
submit happens, I've never tried having an onsubmit function alter a 
value field though.


I would change the textarea to have an id=Comments field and the 
remLen input to have an id=remLen field to make it easy to find via 
getElementById (as id attributes have to be unique), count the words and 
set them to a variable that then gets put into the hidden input before 
whatever function you run on the submit type onSubmit returns true.


not tested - but something like this:

function countTheWords() {
   var comment = $document.getElementById('Comments');
   var remLen  = $document.getElementById('remLen').value;
   var count = wordCounter($comment,$remLen);
   var myHidden = document.getElementById('words');
   myHidden.setAttribute('value',$count);
   }

Then in whatever function you run in the form onSumbit have it run the 
countTheWords() function before it exits.


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



Re: [PHP] How can I echo a javascript var in an email subject line? Possible? (Yes!)

2009-04-08 Thread Raymond Irving

For me its very easy to pass php values to the client:

echo _var($value,'name');

But the best part is taking control of what your client sees from the 
server-side:

C('#info')-show(); // now you see it
...
C('#info')-hide(); // now you don't!

Take control and start building powerful web apps with Raxan PDI - 
http://raxanpdi.com

__
Raymond Irving
Create Rich Ajax/PHP Web Apps today!
Raxan PDI - http://raxanpdi


--- On Wed, 4/8/09, Michael A. Peters mpet...@mac.com wrote:

 From: Michael A. Peters mpet...@mac.com
 Subject: Re: [PHP] How can I echo a javascript var in an email subject line? 
 Possible?
 To: Terion Miller webdev.ter...@gmail.com
 Cc: PHP General php-general@lists.php.net
 Date: Wednesday, April 8, 2009, 2:34 PM
 Terion Miller wrote:
  
  
  
  
  On Wed, Apr 8, 2009 at 12:50 PM, Michael A. Peters
 mpet...@mac.com
 mailto:mpet...@mac.com
 wrote:
  
      Terion Miller wrote:
  
  
  
             javascript is
 client side.
             php is server
 side.
             To use
 something client side in a server side script, the web
          page
             has to send
 it to the server from the client.
  
             The best way
 to do what you want to do is probably to do the work
             count server
 side, but if you really want to use what javascript
             produced you
 can create a hidden input with a specified id,
          and use
             dhtml via
 javascript to modify the input and insert the value
          into
             the value
 field of the hidden input. Then it will get sent to the
             server when
 the user hits the post button.
  
             However,
 since you should be validating any user input server
          side,
             you'll need
 to validate that the variable is accurate - might as
             well just do
 the count with php server side.
  
  
  
          Thanks Michael I
 was kind of moving in the right direction as
          far as the
 hidden input goes, going to have to google on how to
          do it with the
 dhtml and all like you suggested.
  
  
      Look at the various DOM
 functions - IE for
  
      input type=hidden
 name=wordcount id=hiddenStudd value=
  
      you coud do in your js:
  
      var myHidden =
 document.getElementById('hiddenStuff');
  
    myHidden.setAttribute('value',$yourvalue);
  
  
  Thought I would go ahead and post a bit more on this,
 so here is my wordcount little function on the textarea of
 the form:
  
      textarea name=Comments
 cols=55 rows=5 wrap=hard
 onKeyDown=wordCounter(this.form.Comments,this.form.remLen,
 300);
 onKeyUp=wordCounter(this.form.Comments,this.form.remLen,
 300);?php if (isset($_SESSION['Comments'])) {echo
 $_SESSION['Comments'];}
 ?/textareabrLetters to the Editor are
 limited to 300 words or less.brWords remaining:
 input type=box readonly name=remLen size=3
 value=300
  
  So I was thinking I should be able to pass that again
 to the next page which is the emailform.php page that is
 taking all the id= and printing them to an email 
  should be able to reuse that function right?
  
  input type=hidden id=words  value=
 onSubmit=return
 wordCounter(this.form.Comments,this.form.remLen); 
  
  or do I need to define the variable? think I'm
 starting to confuse myself lol
 
 You don't want the onSubmit in the the hidden input.
 
 I'm not a javascript guru - but I believe you can have the
 form onSubmit do the word count and insert it into the input
 field before the actual submit happens, I've never tried
 having an onsubmit function alter a value field though.
 
 I would change the textarea to have an id=Comments field
 and the remLen input to have an id=remLen field to make it
 easy to find via getElementById (as id attributes have to be
 unique), count the words and set them to a variable that
 then gets put into the hidden input before whatever function
 you run on the submit type onSubmit returns true.
 
 not tested - but something like this:
 
 function countTheWords() {
    var comment =
 $document.getElementById('Comments');
    var remLen  =
 $document.getElementById('remLen').value;
    var count =
 wordCounter($comment,$remLen);
    var myHidden =
 document.getElementById('words');
    myHidden.setAttribute('value',$count);
    }
 
 Then in whatever function you run in the form onSumbit have
 it run the countTheWords() function before it exits.
 
 -- 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] Mail subject encoding problem

2009-01-31 Thread Manuel Lemos
Hello,

on 01/30/2009 11:43 AM Thodoris said the following:
 Yes I know that this is not reasonable but using UTF-8 fails. And this
 seems to work in some cases. I am thinking that this has to do with
 PHP's internal encoding or something with the OS. I am not sure why that
 works this way that's why I am asking for some enlightenment  :-)
 
 Is there something that I need to set for PHP to change its behavior.

You cannot send 8 bit characters in e-mail. For headers you need to use
q-encoding to make your non-ASCIIC characters be represented with only
ASCII characters.

If you are not sure on how to encode message headers with q-encoding,
you may want to try this MIME message class. Take a look at the
test_email_message.php example to learn how to send messages with
non-ASCII characters on the headers or body.

http://www.phpclasses.org/mimemessage


-- 

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/

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



[PHP] Mail subject encoding problem

2009-01-30 Thread Thodoris

Hi gang,
   I have developed a web intranet and I have added mail notification 
when some tasks are done. I am using the mail() function to send mail 
since no advanced features are needed like attachments. So I am facing a 
weird problem with the mail subject encoding. Let me explain.


I am having a FreeBSD web server for development that is working like a 
charm when sending mail using something like this:


// Define the e-mail content
$email = f...@foo,com;
$subject = H εργασία: (id: 1868) έκλεισε χωρίς σχόλια.;
$message = Αυτό είναι ένα τέστ. Αυτό είναι ένα τέστ. Αυτό είναι ένα τέστ.;
// $subject = mb_encode_mimeheader($subject,'iso-8859-1','B');

// Set the headers and send the e-mail
$headers  = 'MIME-Version: 1.0' . \r\n;
$headers .= 'Content-type: text/html; charset=utf-8' . \r\n;
$headers .= From: t...@foo.com\r\nreply-to:  t...@foo.com\r\nx-mailer: 
PHP;

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

The language  in both subject and  mail body  is Greek. But when I am 
uploading  this to a Linux CentOS 5.2 server this mail is being sent but 
the subject is rubbish.
All encodings are in UTF-8 (the php file, the encoding of the mail 
client etc) so to solve this I have added the mb_encode_mimeheader line.


This quite many times although sometimes it works. I have also tried to 
set quoted-printable mime encoding with similar results.


FreeBSD has PHP 5.2.8
Linux has PHP 5.2.5
The php.ini used is almost identical.

Any ideas on this ??

--
Thodoris


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



Re: [PHP] Mail subject encoding problem

2009-01-30 Thread Per Jessen
Thodoris wrote:

 I am having a FreeBSD web server for development that is working like
 a charm when sending mail using something like this:
 
 // Define the e-mail content
 $email = f...@foo,com;
 $subject = H εργασία: (id: 1868) έκλεισε χωρίς σχόλια.;
 $message = Αυτό είναι ένα τέστ. Αυτό είναι ένα τέστ. Αυτό είναι ένα
 τέστ.; // $subject = mb_encode_mimeheader($subject,'iso-8859-1','B');
 
 The language  in both subject and  mail body  is Greek. But when I am
 uploading  this to a Linux CentOS 5.2 server this mail is being sent
 but the subject is rubbish.
 All encodings are in UTF-8 (the php file, the encoding of the mail
 client etc) so to solve this I have added the mb_encode_mimeheader
 line.

But for some reason you've specified ISO-8859-1 instead of UTF-8?


/Per Jessen, Zürich


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



Re: [PHP] Mail subject encoding problem

2009-01-30 Thread Thodoris



Thodoris wrote:

  

I am having a FreeBSD web server for development that is working like
a charm when sending mail using something like this:

// Define the e-mail content
$email = f...@foo,com;
$subject = H εργασία: (id: 1868) έκλεισε χωρίς σχόλια.;
$message = Αυτό είναι ένα τέστ. Αυτό είναι ένα τέστ. Αυτό είναι ένα
τέστ.; // $subject = mb_encode_mimeheader($subject,'iso-8859-1','B');

The language  in both subject and  mail body  is Greek. But when I am
uploading  this to a Linux CentOS 5.2 server this mail is being sent
but the subject is rubbish.
All encodings are in UTF-8 (the php file, the encoding of the mail
client etc) so to solve this I have added the mb_encode_mimeheader
line.



But for some reason you've specified ISO-8859-1 instead of UTF-8?


/Per Jessen, Zürich


  


Yes I know that this is not reasonable but using UTF-8 fails. And this 
seems to work in some cases. I am thinking that this has to do with 
PHP's internal encoding or something with the OS. I am not sure why that 
works this way that's why I am asking for some enlightenment  :-)


Is there something that I need to set for PHP to change its behavior.

--
Thodoris



Re: [PHP] Mail subject encoding problem

2009-01-30 Thread Per Jessen
Thodoris wrote:

 
 But for some reason you've specified ISO-8859-1 instead of UTF-8?


 /Per Jessen, Zürich


 Yes I know that this is not reasonable but using UTF-8 fails.  

Fails _how_?  Put up the resulting email somewhere for us to see. (the
raw email text).

If your source files are UTF-8, you need to specify UTF-8 when you
mime-encode the headers for email.


/Per Jessen, Zürich


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



[PHP] Problems with mime encoding of Japanese Characters in Subject and 'From:', 'Reply-to:', ... fields.

2008-03-20 Thread Dietrich Bollmann
Hi, 

--- note ---
I sent a similar message already to php-i18n - but this list seems
not to be used very much (20 messages this year) so I am posting it
here again...


I try to send messages written in Japanese (Kana/Kanji) with php.

Everything works fine - only when the subject (or the name of the
sender) becomes longer, there seems to be something wrong with the
encoding: Neither my nor the mail reader of other (Japanese) friends 
decodes the mime string. At the place of the Japanese Characters, 
the mime string itself is displayed in the subject (to, reply to) 
field.

As this doesn't happen for other Japanese emails with even longer
subjects, I suppose I did something wrong ... but what?

Here how I convert the subject (the name is converted using the same
method and the sources are saved in UTF-8 using emacs):

  $subjectJIS  = mb_convert_encoding($subject, ISO-2022-JP, AUTO);
  $subjectMIME = mb_encode_mimeheader($subjectJIS, ISO-2022-JP, B);
  ...snip...
  mail($to, $subjectMIME, $bodyJIS, $headers);

Here part of the message as it is displayed by my mail program:

  From:
=?ISO-2022-JP?B?GyRCJCskSjRBO3okKyRKNEE7eiQrJEo0QTt6JCskSjRBO3okKyRKNEE7?==?ISO-2022-JP?B?eiQrJEo0QTt6JCskSjRBO3okKyRKNEE7eiQrJEo0QTt6JCskSjRBO3ob?=(B
 [EMAIL PROTECTED]
  ...snip...
  Subject:
=?ISO-2022-JP?B?GyRCJCskSjRBO3okKyRKNEE7eiQrJEo0QTt6JCskSjRBO3okKyRKNEE7?= 
=?ISO-2022-JP?B?eiQrJEo0QTt6JCskSjRBO3okKyRKNEE7eiQrJEo0QTt6JCskSjRBO3ob?= (B
  ...snip...
  
  かな漢字かな漢字かな漢字かな漢字かな漢字かな漢字かな漢字かな漢字かな漢
字かな漢字

And here part of the mail text itself:

  ...snip...
  Subject:

=?ISO-2022-JP?B?GyRCJCskSjRBO3okKyRKNEE7eiQrJEo0QTt6JCskSjRBO3okKyRKNEE7?=

=?ISO-2022-JP?B?eiQrJEo0QTt6JCskSjRBO3okKyRKNEE7eiQrJEo0QTt6JCskSjRBO3ob?=
=?ISO-2022-JP?B?KEI=?=
  MIME-Version: 1.0
  From:
=?ISO-2022-JP?B?GyRCJCskSjRBO3okKyRKNEE7eiQrJEo0QTt6JCskSjRBO3okKyRKNEE7?= 
=?ISO-2022-JP?B?eiQrJEo0QTt6JCskSjRBO3okKyRKNEE7eiQrJEo0QTt6JCskSjRBO3ob?= 
=?ISO-2022-JP?B?KEI=?= [EMAIL PROTECTED]
  ...snip...
  Content-Type: text/plain; charset=ISO-2022-JP
  ...snip...
  
  かな漢字かな漢字かな漢字かな漢字かな漢字かな漢字かな漢字かな漢字かな漢
字かな漢字

Here a part of another (spam) mail which is correctly displayed by my
mail program:

  MIME-Version: 1.0
  Subject:
=?ISO-2022-JP?B?GyRCIXolXSUkJXMlSBsoQjEwGyRCR1whdUF3TkEbKEI=?=
=?ISO-2022-JP?B?GyRCTDVOQSF6GyhCMSwwMDAbJEIxXyU4JWUbKEI=?=
=?ISO-2022-JP?B?GyRCJSglaiE8Qmc9ODlnISohWjNaRTchWxsoQg==?=
=?ISO-2022-JP?B?GyRCIUobKEIyMDA4LzAzLzE5?= =?ISO-2022-JP?B?KQ==?=
  From: =?ISO-2022-JP?B?GyRCM1pFNztUPmwlOCVlJSglaiE8ISYlIhsoQg==?=
=?ISO-2022-JP?B?GyRCJS8lOyU1JWohPCVLJWUhPCU5GyhC?=
[EMAIL PROTECTED]
  
Displayed as:

  From: 楽天市場ジュエリー・アクセサリーニュース
[EMAIL PROTECTED]
  ...snip...
  Subject:  ★ポイント10倍&送料無料★1,000円ジュエリー大集合!【楽天】
(2008/03/19)
  
If anybody can explain me the problem I would be most grateful :)

Thanks, Dietrich


---
PS: I appended a little example program which produces the problem.

The same program works correctly when using the following values:

  $subject = かな漢字;
  $senderName = かな漢字;

Thanks for your help :)


!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
 head
 meta http-equiv=content-type content=text/html;
charset=UTF-8 /
 titleContact Me/title
 /head
 body

 h1かな漢字/h1

 ?php # Script 10.1 - email.php

function sendEmail($recipientEmailAddress, $subject, $body, $senderName,
$senderEmailAddress) {

// set current language to Japanese
mb_language(ja);

// encode subject
// - first using JIS (ISO-2022-JP)
// - after encoding the resulting JIS string with the MIME header
encoding scheme
$subjectJIS  = mb_convert_encoding($subject, ISO-2022-JP, AUTO);
$subjectMIME = mb_encode_mimeheader($subjectJIS, ISO-2022-JP,
B);

// encode the name of the sender
// - first using JIS (ISO-2022-JP)
// - after encoding the resulting JIS string with the MIME header
encoding scheme
$senderNameJIS  = mb_convert_encoding($senderName, ISO-2022-JP,
AUTO);
$senderNameMIME = mb_encode_mimeheader($senderNameJIS,
ISO-2022-JP, B);

// encode body
// - using JIS (ISO-2022-JP)
// - the used coding system had to be specified in the
Content-Type/charset header:
//   Content-Type: text/plain; charset=ISO-2022-JP
$bodyJIS = mb_convert_encoding($body, ISO-2022-JP, AUTO);

// formatting the sender string
$senderMIME = sprintf(%s %s, $senderNameMIME,
$senderEmailAddress);

// formatting the mime header
$headers  = MIME-Version: 1.0\n ;
$headers .= sprintf(From: %s\n, $senderMIME);
$headers .= sprintf(Reply-To: %s\n, $senderMIME);
$headers .= Content-Type: text/plain; charset=ISO-2022-JP\n;
   
// send encoded mail
$result = mail($recipientEmailAddress, $subjectMIME, $bodyJIS,
$headers);

// return result
return $result;
 }

$to = [EMAIL

[PHP] Re: Problems with mime encoding of Japanese Characters in Subject and'From:', 'Reply-to:', ... fields.

2008-03-20 Thread Manuel Lemos
Hello,

on 03/20/2008 04:06 AM Dietrich Bollmann said the following:
 Hi, 
 
 --- note ---
 I sent a similar message already to php-i18n - but this list seems
 not to be used very much (20 messages this year) so I am posting it
 here again...
 
 
 I try to send messages written in Japanese (Kana/Kanji) with php.
 
 Everything works fine - only when the subject (or the name of the
 sender) becomes longer, there seems to be something wrong with the
 encoding: Neither my nor the mail reader of other (Japanese) friends 
 decodes the mime string. At the place of the Japanese Characters, 
 the mime string itself is displayed in the subject (to, reply to) 
 field.
 
 As this doesn't happen for other Japanese emails with even longer
 subjects, I suppose I did something wrong ... but what?

You may want to try this MIME message composing and sending class that
can send messages with encoded headers correctly using any character
set. Take a look at the test_multibyte_message.php example script:

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

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

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



Re: [PHP] Problems with mime encoding of Japanese Characters in Subject and 'From:', 'Reply-to:', ... fields.

2008-03-20 Thread Dietrich Bollmann
Hi - in order to see the Japanese Characters in the previous mail 
you might have to switch the Character Encoding of your Email reader
to Unicode (UTF-8).  In my case (I am using the Evolution mail program
on Linux): 

  View  Character Encoding  Unicode (UTF-8)

Dietrich

On Thu, 2008-03-20 at 16:06 +0900, Dietrich Bollmann wrote:
 I try to send messages written in Japanese (Kana/Kanji) with php.
 
 Everything works fine - only when the subject (or the name of the
 sender) becomes longer, there seems to be something wrong with the
 encoding: Neither my nor the mail reader of other (Japanese) friends 
 decodes the mime string. At the place of the Japanese Characters, 
 the mime string itself is displayed in the subject (to, reply to) 
 field.
 
 As this doesn't happen for other Japanese emails with even longer
 subjects, I suppose I did something wrong ... but what?


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



[PHP] mail() encoded subject line

2006-10-16 Thread Emil Edeholt

Hi,

I hope this is not too off topic but I have a problem when I use mail(). 
When I add the header Content-Type: text/plain; charset=UTF-8 the body 
of the mail is encoded fine but the subject is not encoded. I've tried 
to utf8_encode() and utf8_decode() the subject text but neither helps.


Any idea of how to pass what encoding to use on an email subject?

Thanks!

Regards Emil

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



[PHP] Re: mail() encoded subject line

2006-10-16 Thread Colin Guthrie
Emil Edeholt wrote:
 Hi,
 
 I hope this is not too off topic but I have a problem when I use mail().
 When I add the header Content-Type: text/plain; charset=UTF-8 the body
 of the mail is encoded fine but the subject is not encoded. I've tried
 to utf8_encode() and utf8_decode() the subject text but neither helps.
 
 Any idea of how to pass what encoding to use on an email subject?
 
 Thanks!
 
 Regards Emil
 

Have a look at the Zend Mail wrapper.

You have to specially encode the subject to be completely stand alone
from the encoding of the body. All header that contain special
characters (e.g. the From name) have to be stand-alone as the
Content-Type header only applies to the body of the message.

See here: http://www.snook.ca/archives/servers/encoding_accent/

In the Zend Framework:
http://framework.zend.com/fisheye/browse/~raw,r=598/Zend_Framework/trunk/library/Zend/Mail.php
Look at the _encodeHeader() function and more specifically the
Zend_Mime::encodeQuotedPrintable($value) method.

Hope that helps.

Col

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



[PHP] Re: mail() encoded subject line

2006-10-16 Thread Manuel Lemos
Hello,

on 10/16/2006 02:32 PM Emil Edeholt said the following:
 I hope this is not too off topic but I have a problem when I use mail().
 When I add the header Content-Type: text/plain; charset=UTF-8 the body
 of the mail is encoded fine but the subject is not encoded. I've tried
 to utf8_encode() and utf8_decode() the subject text but neither helps.
 
 Any idea of how to pass what encoding to use on an email subject?

Headers encoding is independent of message body encoding set by
Content-Type. Headers need to be encoded with q-encoding algorithm.

You may want to take a look at this popular MIME message class. Just use
the SetEncodedHeader function to add the Subject or another header that
may use 8 bit (non-ASCII) data.

The character set encoding of the message is set using the
default_charset class variable. But you can use a different character
set encoding for individual headers, using the 3rd parameter of the
SetEncodedHeader function.

Take a look at the test_email_message.php example script that shows how
to send messages with non-ASCII characters in the Subject and body.

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

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

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



Re: [PHP] mail() encoded subject line

2006-10-16 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-16 14:32:12 +0200:
 I hope this is not too off topic but I have a problem when I use mail(). 
 When I add the header Content-Type: text/plain; charset=UTF-8 the body 
 of the mail is encoded fine but the subject is not encoded. I've tried 
 to utf8_encode() and utf8_decode() the subject text but neither helps.
 
 Any idea of how to pass what encoding to use on an email subject?

I see others already gave you some fish so I'll just offer you
the fishing manual: http://www.faqs.org/rfcs/rfc2047.html

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



[PHP] Re: Downloading of PgSQL data for use local (crappy subject line)

2006-08-24 Thread Michelle Konzack
Hello Richard,

Am 2006-08-18 14:02:51, schrieb Richard Lynch:
 For LARGE datasets, CSV or tab-delimited transfers are probably going
 to be easiest to suck in to the DB.

No, they are only one ore more rows (~1-20) from the
timeline_table and the a row from the projects_table

 Another option is to just use pg_dump, if you want whole tables.

10 GByte is a little to much for little $USER.  ;-)

 Otherwise, honestly, I'd suggest you just export your data to RSS or
 XML and let the user choose how to open it up.

Hmmm, I have no experience with RSS or XML.  Do you have links?

And the, let the user choose how to open it up  -  ROTFL!!!

The $USER is the Typical OFFICE-Guy with ZERO clue about informatic

His/Her workstation has all installed to handel the downloads,
since ist a full Intranet system pased on PHP5.

 Even CSV export is better than PHP arrays, since they can open the
 stuff up in Excel if they want to.

Excel?  --  LOL, ROTFL!!!

Micosuck-Ware was droped for some (3) years!

Since we have encountered the Windows is calling home without the
$USER knowledge and since I am working for the Ministry of Defense...

Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)

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



[PHP] Downloading of PgSQL data for use local (crappy subject line)

2006-08-18 Thread Michelle Konzack
Hello,

I have:   1)  PostgreSQL 7.4/8.1
  2)  PHP5
  3)  Apache 1.3

The client have   1)  A web browser
  2)  PHP4/5
  3)  PostgreSQL X.XX

The clients can surf my website/database and collect data for
Off-Line working, exactly, I want, that they can download a
file containing the requested data and importing it into there
local database using a http://localhost/ Intranet Interface.

Since $USER is generaly not a Geek/Nerd/Freek or something like
this all must be done easyly...

Now my question:

What is the best format to transfer such data?

I was thinking, that I create from each $ROW selected from the
Database a PHP.include which contain the data in a array

array[serno]=;
array[foo]=...;
array[bar]=...;

which then can be imported and read from a PHP script.

Additonaly I want to encrypt (the $USER must upload his/her public
GPG key) this file because some of the stupid $USER can lost one
(should not, but it allredy happen).

Any suggestions?


Greetings
Michelle Konzack


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)

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



Re: [PHP] Downloading of PgSQL data for use local (crappy subject line)

2006-08-18 Thread Richard Lynch
For LARGE datasets, CSV or tab-delimited transfers are probably going
to be easiest to suck in to the DB.

Another option is to just use pg_dump, if you want whole tables.

Otherwise, honestly, I'd suggest you just export your data to RSS or
XML and let the user choose how to open it up.

Even CSV export is better than PHP arrays, since they can open the
stuff up in Excel if they want to.

On Wed, August 16, 2006 6:00 pm, Michelle Konzack wrote:
 Hello,

 I have:   1)  PostgreSQL 7.4/8.1
   2)  PHP5
   3)  Apache 1.3

 The client have   1)  A web browser
   2)  PHP4/5
   3)  PostgreSQL X.XX

 The clients can surf my website/database and collect data for
 Off-Line working, exactly, I want, that they can download a
 file containing the requested data and importing it into there
 local database using a http://localhost/ Intranet Interface.

 Since $USER is generaly not a Geek/Nerd/Freek or something like
 this all must be done easyly...

 Now my question:

 What is the best format to transfer such data?

 I was thinking, that I create from each $ROW selected from the
 Database a PHP.include which contain the data in a array

 array[serno]=;
 array[foo]=...;
 array[bar]=...;

 which then can be imported and read from a PHP script.

 Additonaly I want to encrypt (the $USER must upload his/her public
 GPG key) this file because some of the stupid $USER can lost one
 (should not, but it allredy happen).

 Any suggestions?


 Greetings
 Michelle Konzack


 --
 Linux-User #280138 with the Linux Counter, http://counter.li.org/
 # Debian GNU/Linux Consultant
 #
 Michelle Konzack   Apt. 917  ICQ #328449886
50, rue de Soultz MSM LinuxMichi
 0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)

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




-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] phpmailer subject line wierdness

2006-03-27 Thread Mark Steudel
I know that there is a phpmailer list, but it's pretty low volume, so I
hoped you all might have some ideas on this.
 
If I set the subject line for a mail like:
 
$mail-Subject = 'Jconnect Passover Registration Confirmation';
 
The email never send, but if I stick a letter between O and N it goes out:
 
$mail-Subject = 'Jconnect Passover Registration Confirmatioan';
 
Any ideas? Does the 'on' translate to some weird line end character? Can I
try and re-encode it or something?
 
Mark


Re: [PHP] phpmailer subject line wierdness

2006-03-27 Thread Chris

Mark Steudel wrote:

I know that there is a phpmailer list, but it's pretty low volume, so I
hoped you all might have some ideas on this.
 
If I set the subject line for a mail like:
 
$mail-Subject = 'Jconnect Passover Registration Confirmation';
 
The email never send, but if I stick a letter between O and N it goes out:
 
$mail-Subject = 'Jconnect Passover Registration Confirmatioan';
 
Any ideas? Does the 'on' translate to some weird line end character? Can I

try and re-encode it or something?


Could be as simple as a spam filter grabbing it - check your mail logs 
to make sure it's getting that far.


--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] Altering subject of email in a pop3 mailbox

2006-02-23 Thread IG

Chris wrote:

IG wrote:
Is it possible to alter a subject line (or body for that matter) of an 
email in a pop3 mailbox?


If it's already in the mailbox, then I highly doubt you can do this.

You need to do this on the way in before it gets to the account.

Consider the ramifications if you could:

Anyone could login to your mail account and change the emails already 
there.


Eek!



Thanks- I completely see your point.

How do antispam filters work on client's computers? They seem to have no 
problem with adding to subjects. Also our hosting provider uses a spam 
filter which adds it to the subject line. However I am finding that not 
particularly good.


Many thanks,

IG

--

[EMAIL PROTECTED]
www.selectperformers.com

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



Re: [PHP] Altering subject of email in a pop3 mailbox

2006-02-23 Thread Duncan Hill
On Thursday 23 February 2006 11:49, IG wrote:
  IG wrote:
  Is it possible to alter a subject line (or body for that matter) of an
  email in a pop3 mailbox?

 Thanks- I completely see your point.

 How do antispam filters work on client's computers? They seem to have no
 problem with adding to subjects. Also our hosting provider uses a spam
 filter which adds it to the subject line. However I am finding that not
 particularly good.

ISP Mailbox - POP3 over TCP/IP - client filter app - client pc mailbox

Once the data is in mid-stream across the net, the filtering app can affect it 
any way it likes.

Ditto for the ISP method, they just tend to do it as the mail is received and 
before it gets written to the mail spool.

You can change things on a POP server, if you have access to the OS on the POP 
server and can edit the mail spool.  Not normally available to anyone but the 
system administrator(s).

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



Re: [PHP] Altering subject of email in a pop3 mailbox

2006-02-23 Thread IG

Thanks, Nobody Special.

You like filling people with confidence. We all have to start somewhere 
don't we? I am starting this completely from scratch and it will be 
quite a while before I put this into service.


However thanks for the information on mail boxes. I don't have much 
knowledge on them because they are all run by our hosting provider. If 
you could point me to somewhere where I can find more information out on 
mailboxes I would be most grateful.


Many thanks,

IG

Nobody Special wrote:

POP is a protocol used for a client to retrieve emails from a mail
box.  There are not pop3 mail boxes.  The types of mail boxes are mbox
and maildir.You cannot modify a message using the pop3 protocol.

I think you are the last person I would want writing a spam filter
because you don't seem to know how mail is stored to begin with.


On 2/22/06, IG [EMAIL PROTECTED] wrote:

Hi all.

Tried to find this and can't find any info.

I am writing a spam filter to run over multiple pop3 mail boxes which
will work on keywords and Bayesian. With a very high score the filter
will simply delete the email, with a med-high it will back the email in
a 'bulk-mail' folder and delete it from the mailbox. with medium score I
was wanting it to append the keyword [spam?] to the subject line and
keep it in the pop3 mailbox. I can't work out how to do this in php. Can
anyone help me on this one? Is it possible to alter a subject line (or
body for that matter) of an email in a pop3 mailbox?

Thanks.

--

[EMAIL PROTECTED]
www.selectperformers.com

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





--
Use Linux.
W=Wrong
Proud member of the reality-based community!
In opposing the Federalists, [Jefferson] ushered in a
kind of sustained partisan activity that had never existed
before. Initially called the Republican party, it became known
in the era of Andrew Jackson as simply the Democracy;
later on, it was called the Democratic party. But even the modern
Republican party, formed in 1854, chose its name in part to honor
Jefferson.  -- Joyce Appleby on Jefferson




--

[EMAIL PROTECTED]
www.selectperformers.com

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



[PHP] Altering subject of email in a pop3 mailbox

2006-02-22 Thread IG

Hi all.

Tried to find this and can't find any info.

I am writing a spam filter to run over multiple pop3 mail boxes which 
will work on keywords and Bayesian. With a very high score the filter 
will simply delete the email, with a med-high it will back the email in 
a 'bulk-mail' folder and delete it from the mailbox. with medium score I 
was wanting it to append the keyword [spam?] to the subject line and 
keep it in the pop3 mailbox. I can't work out how to do this in php. Can 
anyone help me on this one? Is it possible to alter a subject line (or 
body for that matter) of an email in a pop3 mailbox?


Thanks.

--

[EMAIL PROTECTED]
www.selectperformers.com

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



Re: [PHP] Altering subject of email in a pop3 mailbox

2006-02-22 Thread Chris

IG wrote:
Is it possible to alter a subject line (or 
body for that matter) of an email in a pop3 mailbox?


If it's already in the mailbox, then I highly doubt you can do this.

You need to do this on the way in before it gets to the account.

Consider the ramifications if you could:

Anyone could login to your mail account and change the emails already there.

Eek!

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] OT - Blank subject lines!!!

2005-06-17 Thread -{ Rene Brehmer }-

That's why I have this at the top of my mail filters:

if subject matches regexp
([[:blank:]][[:blank:]][[:blank:]]+) | (^$) | (^[[:blank:]]+$)
transfer to trash

I'm using Eudora btw...

Was gonna do a filter to dump all subjects that have nothing else but 
help in them too, but haven't quite decided on that yet...



Rene

At 07:49 13/04/2005, Miles Thompson wrote:
I assume others are seeing these as well - infrequent postings with blank 
subject lines. Always throws me for a bit of a loop, forcing a pause and 
adjust.


For those replying to them, or hijacking them, please stop.

Regards - Miles Thompson

PS Truly Canadian - note the please! /mt


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



[PHP] OT - Blank subject lines!!!

2005-04-13 Thread Miles Thompson
I assume others are seeing these as well - infrequent postings with blank 
subject lines. Always throws me for a bit of a loop, forcing a pause and 
adjust.

For those replying to them, or hijacking them, please stop.
Regards - Miles Thompson
PS Truly Canadian - note the please! /mt
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] ISO encoding of subject in mail?

2005-03-30 Thread Kim Madsen

 -Original Message-
 From: Kim Madsen [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 29, 2005 3:56 PM

 I´d like to encode the subject in mails generated and sent by PHP, so
 Danish letters like æ,ø and å can be used too... like this:
 
 Subject: Problemer med =?ISO-8859-1?Q?f=E6llesdrev_m=2Em=2E?=
 
 I can´t seem to find a proper function for this? I´ve tried with encode(),
 htmlentities() and htmlspecialchars():

mb_send_mail() did the trick for me... Somehow there a need for a reference to 
this function on encoding sites or a search function on specific words (like 
ISO-8859)

/kim

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



[PHP] ISO encoding of subject in mail?

2005-03-29 Thread Kim Madsen
Hi

I´d like to encode the subject in mails generated and sent by PHP, so Danish 
letters like æ,ø and å can be used too... like this:

Subject: Problemer med =?ISO-8859-1?Q?f=E6llesdrev_m=2Em=2E?=

I can´t seem to find a proper function for this? I´ve tried with encode(), 
htmlentities() and htmlspecialchars(): 

$subject = htmlentities($subject, ENT_QUOTES, ISO-8859-1); 

which gives: 

Subject: ADVARSEL: Faring; IP adresser tilbage

And it´s not converted by the mailclients. 

I´d like to solve this since the mailserver at work complaints if the subject 
is not encoded: 

X-Amavis-Alert: BAD HEADER Non-encoded 8-bit data (char E5 hex) in message 
header 'Subject': Subject: ADVARSEL: F\345 IP adresser ti...

Any tips/ideas?

--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/systemdeveloper

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



[PHP] Re: ISO encoding of subject in mail?

2005-03-29 Thread l0t3k
Kim,
  i vaguely recall some new (aka 5.04) functions added to the mbstring 
extension to handle this.

BTW, are you _the_ Kim Madsen of TKBMMemtable fame ?

Kim Madsen [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
Hi

I´d like to encode the subject in mails generated and sent by PHP, so Danish 
letters like æ,ø and å can be used too... like this:

Subject: Problemer med =?ISO-8859-1?Q?f=E6llesdrev_m=2Em=2E?=

I can´t seem to find a proper function for this? I´ve tried with encode(), 
htmlentities() and htmlspecialchars():

$subject = htmlentities($subject, ENT_QUOTES, ISO-8859-1);

which gives:

Subject: ADVARSEL: Faring; IP adresser tilbage

And it´s not converted by the mailclients.

I´d like to solve this since the mailserver at work complaints if the 
subject is not encoded:

X-Amavis-Alert: BAD HEADER Non-encoded 8-bit data (char E5 hex) in message 
header 'Subject': Subject: ADVARSEL: F\345 IP adresser ti...

Any tips/ideas?

--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/systemdeveloper 

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



[PHP] Re: ISO encoding of subject in mail?

2005-03-29 Thread M. Sokolewicz
convert it to quoted-printable using eg. imap_8bit()
L0t3k wrote:
Kim,
  i vaguely recall some new (aka 5.04) functions added to the mbstring 
extension to handle this.

BTW, are you _the_ Kim Madsen of TKBMMemtable fame ?
Kim Madsen [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
Hi

I´d like to encode the subject in mails generated and sent by PHP, so Danish 
letters like æ,ø and å can be used too... like this:

Subject: Problemer med =?ISO-8859-1?Q?f=E6llesdrev_m=2Em=2E?=
I can´t seem to find a proper function for this? I´ve tried with encode(), 
htmlentities() and htmlspecialchars():

$subject = htmlentities($subject, ENT_QUOTES, ISO-8859-1);
which gives:
Subject: ADVARSEL: Faring; IP adresser tilbage
And it´s not converted by the mailclients.
I´d like to solve this since the mailserver at work complaints if the 
subject is not encoded:

X-Amavis-Alert: BAD HEADER Non-encoded 8-bit data (char E5 hex) in message 
header 'Subject': Subject: ADVARSEL: F\345 IP adresser ti...

Any tips/ideas?
--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/systemdeveloper 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: ISO encoding of subject in mail?

2005-03-29 Thread Manuel Lemos
Hello,
on 03/29/2005 10:55 AM Kim Madsen said the following:
 I´d like to encode the subject in mails generated and sent by PHP, so 
Danish letters like æ,ø and å can be used too... like this:

 Subject: Problemer med =?ISO-8859-1?Q?f=E6llesdrev_m=2Em=2E?=

That is q-encoding. PHP has a function for encoding as quoted-printable 
but it is not exactly the same thing.

You may want to try this class that comes with support to encode headers 
 with q-encoding and it comes with an example to demonstrate that:

http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Re: ISO encoding of subject in mail?

2005-03-29 Thread Kim Madsen

 -Original Message-
 From: l0t3k [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 30, 2005 7:07 AM

 Kim,
   i vaguely recall some new (aka 5.04) functions added to the mbstring
 extension to handle this.

Hmm... I´m programming on a platform with 4.3.10, so that won´t work for me. 
Might just create my own function since it´s 6 chars that needs to be 
converted... 
 
 BTW, are you _the_ Kim Madsen of TKBMMemtable fame ?

Hehe, I doubt that since I have NO clue what the heck You´re talking about :-)

/Kim

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



Re: [PHP] Re: ISO encoding of subject in mail?

2005-03-29 Thread Lars B. Jensen
  i vaguely recall some new (aka 5.04) functions added to the mbstring
extension to handle this.
Hmm... I´m programming on a platform with 4.3.10, so that won´t work for 
me. Might just create my own function since it´s 6 chars that needs to be 
converted...
beware of biting dog when proceeding with mbstring functions, as some is 
buggy for some languages (in my case Japanese)

--
Lars B. Jensen, Internet Architect
CareerCross Japan
Japan's premier online career resource for english speaking professionals
http://www.careercross.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Re: ISO encoding of subject in mail?

2005-03-29 Thread Kim Madsen

 -Original Message-
 From: M. Sokolewicz [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 29, 2005 6:09 PM

 convert it to quoted-printable using eg. imap_8bit()

That seems to be, what I want _but_ NO PHP is printed after I call this 
function. I turns out that we haven´t got PHP compiled with imap support and 
the setup shows no errors as default (never worked with that, it confused me a 
lot :-)

/kim

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



[no subject]

2004-11-19 Thread webmaster


Norton AntiVirus Deleted1.txt
Description: plain/text
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] whoops, forgot to change the subject on that last one...

2004-11-08 Thread Jim Wharton
Jim Wharton said:
 I'm not very familiar with php's drawing abilities. I have found out how
 to get it to create multipoint polygons.

 What I am trying to do is implement something along the lines of LOGO.
 (You know, that old language that told a robotic turtle to draw on the
 floor)

 Seriously, I currently have an inherited Java program that takes traverse
 information (strings that look like this: BAS(L66D24R66U24)) and createds
 this: Left:66 Down:24 Right: 66 Up:24 and draws it out to the screen.
 These are building drawings made by field appraisers (for the local
 property appraisers office).

 I would really like to drop the Java stuff as I don't really use it. What
 I would really like to do is somehow turn these strings into coordinates
 so I can draw them using PHP's polygon function.

 --
 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] New/changing subject... was [PHP] Re: PEAR mail

2004-11-08 Thread Jim Wharton
Ben Ramsey said:

 Is this somehow related to the PEAR mail thread? I don't see the
 connection. I think you're trying to ask a new question. When doing so,
 please don't reply to an existing message in an existing thread (even if
 you change the subject) because you're new question will become a part
 of the old thread. ALWAYS start a brand new message; a descriptive
 subject is also helpful. You'll get a better response and more help this
 way.

 Thanks!

Yeah, sorry, I am aware of that. I wasn't sure of the list's address, so I
replied to an existing message. I simply forgot to change the subject
line.

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



[PHP] Re: New/changing subject... was [PHP] Re: PEAR mail

2004-11-08 Thread Matthew Weier O'Phinney
* Jim Wharton [EMAIL PROTECTED]:
 Ben Ramsey said:
 
  Is this somehow related to the PEAR mail thread? I don't see the
  connection. I think you're trying to ask a new question. When doing
  so, please don't reply to an existing message in an existing thread
  (even if you change the subject) because you're new question will
  become a part of the old thread. ALWAYS start a brand new message; a
  descriptive subject is also helpful. You'll get a better response
  and more help this way.
 
  Thanks!

 Yeah, sorry, I am aware of that. I wasn't sure of the list's address,
 so I replied to an existing message. I simply forgot to change the
 subject line.

Actually, you *did* change the subject. Read what was said in that
paragraph: 

[P]lease don't reply to an existing message in an existing thread
(even if you change the subject) because you're new question will
become a part of the old thread.

If you use a threaded mail/news reader, as many people do, your messages
will be grouped based on the original topic sent:

timestamp sender subject
---
10:00amPEAR Mail
10:05am - Re: PEAR Mail
10:07am- Re: PEAR Mail
10:06am - Something about something else
10:08am - Re: PEAR Mail

What's more, such readers also have the ability to 'collapse' threads
and show message counts -- so you can visually save space in your box,
and see if certain threads have received new messages. So it's rather
frustrating to open up a thread on PEAR Mail and discover something
about PHP's drawing functions inside it.

If you want to start a new thread, but don't know the list address...
Look at another post's To: or CC: headers; you'll likely find it there.
Then put that address in your address book so you don't need to look
next time.

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

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



Re: [PHP] Re: New/changing subject... was [PHP] Re: PEAR mail

2004-11-08 Thread Jim Wharton
Matthew Weier O'Phinney said:
snip

 Actually, you *did* change the subject. Read what was said in that
 paragraph:

 [P]lease don't reply to an existing message in an existing thread
 (even if you change the subject) because you're new question will
 become a part of the old thread.

 If you use a threaded mail/news reader, as many people do, your messages
 will be grouped based on the original topic sent:

I'm a mutt user typically. I know this.

 So it's rather
 frustrating to open up a thread on PEAR Mail and discover something
 about PHP's drawing functions inside it.

I'm truly sorry about that. What's even more frustrating is making a
simple mistake and having a bunch of people jump down your throat about
it. Point taken. Apology offered.

I am sorry though. Any more correspondance on this particular issue needs
to be directed to my personal email address - not the list. (That is,
unless, you feel the need to publically teach me a lesson.)

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



Re: [PHP] Re: New/changing subject... was [PHP] Re: PEAR mail

2004-11-08 Thread Greg Donald
On Mon, 8 Nov 2004 12:08:30 -0500 (EST), Jim Wharton
[EMAIL PROTECTED] wrote:
 I'm truly sorry about that. What's even more frustrating is making a
 simple mistake and having a bunch of people jump down your throat about
 it. Point taken. Apology offered.

I just pretend like I'm posting to vger.kernel.org.. seems to keep
most people from yelling at me too much.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



RE: [PHP] Meaningful Subject

2004-10-11 Thread php-list


-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 11, 2004 8:09 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP]

On Monday 11 October 2004 19:41, [EMAIL PROTECTED] wrote:
 Never mind guys, I figured it out. I appreciate your help. Thanks for
 everything!

Next time you start a thread please give it a meaningful subject.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The three best things about going to school are June, July, and August.
*/

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



[no subject]

2004-08-18 Thread Justin Patrin
ek [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
In-Reply-To: [EMAIL PROTECTED]
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
References: [EMAIL PROTECTED]
Subject: Re: [PHP] .thaccess

On Wed, 18 Aug 2004 14:00:10 +0200, V=C3=A1clav Slov=C3=A1=C4=8Dek [EMAIL PROTECTED]
san.net wrote:
=20
 hi,
=20
 i would like to ask what happens when a user is downloading a large file
  from apache server and i modify the .htaccess file affecting the folder
   where is the file beeing downloaded by the user. For example i rewrite
 the list of ips allowed to access the file/folder and i remove the
 user's ip. Will the tranfer be interrupted or not? Is there any other way
 how to interupt the transfer? Thank you for help.
=20

No, it will not be interrupted. The .htaccess is read at the
*beginning* of a request only.

--=20
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



[PHP] no subject

2004-08-09 Thread hino masako
@lists.php.net

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



[PHP] Passing array as subject to preg_replace has odd behaviour with limit

2004-04-05 Thread Leon Derczynski
Hi everybody,

I'm sure this has been mentioned hundreds of times before, but why is 
preg_replace apparently ignoreing my limit when I pass it an array of text 
to work on (with just one string each for pattern and replacement)? Is it 
only obeying per element of the subject? If so, is there a way to correct 
this unwanted behaviour, maybe through setting a constant or something?

Cheers!

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[no subject]

2004-03-30 Thread Ketvin
Dear all,


i just move my previous php script to a new server and found that it is not working on 
the new machine. funny thing is that previously, say i am putting form items like 

input type=text name=item1 

in the form page, and then i can striaghtaway read the item1 value by using $item1 
variable. but now, reading $item1 give me nothing. 

is there anything i have to set in the php.ini ? or any packages i miss? 
 
I am using php-4.2.2 for both my new/old machine, and following is the packages i 
installed.

php-ldap-4.2.2-17.2.i386.rpm
php-4.2.2-17.2.i386.rpm
php-mysql-4.2.2-17.2.i386.rpm
php-imap-4.2.2-17.2.i386.rpm

thanks for your time and please help!




* Confidentiality Notice ** 
This message contains confidential information and is intended only for 
the individual named.  If you are not the named addressee you should 
not disseminate, distribute or copy this e-mail.  Please notify the 
sender immediately by e-mail if you have received this e-mail by 
mistake and delete this e-mail from your system.
*



[PHP] $REMOTE_HOST in email subject

2004-02-15 Thread Birkholz, James
Is there something obviously wrong with this code?  

mail([EMAIL PROTECTED],[EMAIL PROTECTED],'[FLAG] Info edited: '.$theInfo.' by
'.$REMOTE_HOST, 'From: '.$emailAdmin.\r\n);

I'm trying to show the IP of the person who just edited some info, in the
email that I send myself whenever info is edited. Everything works, but the
IP address is empty.

TIA,
James

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



Re: [PHP] $REMOTE_HOST in email subject

2004-02-15 Thread Adam Bregenzer
On Sun, 2004-02-15 at 19:03, Birkholz, James wrote:
 mail([EMAIL PROTECTED],[EMAIL PROTECTED],'[FLAG] Info edited: '.$theInfo.' by
 '.$REMOTE_HOST, 'From: '.$emailAdmin.\r\n);

Try $_SERVER['REMOTE_HOST']

Also, if apache is not configured with HostnameLookups On this won't be
set.  You can get the IP from: $_SERVER['REMOTE_ADDR']

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

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



RE: [PHP] $REMOTE_HOST in email subject

2004-02-15 Thread Birkholz, James
You're right, the addr is what I really want, and
_SERVER[REMOTE_ADDR] works, but when I tried the _SERVER[REMOTE_HOST],
it is still empty, so my web host must HostnameLookups OFF. Problem solved,
and thanks to all!

James


 -Original Message-
 From: [EMAIL PROTECTED]
 [SMTP:[EMAIL PROTECTED]
 Sent: Sunday, February 15, 2004 6:25 PM
 To:   Birkholz, James
 Subject:  Re: [PHP] $REMOTE_HOST in email subject
 
 the environment variable REMOTE_HOST is the hostname, not the 
 IPnumber REMOTE_ADDR is the IPnumber.
 
 separately, your problem may be that with current versions of PHP 
 that syntax is no longer supported (for security reasons).  the 
 correct syntax is:
 
_SERVER[REMOTE_ADDR]
 

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



[PHP] Subject: searching for open source php module

2003-12-15 Thread matt shultz

hi,
i am looking for an open source php module that does some simple content 
management.   it seems that something like this must exists, since it is a 
pretty common need, but i'm not sure where to find such a thing.  here is 
a description of the functionality i am looking for: ability to update 
many page withing a website with content unique to each, hopefully with 
versioning for each of these pages (so that previous versions can be 
referenced or reverted to). in my thinking, each page is just a single 
text field that the updater fills in on the backend of the site.  it also 
would be usefull if the module took care of paragraph breaks without 
makeing the user type in html.  as you can see, this is a very very simple 
module, and i would just write it myself except that it seems like someone 
may have already done so.  let me know where to look (or for something 
similar, since i can easily mod anything that's out there), and also if 
there is a good resource for open source php projects of this type.


m.

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



[PHP] Off the subject I need help...

2003-08-20 Thread Payne
Hi,

I need help in finding a Microsoft SQL mailing list. I have a project that is becoming a 
nightmare because I have to port a SQL2000 to MySQL, then take site that is written in asp
and re-write them in php. So if anyone is on a SQL2000 or MS SQL mailing can you please send
a link. Thanks.

Chuck Payne

PS. No flames guys my life is in hell as it is because of asp and MS SQL.





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


[PHP] Re: Off the subject I need help...

2003-08-20 Thread DvDmanDT
Consider using news servers...news://msnews.microsoft.com... There are lots
of groups there about sqlserver which I guess is what you're after, or are
sqlserver and mssql different things?

Can't you like select * where 1 to some file and then import to MySQL?
-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]
Payne [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
 Hi,

 I need help in finding a Microsoft SQL mailing list. I have a project that
is becoming a
 nightmare because I have to port a SQL2000 to MySQL, then take site that
is written in asp
 and re-write them in php. So if anyone is on a SQL2000 or MS SQL mailing
can you please send
 a link. Thanks.

 Chuck Payne

 PS. No flames guys my life is in hell as it is because of asp and MS SQL.








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



RE: [PHP] Off the subject I need help...

2003-08-20 Thread Chris W. Parker
Payne mailto:[EMAIL PROTECTED]
on Wednesday, August 20, 2003 10:53 AM said:

 I need help in finding a Microsoft SQL mailing list. I have a project
 that is becoming a nightmare because I have to port a SQL2000 to
 MySQL, then take site that is written in asp and re-write them in
 php. So if anyone is on a SQL2000 or MS SQL mailing can you please
 send a link. Thanks. 

http://www.sunbelt-software.com/forums/

You should be able to find a good mailing list on this page.


hth
Chris.\

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



[PHP] Oops, sessions. I need to study the subject

2003-06-26 Thread Øystein Håland
 if(isset($_POST['users'])
 {
 $_SESSION['temp_users'] = $_POST['users'];
 }
 if (ereg(\t, $_SESSION['temp_users'][0]) == true) $separator = \t;
 ...etc

 hope it helps
 Pete

Will take a look at function.serialize too. Thank you guys



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



[PHP] [mysq] help with displaying table {off Subject}

2003-03-03 Thread Karl James
hey guys im trying to figure out why the browse 
link wont work in mysql is there anything 
special to edit so that i can view the tables so 
i can edit them and add value




ultimatefootballleague.com/index.php
[EMAIL PROTECTED]
 



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



Re: [PHP] [mysq] help with displaying table {off Subject}

2003-03-03 Thread Petre Agenbag
I presume you are talking about phpMyAdmin here.

The Browse link only works when there are entries in the tables, ie., it
won't work on empty table.
You must first insert data into the tables, and for that you uise the
INSERT link.
You can change the tables by using the PROPERTIES link.


On Tue, 2003-03-04 at 09:18, Karl James wrote:
 hey guys im trying to figure out why the browse 
 link wont work in mysql is there anything 
 special to edit so that i can view the tables so 
 i can edit them and add value
 
 
 
 
 ultimatefootballleague.com/index.php
 [EMAIL PROTECTED]
  
 
 
 
 -- 
 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] [mysql]help with displaying table {off subject}#2

2003-03-03 Thread Karl James
Title: Message



hey guys 

just wanted to know as usual it was user 
error
i had thought i had something stored in the 
tables 
but apparently i did not.

i apologize for 
the noobie question.

thanks

special thanks 
to jason.

ultimatefootballleague.com/index.php
[EMAIL PROTECTED]



[PHP] FW: [mysql]help with displaying table {off subject}#3

2003-03-03 Thread Karl James
Sorry about the html.
I forgot to turn it off..


ultimatefootballleague.com/index.php
[EMAIL PROTECTED]
 
-Original Message-
From: Karl James [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 04, 2003 2:29 AM
To: '[EMAIL PROTECTED]'
Subject: [mysql]help with displaying table {off subject}#2


hey guys 
just wanted to know as usual it was user error
i had thought i had something stored in the tables 
but apparently i did not.

i apologize for the noobie question.

thanks

special thanks to jason.
ultimatefootballleague.com/index.php
[EMAIL PROTECTED]
 



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



[PHP] No Subject

2002-12-17 Thread Peter Trotman




 

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




  1   2   >