|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help
lists.php.net
Date: Wed Oct 31 2007 - 23:48:56 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 1 Nov 2007 04:48:56 -0000 Issue 5103
Topics (messages 263875 through 263905):
Re: Reaching the PHP mailing list owners
263875 by: Daniel Brown
263880 by: Daniel Brown
263882 by: Jay Blanchard
263883 by: John Moss
263884 by: Jay Blanchard
263885 by: Jay Blanchard
263894 by: John Moss
263902 by: Alan Milnes
Re: Not Null?
263876 by: Zoltán Németh
263878 by: Daniel Brown
Multiple results in regex
263877 by: Philip Thompson
Re: Multiple results in regex [SOLVED]
263879 by: Philip Thompson
Re: PHP installation
263881 by: Richard Heyes
Pass Windows credentials
263886 by: Simone Nanni
263887 by: Daniel Brown
263888 by: Jay Blanchard
263890 by: Dan Shirah
APACHE MOD_REWRITE
263889 by: Alberto García Gómez
263891 by: Daniel Brown
PHP standard vs. Zend Core
263892 by: Anders Norrbring
263893 by: Daniel Brown
Email question
263895 by: Jake
263896 by: Andrew Ballard
263897 by: Dan Shirah
263901 by: M. Sokolewicz
263903 by: Jake
MIME email = Content-ID in CSS not supported
263898 by: Martin Zvarík
263899 by: Colin Guthrie
263900 by: Colin Guthrie
PHP 5.2 and MySQL
263904 by: Bruce Cowin
Help with OOPHP
263905 by: Andrew Peterson
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
On 10/31/07, John Moss <jbmoss
addr1.com> wrote:
> Hi ~ is there a 'best way' to address a list, like 'Hi everyone'?
It's all personal preference, really. Although you may wish to
refrain from "Yo, $#
%
#%!!!!"
> I am certainly not advertising anything. The site in question belongs to a
> volunteer fire department (http://www.mhfd32.com/index.php), and I am
> donating my time trying to create a comparable page for my own volunteer
> fire department. What I'm trying to accomplish for myself is the speed
> which is evident in loading the centerpieces as you click on the bulleted
> items, left center.
I didn't happen to notice the bulleted items you mentioned. However,
if you check http://www.mhfd32.com/header.php you'll see that they're
using a single header, which the browser caches, and allows for a
quicker page load, if that's what you were curious about. That's done
just by designing the header like they've done, and then just doing an
<? include('header.php'); ?> - or whatever your header file is named -
prior to displaying the rest of the page.
> A list-related question: I signed up for getting my messages all together
> once a day - how do I change this request? I run afoul of the mail protocols
> and had a deuce of a time just getting this far? If you are replying to me
> in the list - sigh - I cannot see it yet. If ever :-(
If you're unable to simply modify your preferences, you could
unsubscribe and re-subscribe at the
http://www.php.net/mailing-lists.php link I sent you earlier, with
"Normal" selected instead of "Digest" when you re-subscribe. And also
be sure to hit "Reply All" instead of simply "Reply" when sending
messages to the list.
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
Give a man a fish, he'll eat for a day. Then you'll find out he was
allergic and is hospitalized. See? No good deed goes unpunished....
attached mail follows:
Let's fix this issue first so that you can start a regular list
thread on here and we can keep things in order on the list and in the
archives for future web searchers as well.
On 10/31/07, John Moss <jbmoss
addr1.com> wrote:
> Daniel ~ I got your message, and wonder how to 'modify my preferences'? I
> know you suggested I could unsubscribe and re-subscribe at the
> http://www.php.net/mailing-lists.php link - is there a faster (better) way?
> Thank you.
There should be a better way, yes, in using
php-general-help
lists.php.net. However, my wonder is if the messages
that PHP's ezmlm attempted to send you are stuck in your SPAM trap,
since the ezmlm robot can't confirm itself and type in the CAPTCHA
code required. Check in there first and see if there's anything you
need to confirm, and also be sure to allow all messages from all
addresses you expect to reply to yours to be allowed to do so without
question.
Again, you may want to set up a separate email account just for
the list. I can send you over a Gmail invite if you'd like one and
you can even use it as another POP3/IMAP account, if that's how you
currently get your mail.
I'm not sure if Gmail invites are necessary anymore (I know there
was an SMS alternative a while back), but I still have a bunch left.
So that offer stands for anyone else who may want a Gmail account and
hasn't yet been able to get one. ;-P
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
Give a man a fish, he'll eat for a day. Then you'll find out he was
allergic and is hospitalized. See? No good deed goes unpunished....
attached mail follows:
[snip]
On 10/31/07, Robert Cummings <robert
interjinn.com> wrote:
> On Wed, 2007-10-31 at 11:19 -0400, Daniel Brown wrote:
> > On 10/31/07, Jason Pruim <japruim
raoset.com> wrote:
> > > On Oct 31, 2007, at 10:07 AM, Daniel Brown wrote:
> > > > On 10/31/07, Robert Cummings <robert
interjinn.com> wrote:
> > > >> The traffic here isn't overwhelming, maybe 10 to 50 emails a
day.
> > > >
> > > > With the exception of the occasional rant. ;-P
> > >
> > > We have rants? We should get some RAID and take care of them, or
at
> > > least report the bugs to the owners I hear they have a nice site
setup
> > > for reporting such bugs :)
> >
> > Reporting the bugs is probably your best bet, because getting
RAID
> > for the rants crawling around on the list would require several
> > terabytes of 0+1 striping, I'm sure. And I haven't seen a can large
> > enough to spray that on the shelves of my local Wal-Mart yet.
>
> I've got rants in my pants. They itch a lot. Can you send me a small
can
> of RAID? Though I'm not sure I want any striping in my undies :/
>
> Cheers,
> Rob.
> --
> ...........................................................
> SwarmBuy.com - http://www.swarmbuy.com
>
> Leveraging the buying power of the masses!
> ...........................................................
>
You may be able to get away with RAID/5 for your personal debugging,
Rob.
[/snip]
And if the personal debugging does not work certain parts are
hot-swappable.
attached mail follows:
Thanks, Daniel, Robert and David ~
I'm struggling to maintain protocol here and I appreciate some of you
mailing me privately. I would prefer to respond and use the list - but I'm
still signed up for once-a-day delivery and have no idea how to change this
option - yet. :-)
I am VERY computer literate, and VERY message-oriented ILLITERATE. I have
coded HTML for years, and although not a fancy programmer I think my pages
are OK. Could be better, but OK. (http://www.miscelpage.com,
http://www.boundarycountyfire.com, http://www.curleycreek.com,
http://www.theonlinewriter.com, etc. etc., etc)
PHP is new to me, and this page - http://www.mhfd32.com/index.php - seems to
fly when loading fresh pages. For example, select 'Apparatus' from the Menu
Options and watch how fast the center of the page loads...
I know about bandwidth and server speed and latency and
hardware/connectivity considerations. I suspect the programmer
implementation of php functionality is the answer to my perceptions. Hence
my dire need to understand how php can help me... :-) Like - what is a
'header'? Everything prior to the <body> statement? I don't think that's
what is meant...
John B. Moss
Daniel ~ I got your message, and wonder how to 'modify my preferences'? I
know you suggested I could unsubscribe and re-subscribe at the
http://www.php.net/mailing-lists.php link - is there a faster (better) way?
Thank you.
-----Original Message-----
From: Daniel Brown [mailto:parasane
gmail.com]
Sent: Wednesday, October 31, 2007 8:16 AM
To: Robert Cummings
Cc: John Moss; php-general
lists.php.net
Subject: Re: [PHP] RE: Reaching the PHP mailing list owners
On 10/31/07, Robert Cummings <robert
interjinn.com> wrote:
> On Wed, 2007-10-31 at 07:29 -0700, John Moss wrote:
> > Thank you, Daniel Brown, Richard Buskirk, Robert Cummings, David
> > Giragosian ~ and anyone else who may have jumped in to my message
> > within the last minute or two, trying to help me.
No problem!
> > I realize that I
> > might not be permitted to show a page (provide a URL) as an
> > illustration of my point - I am certainly not advertising anything.
> > The site in question belongs to a volunteer fire department, and I
> > am donating my time trying to create a comparable page for my own
volunteer fire department.
You're not only allowed to post links, but you're encouraged to do so,
especially if there's a problem or error message that we should be able to
see to help you to debug the issue. So feel free to post links to examples,
so long as it's not SPAM'ing the hell out of the list for penis pills and
the like. I'm sure you'll find more than one (myself included) volunteer
firefighters, EMTs, and rescuers on here, in fact.
> PHP is merely an interpreter. The speed of any page to load in a
> browser depends on a number of factors. Four of the most important
> factors are the following:
>
> 1. what is being loaded? How much programming is necessary to
> achieve the outcome.
>
> 2. How fast is the server hardware that handles the processing.
>
> 3. How good is the connection to the remote server. This includes
> both bandwidth and latency (latency being the round trip time
> to make a request of any kind for the server).
>
> 4. How well did the programmer implement the functionality
> needed. It's one thing to have a heavy load of processing,
> it's another to use bad algorthms that bog down the server.
Adding to Rob's points, it should be expanded on Point #3 that traffic
will also be a major factor in the available bandwidth and latency. And to
further the latency point, the "round-trip" time will usually take longer,
logically, if your server is across the country than, say, in your home
county. So the site you'd like to mimic may be hosted nearer to you than
the physical machine hosting your department's current website. Keep in
mind that, for locally-oriented websites, it's best to host as local as
possible, since that's from where the vast majority of your traffic will
originate. Finally on that point, browser processing speeds (due to local
CPU/RAM/other
constraints) may have either a positive or negative impact on the
experience.
Expanding Point #1, keep in mind that graphic- and media-intensive
websites (including Flash) will no doubt take longer to fully load.
Lastly, expanding on Point #4, not only does it depend on how well the
underlying code was written, but also how much pre-processing is required of
PHP (or whatever server-side dynamic language is being
used) for each time the page is requested. If there is caching in place, or
functions and routines are only called when absolutely necessary.
--------------------------------------------
My mailbox is spam-free with ChoiceMail, the leader in personal and corporate anti-spam solutions. Download your free copy of ChoiceMail from www.digiportal.com
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
Give a man a fish, he'll eat for a day. Then you'll find out he was
allergic and is hospitalized. See? No good deed goes unpunished....
attached mail follows:
[snip]
Hi ~ is there a 'best way' to address a list, like 'Hi everyone'?
[/snip]
'Your royal highnesses' or 'Gurus and Gurettes'
[snip]
As said in a previous message I have many web sites, and lately have run
aground trying to determine how php is able to load related site pages
so
quickly? Is it OK to provide a URL as an illustration of my point - I am
certainly not advertising anything. The site in question belongs to a
volunteer fire department (http://www.mhfd32.com/index.php), and I am
donating my time trying to create a comparable page for my own volunteer
fire department. What I'm trying to accomplish for myself is the speed
which is evident in loading the centerpieces as you click on the
bulleted
items, left center.
[/snip]
Looks like they are using a basic template with a header, footer and
body. Since the header and footer are cached thy load much more quickly.
attached mail follows:
[snip]
Like - what is a
'header'? Everything prior to the <body> statement? I don't think that's
what is meant...
[/snip]
A header/footer is a separate HTML/PHP page that is included with the
page call;
<?php
include("header.html");
....do stuff in the body....
include("footer.html");
?>
All you have to do is create the header and/or footer and include them
with each page. Since the content is typically static in these included
files they are cached and therefore loaded from cache each time they are
called making things very quick.
This is your very first step in creating reusable components for your
web applications. You can see that this will become a very powerful
tool/technique.
attached mail follows:
Thanks Jay, I'll try it.
I know how to include, but haven't seen any php code yet except what you've
illustrated. Now I have the concept and will do some testing. I appreciate
this list being available to ask specific php questions - and I thank you
for your time and help.
Much appreciated -
~ John
PS. I unsubscribed and resubscribed so as to get individual responses. Am
now definitely getting more mail than I know what to do with - :-)
-----Original Message-----
From: Jay Blanchard [mailto:jblanchard
pocket.com]
Sent: Wednesday, October 31, 2007 10:12 AM
To: John Moss; Daniel Brown; Robert Cummings
Cc: php-general
lists.php.net
Subject: RE: [PHP] RE: Reaching the PHP mailing list owners
[snip]
Like - what is a
'header'? Everything prior to the <body> statement? I don't think that's
what is meant...
[/snip]
A header/footer is a separate HTML/PHP page that is included with the page
call;
<?php
include("header.html");
....do stuff in the body....
include("footer.html");
?>
All you have to do is create the header and/or footer and include them with
each page. Since the content is typically static in these included files
they are cached and therefore loaded from cache each time they are called
making things very quick.
This is your very first step in creating reusable components for your web
applications. You can see that this will become a very powerful
tool/technique.
--------------------------------------------
My mailbox is spam-free with ChoiceMail, the leader in personal and corporate anti-spam solutions. Download your free copy of ChoiceMail from www.digiportal.com
attached mail follows:
> I am VERY computer literate, and VERY message-oriented ILLITERATE. I have
> coded HTML for years, and although not a fancy programmer I think my pages
> are OK. Could be better, but OK. (http://www.miscelpage.com,
> http://www.boundarycountyfire.com, http://www.curleycreek.com,
> http://www.theonlinewriter.com, etc. etc., etc)
One thing to watch - it's not strictly a PHP problem but it may
influence the speed of your pages - is that your pages aren't valid
html, see the results from the validator below:-
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.boundarycountyfire.com&charset=%28detect+automatically%29&doctype=Inline&group=0
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.miscelpage.com&charset=%28detect+automatically%29&doctype=Inline&group=0
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.theonlinewriter.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0
Best to get these fixed before you go much further.
Cheers
Alan
attached mail follows:
2007. 10. 31, szerda keltezéssel 10.48-kor Steve Marquez ezt Ãrta:
> Greetings,
>
> I have a script that looks for the variable to be NULL and then execute. Is
> there a way for the script to look for anything or something in the variable
> and then execute?
>
> Ex:
>
> If (Œ$a¹ == Œ ANYTHING¹) {
>
> some action
>
> }else{
>
> some other action
>
> }
try isset($a)
greets
Zoltán Németh
>
> Thank you for any help.
>
> --
> Steve M.
attached mail follows:
On 10/31/07, Robin Vickery <robinv
gmail.com> wrote:
> On 31/10/2007, Steve Marquez <smarquez
marquez-design.com> wrote:
> > Greetings,
> >
> > I have a script that looks for the variable to be NULL and then execute. Is
> > there a way for the script to look for anything or something in the variable
> > and then execute?
> >
> > Ex:
> >
> > If (Œ$a¹ == Œ ANYTHING¹) {
>
> oh dear, krazee quotes... at least I presume that's what those wierd
> characters are.
>
> Look in the manual for isset() (http://www.php.net/isset) and empty()
> (http://www.php.net/empty).
>
> -robin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Robin, I think you hit it exactly on the head with the quote issue.
Steve, use regular single or double quotes, not any kind of fancy
quotes or backticks. It may be the editor you're using: if you use
Microsoft Word or another similar word processor, it may replace the
quotes with something it things is "prettier". If you're using
Windows, use notepad, `edit.com` from the command line, or download
any IDE you'd like - many or which are free and open source, and even
handle PHP specifically.
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
Give a man a fish, he'll eat for a day. Then you'll find out he was
allergic and is hospitalized. See? No good deed goes unpunished....
attached mail follows:
Hi.
I have a string that has multiple references to images in it. I want to pull
each reference out using regex. I've gotten to where I can pull the first
instance out, but not ALL of them. I know each image source starts with
'images/'. I have this so far....
<?php
$pattern = '/[\'\"](images\/[a-z0-9\/\-\_\.]+)[\'\"]/i';
preg_match ($pattern, $string, $matches);
?>
// For example, returns...
Array
(
[0] => "images/some/location/some-image.jpg"
[1] => images/some/location/some-image.jpg
)
This pulls the first instance, but none of the others. I think what the
issue is... is that I am stopping after I get the first one, but I don't
know how to grab the rest. Please help!!
Thanks in advance,
~Philip
attached mail follows:
On 10/31/07, Philip Thompson <philthathril
gmail.com> wrote:
>
> Hi.
>
> I have a string that has multiple references to images in it. I want to
> pull each reference out using regex. I've gotten to where I can pull the
> first instance out, but not ALL of them. I know each image source starts
> with 'images/'. I have this so far....
>
> <?php
> $pattern = '/[\'\"](images\/[a-z0-9\/\-\_\.]+)[\'\"]/i';
> preg_match ($pattern, $string, $matches);
> ?>
>
> // For example, returns...
> Array
> (
> [0] => "images/some/location/some-image.jpg"
> [1] => images/ some/location/some-image.jpg
> )
>
> This pulls the first instance, but none of the others. I think what the
> issue is... is that I am stopping after I get the first one, but I don't
> know how to grab the rest. Please help!!
>
> Thanks in advance,
> ~Philip
>
Ummmm nevermind.... brainfart.
preg_match_all()
Cheers,
~Philip
attached mail follows:
...
Thanks for the help. I've got it installed now. In the end I found that
the server came with 5.1.6 installed (:/), which despite not being
5.2.x, is still a jump from the 5.0.x I had before.
--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk
Knowledge Base and HelpDesk software
that can cut the cost of online support
attached mail follows:
Hi everybody,
i'm trying to do an hard stuff.....
I want to create a PHP page where users can authenticate themselves passing their Windows (XP or 2000) logon credentials trasparently.
So, if i've made logon on my workstation with "username" and "password" i want to catch them and reuse to give them access.
This stuff will run on a Linux Slackware box with Apache 2.2.4 - PHP 5.2.4 and Samba 3.0.26a
Somebody can help me?!
Thanx a lot!
Simone Nanni
ICT Technician
A.O.U. Policlinico Tor Vergata
Viale Oxford, 81
00133 - Roma - RM - Italy
attached mail follows:
On 10/31/07, Simone Nanni <simone.nanni
ptvonline.it> wrote:
> Hi everybody,
> i'm trying to do an hard stuff.....
> I want to create a PHP page where users can authenticate themselves passing their Windows (XP or 2000) logon credentials trasparently.
> So, if i've made logon on my workstation with "username" and "password" i want to catch them and reuse to give them access.
>
> This stuff will run on a Linux Slackware box with Apache 2.2.4 - PHP 5.2.4 and Samba 3.0.26a
>
> Somebody can help me?!
> Thanx a lot!
>
> Simone Nanni
> ICT Technician
> A.O.U. Policlinico Tor Vergata
> Viale Oxford, 81
> 00133 - Roma - RM - Italy
Simone,
I believe Dan Shirah from the list did something like this a while
back. If you search the archives for his name, you should find some
threads that will help you out.
<hint>Maybe he'll even chime into this discussion.</hint>
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
Give a man a fish, he'll eat for a day. Then you'll find out he was
allergic and is hospitalized. See? No good deed goes unpunished....
attached mail follows:
[snip]
i'm trying to do an hard stuff.....
I want to create a PHP page where users can authenticate themselves
passing their Windows (XP or 2000) logon credentials trasparently.
So, if i've made logon on my workstation with "username" and "password"
i want to catch them and reuse to give them access.
This stuff will run on a Linux Slackware box with Apache 2.2.4 - PHP
5.2.4 and Samba 3.0.26a
[/snip]
The Holy Grail - Single sign on!
I have researched this for ages. While ASP has a way for you to capture
this PHP does not...at least not in any way that I have found. I have
looked at using JavaScript and several other methods but have not been
successful. It sure would make life much easier.
attached mail follows:
The server variable AUTH_USER contains the windows login name. If I rememebr
correctly, within IIS you need to have your website setup for windows
authentication. Otherwise you will only be pull the Anonymous access name
for your server.
I haven't worked much on Linux, so I don't know if there is an option to use
Windows Authentication or not.
You can echo it out like this:
<?php echo $_SERVER['AUTH_USER']; ?>
Hope that helps.
On 10/31/07, Simone Nanni <simone.nanni
ptvonline.it> wrote:
>
> Hi everybody,
> i'm trying to do an hard stuff.....
> I want to create a PHP page where users can authenticate themselves
> passing their Windows (XP or 2000) logon credentials trasparently.
> So, if i've made logon on my workstation with "username" and "password" i
> want to catch them and reuse to give them access.
>
> This stuff will run on a Linux Slackware box with Apache 2.2.4 - PHP 5.2.4and Samba
> 3.0.26a
>
> Somebody can help me?!
> Thanx a lot!
>
> Simone Nanni
> ICT Technician
> A.O.U. Policlinico Tor Vergata
> Viale Oxford, 81
> 00133 - Roma - RM - Italy
attached mail follows:
I have this URL
http://www.myserver.com/dir1/dir2/page.html
and I wish to rewrite the url using mod_rewrite to add a ~ after the first
dir always, eg.:
http://www.myserver.com/~dir1/dir2/page.html
Please it's very important to make this ASAP
best regards
Este correo ha sido enviado desde el Politécnico de Informática "Carlos Marx" de Matanzas.
"La gran batalla se librará en el campo de las ideas"
attached mail follows:
On 10/31/07, Alberto García Gómez <alberto
ipimtzcm.rimed.cu> wrote:
> I have this URL
>
> http://www.myserver.com/dir1/dir2/page.html
>
> and I wish to rewrite the url using mod_rewrite to add a ~ after the first
> dir always, eg.:
>
> http://www.myserver.com/~dir1/dir2/page.html
>
> Please it's very important to make this ASAP
Then it's very important to ask the question on the right list ASAP.
Apache mailing lists: http://httpd.apache.org/lists.html
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
Give a man a fish, he'll eat for a day. Then you'll find out he was
allergic and is hospitalized. See? No good deed goes unpunished....
attached mail follows:
I'm a bit curious about what the general differences are from the
applications point of view, and in consequence with that, the users,
between running the standard PHP 5.2.4 distribution and the Zend Core
2.5 distribution?
Any special pros and cons on each distribution?
Anders.
attached mail follows:
On 10/31/07, Anders Norrbring <lists
norrbring.se> wrote:
> I'm a bit curious about what the general differences are from the
> applications point of view, and in consequence with that, the users,
> between running the standard PHP 5.2.4 distribution and the Zend Core
> 2.5 distribution?
>
> Any special pros and cons on each distribution?
>
> Anders.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
This won't give you pros and cons like you specifically mentioned,
but it's worth a read if you haven't already seen it.
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0502nickolas/index.html
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
Give a man a fish, he'll eat for a day. Then you'll find out he was
allergic and is hospitalized. See? No good deed goes unpunished....
attached mail follows:
What is a =20 at the end of a line in an email? Is it some kind of whitespace line return or something? it only seems to appear when there is whitespace that is linewrapping. I have googled and googled for it, but havn't found anything yet. here's my function...
buffer is a complete correctly formatted email from any standard client.
In most of my tests, everything works fine, but a test with many spaces trying to wrap them, it gives a =20 in the email result.
It's probably simple.. sitting here too long and its halloween!!!!!!
Thanks,
Jake
function parseEmail($buffer)
{
$pattern1 = '/^From: \"(.*)\" <(.*)\
(.*)\.(.*)>/';
$pattern2 = '/^From: (.*)\
(.*)\.(.*)/';
$pattern3 = '/^Subject: (.*)/';
$pattern4 = 'Content-Type: text/plain;';
$pattern5 = 'Content-Type: text/html;';
$temp = explode("\n", $buffer);
foreach($temp as $key => $value)
{
if (preg_match($pattern1, $value, $match))
{
$from = "\"$match[1]\" <$match[2]
$match[3].$match[4]>";
}
else if (preg_match($pattern2, $value, $match))
{
$from = "\"\" <$match[1]
$match[2].$match[3]>";
}
if (preg_match($pattern3, $value, $match))
{
$subject = $match[1];
}
if ($pos = strpos($value, $pattern4) !== false)
{
$begin = $key;
}
if ($pos = strpos($value, $pattern5) !== false)
{
$end = $key - 1;
}
}
if (!isset($end))
{
$end = count($temp) - 1;
}
$data = "Below is the email you sent to consolidators
nittanytravel.com:\n\n";
$start = 'false';
while($begin < $end)
{
if ($start == 'false')
{
if (empty($temp[$begin]))
{
$start = 'true';
}
}
else
{
$data .= chop($temp[$begin]) . "\n";
}
$begin++;
}
return "$from|$subject|$data";
}
attached mail follows:
On 10/31/07, Jake <linux
nittanytravel.com> wrote:
> What is a =20 at the end of a line in an email?
It is a space character when the message is encoded using
quoted-printable encoding.
Andrew
attached mail follows:
Couldn't you just use the wordwrap function? Something like this:
$my_text = "This is a story all about how my life got flipped turned upside
down. I'd like to take a minute just sit right there, I'll tell you how I
became the Prince of a town called Belaire."
$my_wrapped_text = wordwrap($my_text, 60, "<br />\n");
So, you can create a new variable, then user the word wrap function, inside
the function pass it the variable that contains your unaltered text, then
tell it how long the maximum line length should be, put in a page break and
the new line operator and you should be good to go.
Your message is formatted to wrap at whatever length you desire.
Hope that helps.
On 10/31/07, Andrew Ballard <aballard
gmail.com> wrote:
>
> On 10/31/07, Jake <linux
nittanytravel.com> wrote:
> > What is a =20 at the end of a line in an email?
>
> It is a space character when the message is encoded using
> quoted-printable encoding.
>
> Andrew
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Jake wrote:
> while($begin < $end)
> {
> if ($start == 'false')
> {
> if (empty($temp[$begin]))
> {
> $start = 'true';
> }
> }
> else
> {
> $data .= chop($temp[$begin]) . "\n";
> }
> $begin++;
> }
> return "$from|$subject|$data";
> }
>
You have got to be joking me. You're using STRING COMPARISONS when you
really want to use booleans? Hell, you even call them true and false, so
why not simply USE booleans??? The following cleans that up and makes
your loop actually many times faster, not to mention it properly uses
booleans as.... booleans...
while($begin < $end)
{
if ($start !== true)
{
if (empty($temp[$begin]))
{
$start = true;
}
}
else
{
$data .= chop($temp[$begin]) . "\n";
}
$begin++;
}
return "$from|$subject|$data";
}
I'm not sure what you intended this piece of code to do, but it looks
pretty hackish to me...
attached mail follows:
> Jake wrote:
>> while($begin < $end)
>> {
>> if ($start == 'false')
>> {
>> if (empty($temp[$begin]))
>> {
>> $start = 'true';
>> }
>> }
>> else
>> {
>> $data .= chop($temp[$begin]) . "\n";
>> }
>> $begin++;
>> }
>> return "$from|$subject|$data";
>> }
>>
>
> You have got to be joking me. You're using STRING COMPARISONS when you
> really want to use booleans? Hell, you even call them true and false, so
> why not simply USE booleans??? The following cleans that up and makes your
> loop actually many times faster, not to mention it properly uses booleans
> as.... booleans...
>
> while($begin < $end)
> {
> if ($start !== true)
> {
> if (empty($temp[$begin]))
> {
> $start = true;
> }
> }
> else
> {
> $data .= chop($temp[$begin]) . "\n";
> }
> $begin++;
> }
> return "$from|$subject|$data";
> }
>
> I'm not sure what you intended this piece of code to do, but it looks
> pretty hackish to me...
>
Yea, I changed that already. I'm picking up where someone left off... wasn't
really worried about that at the moment, just the =20, but thanks.
Jake
attached mail follows:
Hello,
I am trying to send MIME type email with in message image
attachments. It works OK when doing
<img src="cid:specialcode">
...but it does not work in this <div
style="background:url(cid:specialcode)">
I am trying to have fading background, is there any way I can achieve
this without using IMG tag?
Thank you,
Martin
attached mail follows:
Martin ZvarÃk wrote:
> Hello,
> I am trying to send MIME type email with in message image attachments.
> It works OK when doing
>
> <img src="cid:specialcode">
>
> ...but it does not work in this <div
> style="background:url(cid:specialcode)">
>
> I am trying to have fading background, is there any way I can achieve
> this without using IMG tag?
I was just looking at exactly this last week. Unfortatly, AFAIK, there
is no way to do this reliably. I'm not even sure *any* of the major
email clients support it :(
Certainly I could not get Thunderbird to do it.
I found this which is some good, general info for using CSS in mime
emails:
http://www.campaignmonitor.com/blog/archives/2006/03/a_guide_to_css_support_in_emai.html
Col
attached mail follows:
Colin Guthrie wrote:
> I found this which is some good, general info for using CSS in mime
> emails:
> http://www.campaignmonitor.com/blog/archives/2006/03/a_guide_to_css_support_in_emai.html
http://www.campaignmonitor.com/blog/archives/2007/04/a_guide_to_css_support_in_emai_2.html
Sorry I originally posted the old email from my browser history....
Col
attached mail follows:
I have just installed PHP 5.2.4 on Windows 2003 machine running IIS.
Everything is fine except when I try to enable the MySQL extension
(either php_mysqli.dll or php_mysql.dll), when I do a php_info(), at the
bottom I get the message
"Error in my_thread_global_end(): 1 threads didn't exit".
All my other extensions (curl, MSSQL, Oracle, etc.) load fine. It's
only when trying to enable this one.
I did a manual install, using the php-5.2.4-Win32.zip. This contains
versions 5.2.4.4 of php_mysql.dll and php_mysqli.dll.
I found a thread where someone said they fixed this by disabling
php_iisfunc in the php.ini, but my php.ini doesn't even have this in
it.
Any ideas?
Thanks.
Regards,
Bruce
attached mail follows:
I'm hoping you guys can help me out.
I'm not sure if you can do this, but i'm trying to create a class
that is build of another class. I also want to be able to do
functions on the class1 from within class2.
example:
class fruitBasket{
private $fuit = array(); //this is a class
public function addFruit($newFruit)
{
$this->fruitBasket[] = $newFruit();
}
public makeAllApples()
{
foreach($this->fruit AS $value)
{
$value->changeName("apple");
}
}
}
class fruit{
private $name;
public __construct($name)
{
$this->name = $name;
}
public changeName($newName)
{
$this->name = $newName;
}
}
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]