php-general Digest 26 Mar 2007 11:17:48 -0000 Issue 4698

Topics (messages 251343 through 251358):

Re: Optimization of all mysql databases on a server
        251343 by: Chris
        251353 by: Tijnema !

Re: Book Suggestion for ZCE
        251344 by: Zoltán Németh

Re: My own "captcha" from 2 years ago......
        251345 by: tedd
        251346 by: tedd
        251350 by: Jake McHenry
        251354 by: Tijnema !

Re: What is wrong with this function please?
        251347 by: Zoltán Németh
        251348 by: Jake McHenry

Re: Important Design Patterns
        251349 by: Travis Doherty

SNMP support on compile from source FastCGI
        251351 by: Matt Arnilo S. Baluyos (Mailing Lists)
        251352 by: Matt Arnilo S. Baluyos (Mailing Lists)

gethostbyname () uses old DNS server
        251355 by: Kent Tong
        251356 by: Stut
        251357 by: Kent Tong

Perl find and replace in PHP
        251358 by: rluckhurst.resmaster.com

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
itoctopus wrote:
The purpose of this script is to optimize all associated tables in all
databases on a mysql server. This script is working great, you can put in a
CRON and run it every day. Feel free to throw in your 2 cents!

It's going to time out if you have any large databases or tables.

Also a much easier option is to run

mysqlcheck -o ...

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

--- End Message ---
--- Begin Message ---
On 3/26/07, Chris <[EMAIL PROTECTED]> wrote:
itoctopus wrote:
> The purpose of this script is to optimize all associated tables in all
> databases on a mysql server. This script is working great, you can put in a
> CRON and run it every day. Feel free to throw in your 2 cents!

It's going to time out if you have any large databases or tables.

What about set_time_limit(999999)??


Also a much easier option is to run

mysqlcheck -o ...

That's true :)

Tijnema

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

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



--- End Message ---
--- Begin Message ---
2007. 03. 24, szombat keltezéssel 14.00-kor itoctopus ezt írta:
> Sams - Zend Php Certification Study Guide for the certification.
> An excellent book on PHP is PHP5 Power Programming (by Prentice Hall).

also a great book about PHP5 is: Advanced PHP Programming (by George
Schlossnagle)

greets
Zoltán Németh

> 
> --
> itoctopus - http://www.itoctopus.com
> ""Danial Rahmanzadeh"" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > hey dudes,
> > i want to know that which books are good to read  before ZCE exam.
> >  I have read php 5 and php 4 study guides and php 4 practice tests. I have
> > also read php|architect's guide to php security and bought a 10 slot
> sample
> > exam. What else do you suggest?
> > cheers,
> > Danial
> >
> 

--- End Message ---
--- Begin Message ---
At 10:49 AM -0400 3/25/07, Jake McHenry wrote:
Do I call the image creation file in an html <img tag? I've tried a bunch of
things, and this is the only way I've been able to display the image inline
so far, without the image headers blocking the rest of my output....

I've been reading and somewhat interested in the audio and pic captchas..
But audio won't work for my intranet... Hardly any of the sets have
speakers... Productivity solution I guess...

Jake

The audio is for visually impaired and unless their also deaf, they have sound turned on.

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

--- End Message ---
--- Begin Message ---
At 5:05 PM +0200 3/25/07, Dotan Cohen wrote:
On 25/03/07, tedd <[EMAIL PROTECTED]> wrote:
What about an audio Captcha?

Your thoughts?

tedd

I do a lot of my browsing at the university library. I can't have any
sound being made there each time I must enter a capcha. Don't use
audio, or provide an alternative.

Dotan Cohen

Dotan:

I understand. There are all sorts of reasons why you want to provide more than just one form of captcha IF you're going to use something like that (sighted, blind, deaf, deaf-blind, dyslexic, and so on). And, there are all sorts of captchas that can be navigated by most.

I was mainly interested in Tijnema's comments regarding sending the key for a captcha and how it could be cracked.

Cheers,

tedd

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

--- End Message ---
--- Begin Message ---
Like I said... Even if they have sound turned on.. Which all my sets do...
Most of them don't have speakers... That was put into effect over a year ago
due to some people listening to those damn screaming prank things at full
volume... Anyways... I was searching the php site, and it said there used to
be a bug that looks somewhat similar to my problem, but it said it was fixed
long ago... Not sure if this is even close to it or not, but this is the
first time I've run into a sessions problem.....

Just to simplify...

I have this on index.php

<?php
session_start();

$before = $_SESSION['code'];

echo '<img src=image.php>';

$after = $_SESSION['code'];

echo $before .' ' . $after;
?>

Then in image.php is my captcha... And where the session variable 'code' is
being created and updated...

In image.php is this:

<?php
session_start();

..........captcha code......
$_SESSION['code'] = rand(blahblahblah) to get the random code
?>


When I view index.php, the image displays, with a new code each time...
Working as it should, but the session variable echos out the previously
generated value, instead of the current value to match whats in the
picture... I'm not sure what I've done... But you can see from
http://nittanytravel.com:8080/    $before and $after have the same value... 

In that bug report I was reading it said that this happened until
session_start was called again.. But it said it was fixed back in php4... 

Not sure what I missed :(

Thanks,
Jake




> -----Original Message-----
> From: tedd [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, March 25, 2007 7:54 PM
> To: Jake McHenry; 'tedd'; [email protected]
> Subject: RE: [PHP] My own "captcha" from 2 years ago......
> 
> At 10:49 AM -0400 3/25/07, Jake McHenry wrote:
> >Do I call the image creation file in an html <img tag? I've 
> tried a bunch of
> >things, and this is the only way I've been able to display 
> the image inline
> >so far, without the image headers blocking the rest of my output....
> >
> >I've been reading and somewhat interested in the audio and 
> pic captchas..
> >But audio won't work for my intranet... Hardly any of the sets have
> >speakers... Productivity solution I guess...
> >
> Jake
> 
> The audio is for visually impaired and unless their also deaf, they 
> have sound turned on.
> 
> 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
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.18/733 - Release 
> Date: 3/25/2007 11:07 AM
>  
> 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.18/733 - Release Date: 3/25/2007
11:07 AM
 

--- End Message ---
--- Begin Message ---
On 3/26/07, Jake McHenry <[EMAIL PROTECTED]> wrote:
Like I said... Even if they have sound turned on.. Which all my sets do...
Most of them don't have speakers... That was put into effect over a year ago
due to some people listening to those damn screaming prank things at full
volume... Anyways... I was searching the php site, and it said there used to
be a bug that looks somewhat similar to my problem, but it said it was fixed
long ago... Not sure if this is even close to it or not, but this is the
first time I've run into a sessions problem.....

Just to simplify...

I have this on index.php

<?php
session_start();

$before = $_SESSION['code'];

echo '<img src=image.php>';

$after = $_SESSION['code'];

echo $before .' ' . $after;
?>

Then in image.php is my captcha... And where the session variable 'code' is
being created and updated...

In image.php is this:

<?php
session_start();

..........captcha code......
$_SESSION['code'] = rand(blahblahblah) to get the random code
?>


When I view index.php, the image displays, with a new code each time...
Working as it should, but the session variable echos out the previously
generated value, instead of the current value to match whats in the
picture... I'm not sure what I've done... But you can see from
http://nittanytravel.com:8080/    $before and $after have the same value...

In that bug report I was reading it said that this happened until
session_start was called again.. But it said it was fixed back in php4...

Not sure what I missed :(

Thanks,
Jake

Did you read my previous post?
I explained why this occurs, as it is normal that a script behaves like this.

I believe the way this script behaves is quite normal. Look at the way
the scripts are called. First index.php, then rnum1.php and then
rnum2.php.
First index.php is called and all session variables are posted with
that action. Then rnum1.php is called, and the session variables are
edited. Then rnum2.php is called, session variables are edited again,
but index.php is never called again, and so the session variables are
never send to the script. Until you load the script again.
So if you're implementing this in a POST form, the browser should
submit both POST and the right session variables to your parse script.

Above is what you missed i think ;)


Example code which works :)

index.php:
<?php

echo "<img src='rnum1.php'>";

echo "<form action='parse.php' method='post'><input name='code'><input
type='submit' value='confirm'></form>";
?>

parse.php:
<?php
session_start();
if($_SESSION['security_code'] == $_POST['code']) {
   echo "Right code entered.";
} else {
   echo "Wrong code entered.";
}
?>

Did you test above code? You could use it like that.


This is btw not a very useful CAPTCHA, because it should stop
computers from submitting data, but a little bit smart programmer
knows that he has to get session information from the image, and
submit that to the form. Or what i saw used lately by a cracker, he
was just using his own values in session and post, and so they matched
:)
So you should never send the same code as the code that has to be
entered. Even encrypting with MD5 only won't stop hackers to defeat
your script. Maybe you could use a database with this, so that you
pass a reference to the real number shown. So that you have an ID and
a CODE column. in rnum1.php you store the code into the database, and
get the ID of the last one inserted (A discussion about this was
around this list lately) Then you show the code in an image, and you
store the ID in the session. Then you get ID from the session, then
get the code from the database using the ID and compare it to the one
entered in the form.

This might be of interest, because cracking should be avoided as
CAPTCHA is meant to stop from autosubmitting by computers.

Tijnema






> -----Original Message-----
> From: tedd [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 25, 2007 7:54 PM
> To: Jake McHenry; 'tedd'; [email protected]
> Subject: RE: [PHP] My own "captcha" from 2 years ago......
>
> At 10:49 AM -0400 3/25/07, Jake McHenry wrote:
> >Do I call the image creation file in an html <img tag? I've
> tried a bunch of
> >things, and this is the only way I've been able to display
> the image inline
> >so far, without the image headers blocking the rest of my output....
> >
> >I've been reading and somewhat interested in the audio and
> pic captchas..
> >But audio won't work for my intranet... Hardly any of the sets have
> >speakers... Productivity solution I guess...
> >
> Jake
>
> The audio is for visually impaired and unless their also deaf, they
> have sound turned on.
>
> 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
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.18/733 - Release
> Date: 3/25/2007 11:07 AM
>
>

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.18/733 - Release Date: 3/25/2007
11:07 AM


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



--- End Message ---
--- Begin Message ---
2007. 03. 25, vasárnap keltezéssel 19.25-kor Robin Wilson ezt írta:
> Thanks for the help
> 
> The line returns are specified as "\r\n" but in the echo they seem to all be 
> on one line. Could that be related to the problem. Also the addresses are 
> specified but seem to have been removed???

\r\n is okay for mail() function, but will not show up in html display
you might consider using nl2br() function before echoing those values
out:
http://www.php.net/manual/en/function.nl2br.php

the addresses might not show up in your browser because they are
enclosed in < and > signs. so the browser tries to interpret them as
html tags, and ignores them as it doesn't know about that kind of tags.
use htmlspecialchars() to avoid this:
http://www.php.net/manual/en/function.htmlspecialchars.php

but that is definitely not the problem with your function, as mail()
expects \n or \r\n to be there...

greets
Zoltán Németh

> 
> This is what I specified:
> $eol="\r\n";
>   $mime_boundary=md5(time());
> 
>   # Common Headers
>   $headers .= 'From: '.$fromName.'<'.$fromaddress.'>'.$eol;
>   $headers .= 'Reply-To: '.$fromName.'<'.$fromaddress.'>'.$eol;
>   $headers .= 'Return-Path: '.$fromName.'<'.$fromaddress.'>'.$eol;    // 
> these two to set reply address
>   $headers .= "Message-ID: <".time()."@".$_SERVER['SERVER_NAME'].">".$eol;
>   $headers .= "X-Mailer: PHP v".phpversion().$eol;          // These two to 
> help avoid spam-filters
> 
> I followed some tutorials and they all seemed to tell me to do it this way.
> 
> The emails seem to work with other clients and only Exchange doesn't like 
> them.
> Tested with Squirrel Mail and they were recieved with the attachment etc.
> 
> Do you have any more ideas please?
> Thanks for the help
> 
> Robin
> 
> ""Jake McHenry"" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> 
> >
> > No sorry, both messages are the same.
> > Didn't mean to post it twice. Sorry.
> >
> > Below is what prints out when I echo the message:
> >
> > $to
> > [EMAIL PROTECTED]
> >
> > $subject
> > Proposal Submission
> >
> > $headers
> > From: 2HostMe Mailer Reply-To: Robin Wilson Return-Path:
> > 2HostMe Mailer
> > Message-ID: X-Mailer: PHP v4.4.2 MIME-Version: 1.0 Content-Type:
> > multipart/related; boundary="d49718178131ebc038c576f007a40642"
> 
> 
> Are these all on the same lines just because of echo? Or are they on their
> own lines? Like this:
> 
> From: 2HostMe Mailer
> Reply-To: Robin Wilson
> Return-Path: 2HostMe Mailer
> Message-ID: X-Mailer: PHP v4.4.2
> MIME-Version: 1.0
> Content-Type: multipart/related; boundary="d49718178131ebc038c576f007a40642"
> 
> 
> From: should have a from email address, same with reply-to and return-path
> 
> 
> >
> > $msg
> > --d49718178131ebc038c576f007a40642 Content-Type: image/gif;
> > name="betaresource.gif" Content-Transfer-Encoding: base64
> > Content-Disposition: attachment; filename="betaresource.gif"
> 
> Same with these, are there any line returns?
> 
> > R0lGODlhWgAeAPcAAAAAAP///25scFNdc1tkc0tcclpibWNpcTtbgi1CWzJIY0
> > BaeyU0RjpRbCw9
> > UUFXci8/UkxbbUpUYGdwe3Z7gRMqQxg1VB5AZh0+YjpWdjhTcjVNaTBGXjRLZS
> > Y3Si1BVzxVcUpn
> > iE1rizpQaTJEWTZJXzlNYzFCVUBUajhGVVJlezdDUGNyglNdaBUvShEmPBo5Wh
> > 9EaiBGbBs7XCFI
> > byNMdCJJcR9CZxw8XSFFaiJHbCNJbiBCZChReiZOdSVLcSBBYR8+XSRHaSJDYy
> > pQdSdKbSVGZiI3
> > TSU6UDtcfSk/VkNliUVkhD9bdyk6TENeekpmgkNbdDxPY1NtiEhedTtNXzhJWk
> > 1ke0theEVXajA9
> > SkJTZE5hdGx+kFxremx2gH6DiBYxSyVNcxo2USlUfB9AXh08WCpWfidQdSJGZh
> > cvRSlTeSpUeh06
> > VB89WRozShkxRyZJaS1VeylOcCpQchkvRC1UeCVFYi1SdTBYfCM/Wi1QcStNbD
> > BUdUVqi0Riflt5
> > lFdzjEZbb1t1jT9OXGJ2iUJPW1dlcoiVoSxagitZgC9gii5dhjNlkTdtmjVqlT
> > RjjDtvmTptljFb
> > fyRDXi9XeTlpkDVhhTlmjCpKZkBulD1lh05yj01rhF55j1NqfWuHnmN8kmmBlU
> > paZ4aaq32PnniI
> > loKPmiVIYj53oz5ym0R8pS5SbUN2nWGFoG6SrVZvgltzhlJndzxLV2V7jJKqvI
> > KVpGx7hoqbqJGg
> > q46bpTFadkuDqoahtHSCjImUnKGstJylq8THyTlQX2KAk1txfcDL0ayxtIadqZ
> > ieobS6vbzFyLe/
> > wcXJyrG2t7i8vJaXl4eIiL/Bv7y+vLW2tbCxsLu8uqusqrq7uMfIwtDQzM3Nyd
> > jY1cTEwo6Ojbe2
> > saSjoMC+uePh3MnGv83KxO7q4+3o4MPAu726teLazujh1+bf1erk2+nj2tzUyd
> > fPxOTc0ezm3uvl
> > 3dTKvszBttHGu/Hs58G1q8e7sb6wp6ubkrKimbipoJSMiKCSjD1MWCH5BAEAAP
> > 8ALAAAAABaAB4A
> > QAj/AB2tGrhKlSRJjxAifMTwkSOHjh4+ajSxIUMEIZZkRICAySYmIENwEuFnkx
> > 8/IkQA4hQolidP
> > xAJNiUUTFpM/OJMwCQGFCRQosP48uVKsmJcBWLhwQZqK1zJ1z04FgwcvSzt11q
> > qhg+fOjbt5o8K4
> > KKFLGjt18MJEWOfu3bx5XsbAuCrNmbR08Gytg7etFidiaKlQMSVuHah26z5lia
> > fuVqF08zZw8OLO
> > HQoTUlBYY6cNW7V6927J+tTIoCZLu/qwGuKmjes2rd+MmR1mjNgKuHPjfuGidx
> > gcZSi5SUMcxxgL
> > bcy4Ud4GiYfnThykmDWrhJQqVkhwSKCkBAgO4Dl0/zChwIQgLIIIaXES3QEJOp
> > PsSMvTxwgtXKB0
> > 0emiS1QuRpBEBAkjouhSQw0xWHOBNTGUEgoiGCSY4AU5TEOEHYqcMQ0eNuhQCC
> > I58DGNBtNs0EED
> > D6BQQDdQhBBCMK90g9ISU4xzyy+vNAPKIecs0AUIWJxDwJACLWNOL5OcAk86RQ
> > ThRiG2kLLJGlOU
> > I08psPABRSlcJpGDDIGUE48YeDjjjjOKyMEGKL30sgREr9RSCy+paDJIMHK6Qk
> > whpyDjSSClmNLJ
> > H6KYckUggzAxBSK5INJEBiCwoAsinzQwwqWbdOLMPPjkw88+/dQxyz776OMNP/
> > m8AE6n4BBAzz3+
> > gP/Djz4vpFBqBS8wgCoHWeSTDzjQXHPPF/hAI6s+qFDgKTT38DPBLJ6ims8+xb
> > RQKhJHIAFGPfWA
> > Ew44JdzjaTT67CMBA07YcUkj0khyCQKgIAIIMNSE8wQdulRTTSc77LAGGejckM
> > MNGJwyzzW/YJBM
> > NeFcwQO94YSiyCJn6HCNGzC4MUMy16DjhQIco0MBCi0cgk4BBUTwTQS/fBNOMs
> > C40w06T9DyDTrg
> > HHCNy78MUkghdkySxyST9EHJHXZUQgceeMix9CSWNPXIGWSIQUMMNNAgQwwyaB
> > 3DBRdggAE2GFxQ
> > Axlo94DHJDv8kEPYd2ygQQYZyJ1BAwukFAJICCz/gdMCgjwQxR9eTDABC6C4Ik
> > osVKDwwOOPpGKM
> > PfZYyY0odswRxxBFzKGmHJUP8kOHXMtggw0+AEJ5Oea0w4wljMQu+yIMOaJKKr
> > jXGcJMxADiiQoF
> > YBGFBho08GgTTQw+RSed/PTE8380QYVSXAgSQQR+cCINVKeMk84tSHRhTjdeLC
> > NPMLpwdc01KHCT
> > jCnbmLMNBlOwsw4OMFzzTjJAmBKPMIFohjyAAQpzsENO7LAEM+SxjWCIIx7AMI
> > UBiwEL1plCFPFo
> > RzvYEQxlqMMdwFhGNrpQDm6YIhjpQIcUTGCCVvBCGvDABSsocQ16fIEe+GjBEe
> > AAhzDAgVtbqAAF
> > /+BxjiNsoR74qMAW6JGPOhBCXEqwgFu8UAYzjKENZWCFLz5DD1jMox5bKAELvj
> > gBt1QBBZDxwiGa
> > pQQktIAe9SjBB5TwgWq4AwwO8AAD9ugBCFiiFZrQBCZYgQpUHOENdUikIQhxBD
> > WooQIOIEQKHpkC
> > D7zgkph8Aa40KRszlKEMKMgCEo7Thi1sgTlHYEAKJHACLVhhFlqQwCiGAQElOA
> > ACEMhWtpSQgC0M
> > gBAkIMEJHGAICayAAR5wAgSgZolg2OISk4BGITQXByNU8w5DMMIQ0oABHsgAHH
> > qYAQqiYYFihMEC
> > 6KwNBnSgAzH8AA1zYEUcgAAN6sGgDEPIRALCU/8CFKAgAlgAxy2+8AVwgAAEGZ
> > gCIAJhigY0AAQN
> > iEALJJCF0XwCCygoQQmIMDRpXKIS9tFFfvhAjFz4BxKQmAYjErEIioWiFNhARA
> > yeYTZP/OICN7AG
> > DawRhAqdIRFomwYiEFGKWCCiCHywhgKssYEGqOABWRhAN4IRDGB0QwRXxSoFxk
> > EMUSxOF7/o0R0P
> > QIABFOATRJiEHJIwjXSkIxmVAMUv8MAfO1xjGtvoxSoWwYYeoDAd2pjCBarxjG
> > TYABjYGIcKMKAN
> > dHQjFGc4AxvoMA0+7EAIGACGNbLBggZIAwRyQ0EDntANt6YDGEzIBTnIEQw/6I
> > Ic45hAMtyxDHf/
> > TOEc4SAHIlJUAEuo4hXAdUUoksC0PRQhDkIoQhGIwFwfrOEHO4jBDWIQgxzowA
> > YZCIQnABEKTshB
> > bXiwA9PmMLRLQGIJmJCEJSyxiSlMwQsu8QLwsFAAKjwAeU1YQBOe0BMo/KETsI
> > DCArgAi2LIogCC
> > kIUgECyJVhijHGJqB1/2YIQgDEEI8MkDHuxhjljsoAg6oK7pTqc6MdkvLytVRC
> > Jit66IaCIVBVmF
> > JjoxBU8ENxZYiEUgsEA8Dezixxpowh82gRP8NuGgKBCEIEJJBUFoghPCYEcuWB
> > GLdJBDD5QIRjko
> > J44/MCMee4GHF+QB4cqFIgaAaB0N0mAKd1RD/7LA2LI9xLEKRyyDdaxrBSDiAe
> > ESEsMUrPNEBe1x
> > QQjrohwE1IY82CEPZRQAEZUzhzoaaqlV8MIYe3HrO3zRBmXI4xZmKMQ6yDGEdN
> > SDCzAYQwdsw4Kz
> > WOAT6ljHzt7xDi6YgRryKMQOQqGObZCiHcJYMTFawY52nAIWx2DHNk6RQQWb40
> > qm2MspClGAJf2C
> > JrkARjycEYhCvIMeXuBCBFwojHVMGRXfcAcF0vGVenyRHmNwyygqQAJ3xBod6X
> > iHC1rgjnpMoIZf
> > uCJV2vLFemiAHO7AC1fd6s9bLMkXS1IyWljAAiTeIQGHcIsC9pmAbywJiZ4ygC
> > FG4cLaBgMWvv8Q
> > lwGikY9o8PAI/VADtw5RAV+k4xsVaEGnXmAIfvADVxS4BwXGAI16/KIMbaAENH
> > zxCVSkoVOf+IYN
> > hwENekDjAPSgBwW2hY8DHMLnekACEvAxDzAowQreOMU78nECPQpAAutpxSqO0S
> > x96IMCVkBkC/xR
> > LlC9wFqfMkQ/9NEPAfjDHy+Yhd0xKQB+9GMMXoAGqfYRDS6USx/+GIYblNCPyV
> > OAEFYQQKkOYPeS
> > 2T1bSCCBN8SVDwqcQAJ2t7s/VpDMS1gCE5e4BCtm2IY3wKEOvh8DHN6gBjio4Q
> > 1hCEMFXLCbTWpy
> > +cu/YhuAQP0gtEH6ylmOGdoAHSdoIQXDWEH/CqowjBOc4AMOQIISeMlLDpigBO
> > 7nwhas4AAnJDM6
> > J4DEQTSxPnD4Yg53cAeUQAlY5gYGqAfbNwNmcAj6AA39YAViIRa9AQcWMAM3kA
> > Y7YAR3EAdokAYW
> > 8AXR4A3RoBxloAfrpwROcAIlYEqCAAYiGA0H0AEKIAjMMwImsgGXYgKGkGBXIA
> > hVcAIQEEyTgAkK
> > pAm5Rwy2UAl9wAdMOAdzwAfJJQQYiAbgUAYYgAOmgAHgAAMzAANcaAFuIANdIw
> > ZrkAiKwAplAA7A
> > gQNBAARGoABw2AEnAgIFwAVTsC9McAXXgAV/oAJe4AquYC8ggDxZcAgGYABZQG
> > CxAAufIAhr/wMJ
> > 0mAJk7AHtNAf01AEp4ALnQAMcrAJ14AGbMBS2DBVpoBT1MA1UxAMGKAB1cAD75
> > ADlxAMK6YIPhAV
> > p2AKnxAMRhAF1aAA79ABYAANWRABXnAOwbAwwNAJ0oAFriIA2QCInRAMpvAE48
> > AF5yAABgAOXBAL
> > tNAHebAL0lA0cUALuZAfc1AgoqAN3SANwNAILWUJS9ADNZBTOyUDNfAg1KVT03
> > ADQzANKgZU0uBO
> > HnJUfBAOG3AOctgAUYACWNANU+AiwEAK6dAN3TAOhUAOtAAKoDANyfAL6UAFp3
> > AO6ZAzBBABexAf
> > wYAIFFYNpZAfe1AgnhAMeaAJ2ZAKjaAIUP/gDAcSCMewIDQwDYGgiqx4Ae+AAR
> > ngDGdABHSwBtJg
> > B2KgA6lYBE9ADRkgDcQDAg/QACHgkCEQCM9gClcVAtsQAuPwBQizDcBFDhFwDl
> > HwAOfwAANAAEEj
> > NJOYAHdQCZPINHZgB3SQB5bAC7zQCGxwBlZjOjKQBjewAzZwNWHDAxhgDd30A1
> > SjCGTQB3uAXEEQ
> > BJSQCZeyCyMwDCawBSNQACqgAlhABVEgGIKBBS0SAhQ3AbfwChrJOI7zOA8wB2
> > jAXHIwBwkABHPw
> > A0WQXMr1A2ygCI3gCI3QAz9AA28zXQPDA9N1AY4ZBBiQhRiQAz9QA6NTBHKQA9
> > 6JAU6SAEYmsAEb
> > wAcKIIMasADqmQFzwxHumQR3gwJxaQBesF2DoAIoQJ4bEBAAOw== Content-Type:
> > multipart/alternative --d49718178131ebc038c576f007a40642
> > Content-Type:
> > text/plain; charset=iso-8859-1 Content-Transfer-Encoding:
> > 8bit Dear Robin
> > Wilson Below are the details of the Proposal Submission Form
> > you filled in
> > at 2HostMe Media Services Logo / produktnaam test Thema / slogan:
> > Steekwoorden* Aantal (ca.): Kleur item: Budget (minimum en
> > maximum prijs in
> > euros) tussen euro en euro per produkt item Gewenste
> > leverdatum 27-01-2007
> > Streef Datum Eventueel eigen produkt ideeën Opmerkingen /
> > aanvullende info
> > Content-Type: text/html; charset=iso-8859-1
> > Content-Transfer-Encoding: 8bit
> > Dear Robin Wilson
> >
> > Below are the details of the Proposal Submission Form you
> > filled in at
> > 2HostMe Media Services
> >
> > Logo / produktnaam test
> > Thema / slogan:
> > Steekwoorden*
> > Aantal (ca.):
> > Kleur item:
> > Budget (minimum en maximum prijs in euros) tussen euro en
> > euro per produkt
> > item
> > Gewenste leverdatum 27-01-2007 Streef Datum
> > Eventueel eigen produkt ideeën
> > Opmerkingen / aanvullende info
> > --d49718178131ebc038c576f007a40642-- 
> >
> >
> >
> > ""Jake McHenry"" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > >I take it there are no errors... And your using windows... Sending to
> > > exchange... I guess with seeing what you posted, I would
> > start by echoing
> > > out what you have in  $to, $subject, $msg, $headers. Are
> > there any errors
> > > in
> > > Exchange logs? Do you see the message coming into Exchange queue?
> > >
> > > Jake
> > >
> > >
> > >> -----Original Message-----
> > >> From: Robin Wilson [mailto:[EMAIL PROTECTED]
> > >> Sent: Friday, March 23, 2007 9:53 PM
> > >> To: [email protected]
> > >> Subject: [PHP] What is wrong with this function please?
> > >>
> > >> Hello
> > >>
> > >> I'm trying to do a function that emails users and sends an
> > >> attachment. But I
> > >> think something is in the wrong order or something as when
> > I send it
> > >> Exchange discards it.
> > >>
> > >> This is the function which I have put together from
> > various sources:
> > >>
> > >> I would really appreciate any help as I have been up half the
> > >> night and got
> > >> nowhere!
> > >> Thanks
> > >> Robin
> > >>
> > >> function sendMail($to, $toName, $from, $fromName,
> > $subject, $message,
> > >> $uploadfile, $fileName, $fileType, $fileSize) {
> > >>  $eol="\r\n";
> > >>   $mime_boundary=md5(time());
> > >>
> > >>   # Common Headers
> > >>   $headers .= 'From: '. $fromName .' <'. $from .'>'.$eol;
> > >>   $headers .= 'Reply-To: '. $toName .' <'. $to .'>'.$eol;
> > >>   $headers .= 'Return-Path: '. $fromName.' <'. $from
> > >> .'>'.$eol;    // these
> > >> two to set reply address
> > >>   $headers .= "Message-ID:
> > >> <".$mime_boundary."@".$_SERVER['SERVER_NAME'].">".$eol;
> > >>   $headers .= "X-Mailer: PHP v".phpversion().$eol;
> > >> // These two to
> > >> help avoid spam-filters
> > >>
> > >>   # Boundry for marking the split & Multitype Headers
> > >>   $headers .= 'MIME-Version: 1.0'.$eol;
> > >>   $headers .= "Content-Type: multipart/related;
> > >> boundary=\"".$mime_boundary."\"".$eol;
> > >>
> > >>  $msg = " ";
> > >>
> > >>  if ($uploadfile != "") {
> > >>   # File for Attachment
> > >>        $file_name = substr($uploadfile, (strrpos($uploadfile,
> > >> "/")+1));
> > >>
> > >>        $handle=fopen($uploadfile, 'rb');
> > >>        $f_contents=fread($handle, $fileSize);
> > >>        $f_contents=chunk_split(base64_encode($f_contents));
> > >>  //Encode The
> > >> Data For Transition using base64_encode();
> > >>        fclose($handle);
> > >>
> > >>        # Attachment
> > >>        $msg .= "--".$mime_boundary.$eol;
> > >>        $msg .= "Content-Type: ".$fileType.";
> > >> name=\"".$file_name."\"".$eol;
> > >>        $msg .= "Content-Transfer-Encoding: base64".$eol;
> > >>        $msg .= "Content-Disposition: attachment;
> > >> filename=\"".$file_name."\"".$eol.$eol; // !! This line needs
> > >> TWO end of
> > >> lines !! IMPORTANT !!
> > >>        $msg .= $f_contents.$eol.$eol;
> > >>  }
> > >>
> > >>  # Setup for text OR html
> > >>    $msg .= "Content-Type: multipart/alternative".$eol;
> > >>
> > >>    # Text Version
> > >>    $msg .= "--".$mime_boundary.$eol;
> > >>    $msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
> > >>    $msg .= "Content-Transfer-Encoding: 8bit".$eol;
> > >>    $msg .= strip_tags(str_replace("<br>", "\n",
> > $message)).$eol.$eol;
> > >>
> > >>    # HTML Version
> > >>    $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
> > >>    $msg .= "Content-Transfer-Encoding: 8bit".$eol;
> > >>    $msg .= $message.$eol.$eol;
> > >>
> > >>    # Finished
> > >>    $msg .= "--".$mime_boundary."--".$eol.$eol;  // finish
> > >> with two eol's for
> > >> better security. see Injection.
> > >>
> > >>
> > >>  // Mail it
> > >>  mail($to, $subject, $msg, $headers);
> > >> }
> > >>
> > >> -- 
> > >> PHP General Mailing List (http://www.php.net/)
> > >> To unsubscribe, visit: http://www.php.net/unsub.php
> > >>
> > >> -- 
> > >> No virus found in this incoming message.
> > >> Checked by AVG Free Edition.
> > >> Version: 7.5.446 / Virus Database: 268.18.17/730 - Release
> > >> Date: 3/22/2007 7:44 AM
> > >>
> > >>
> > >
> > > -- 
> > > No virus found in this outgoing message.
> > > Checked by AVG Free Edition.
> > > Version: 7.5.446 / Virus Database: 268.18.17/730 - Release
> > Date: 3/22/2007
> > > 7:44 AM
> > >
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > -- 
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release
> > Date: 3/23/2007 3:27 PM
> >
> >
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 3/23/2007
> 3:27 PM
> 

--- End Message ---
--- Begin Message ---
Ok.. It all looks ok... I did some googling and found that Exchange requires
the Message-ID to be unique.... Which it really should be anyways... and
yours isn't. try adding time() or something to make it unique :)

Jake


> -----Original Message-----
> From: Robin Wilson [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, March 25, 2007 2:25 PM
> To: [email protected]
> Subject: Re: [PHP] What is wrong with this function please?
> 
> Thanks for the help
> 
> The line returns are specified as "\r\n" but in the echo they 
> seem to all be 
> on one line. Could that be related to the problem. Also the 
> addresses are 
> specified but seem to have been removed???
> 
> This is what I specified:
> $eol="\r\n";
>   $mime_boundary=md5(time());
> 
>   # Common Headers
>   $headers .= 'From: '.$fromName.'<'.$fromaddress.'>'.$eol;
>   $headers .= 'Reply-To: '.$fromName.'<'.$fromaddress.'>'.$eol;
>   $headers .= 'Return-Path: 
> '.$fromName.'<'.$fromaddress.'>'.$eol;    // 
> these two to set reply address
>   $headers .= "Message-ID: 
> <".time()."@".$_SERVER['SERVER_NAME'].">".$eol;
>   $headers .= "X-Mailer: PHP v".phpversion().$eol;          
> // These two to 
> help avoid spam-filters
> 
> I followed some tutorials and they all seemed to tell me to 
> do it this way.
> 
> The emails seem to work with other clients and only Exchange 
> doesn't like 
> them.
> Tested with Squirrel Mail and they were recieved with the 
> attachment etc.
> 
> Do you have any more ideas please?
> Thanks for the help
> 
> Robin
> 
> ""Jake McHenry"" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> 
> >
> > No sorry, both messages are the same.
> > Didn't mean to post it twice. Sorry.
> >
> > Below is what prints out when I echo the message:
> >
> > $to
> > [EMAIL PROTECTED]
> >
> > $subject
> > Proposal Submission
> >
> > $headers
> > From: 2HostMe Mailer Reply-To: Robin Wilson Return-Path:
> > 2HostMe Mailer
> > Message-ID: X-Mailer: PHP v4.4.2 MIME-Version: 1.0 Content-Type:
> > multipart/related; boundary="d49718178131ebc038c576f007a40642"
> 
> 
> Are these all on the same lines just because of echo? Or are 
> they on their
> own lines? Like this:
> 
> From: 2HostMe Mailer
> Reply-To: Robin Wilson
> Return-Path: 2HostMe Mailer
> Message-ID: X-Mailer: PHP v4.4.2
> MIME-Version: 1.0
> Content-Type: multipart/related; 
> boundary="d49718178131ebc038c576f007a40642"
> 
> 
> From: should have a from email address, same with reply-to 
> and return-path
> 
> 
> >
> > $msg
> > --d49718178131ebc038c576f007a40642 Content-Type: image/gif;
> > name="betaresource.gif" Content-Transfer-Encoding: base64
> > Content-Disposition: attachment; filename="betaresource.gif"
> 
> Same with these, are there any line returns?
> 
> > R0lGODlhWgAeAPcAAAAAAP///25scFNdc1tkc0tcclpibWNpcTtbgi1CWzJIY0
> > BaeyU0RjpRbCw9
> > UUFXci8/UkxbbUpUYGdwe3Z7gRMqQxg1VB5AZh0+YjpWdjhTcjVNaTBGXjRLZS
> > Y3Si1BVzxVcUpn
> > iE1rizpQaTJEWTZJXzlNYzFCVUBUajhGVVJlezdDUGNyglNdaBUvShEmPBo5Wh
> > 9EaiBGbBs7XCFI
> > byNMdCJJcR9CZxw8XSFFaiJHbCNJbiBCZChReiZOdSVLcSBBYR8+XSRHaSJDYy
> > pQdSdKbSVGZiI3
> > TSU6UDtcfSk/VkNliUVkhD9bdyk6TENeekpmgkNbdDxPY1NtiEhedTtNXzhJWk
> > 1ke0theEVXajA9
> > SkJTZE5hdGx+kFxremx2gH6DiBYxSyVNcxo2USlUfB9AXh08WCpWfidQdSJGZh
> > cvRSlTeSpUeh06
> > VB89WRozShkxRyZJaS1VeylOcCpQchkvRC1UeCVFYi1SdTBYfCM/Wi1QcStNbD
> > BUdUVqi0Riflt5
> > lFdzjEZbb1t1jT9OXGJ2iUJPW1dlcoiVoSxagitZgC9gii5dhjNlkTdtmjVqlT
> > RjjDtvmTptljFb
> > fyRDXi9XeTlpkDVhhTlmjCpKZkBulD1lh05yj01rhF55j1NqfWuHnmN8kmmBlU
> > paZ4aaq32PnniI
> > loKPmiVIYj53oz5ym0R8pS5SbUN2nWGFoG6SrVZvgltzhlJndzxLV2V7jJKqvI
> > KVpGx7hoqbqJGg
> > q46bpTFadkuDqoahtHSCjImUnKGstJylq8THyTlQX2KAk1txfcDL0ayxtIadqZ
> > ieobS6vbzFyLe/
> > wcXJyrG2t7i8vJaXl4eIiL/Bv7y+vLW2tbCxsLu8uqusqrq7uMfIwtDQzM3Nyd
> > jY1cTEwo6Ojbe2
> > saSjoMC+uePh3MnGv83KxO7q4+3o4MPAu726teLazujh1+bf1erk2+nj2tzUyd
> > fPxOTc0ezm3uvl
> > 3dTKvszBttHGu/Hs58G1q8e7sb6wp6ubkrKimbipoJSMiKCSjD1MWCH5BAEAAP
> > 8ALAAAAABaAB4A
> > QAj/AB2tGrhKlSRJjxAifMTwkSOHjh4+ajSxIUMEIZZkRICAySYmIENwEuFnkx
> > 8/IkQA4hQolidP
> > xAJNiUUTFpM/OJMwCQGFCRQosP48uVKsmJcBWLhwQZqK1zJ1z04FgwcvSzt11q
> > qhg+fOjbt5o8K4
> > KKFLGjt18MJEWOfu3bx5XsbAuCrNmbR08Gytg7etFidiaKlQMSVuHah26z5lia
> > fuVqF08zZw8OLO
> > HQoTUlBYY6cNW7V6927J+tTIoCZLu/qwGuKmjes2rd+MmR1mjNgKuHPjfuGidx
> > gcZSi5SUMcxxgL
> > bcy4Ud4GiYfnThykmDWrhJQqVkhwSKCkBAgO4Dl0/zChwIQgLIIIaXES3QEJOp
> > PsSMvTxwgtXKB0
> > 0emiS1QuRpBEBAkjouhSQw0xWHOBNTGUEgoiGCSY4AU5TEOEHYqcMQ0eNuhQCC
> > I58DGNBtNs0EED
> > D6BQQDdQhBBCMK90g9ISU4xzyy+vNAPKIecs0AUIWJxDwJACLWNOL5OcAk86RQ
> > ThRiG2kLLJGlOU
> > I08psPABRSlcJpGDDIGUE48YeDjjjjOKyMEGKL30sgREr9RSCy+paDJIMHK6Qk
> > whpyDjSSClmNLJ
> > H6KYckUggzAxBSK5INJEBiCwoAsinzQwwqWbdOLMPPjkw88+/dQxyz776OMNP/
> > m8AE6n4BBAzz3+
> > gP/Djz4vpFBqBS8wgCoHWeSTDzjQXHPPF/hAI6s+qFDgKTT38DPBLJ6ims8+xb
> > RQKhJHIAFGPfWA
> > Ew44JdzjaTT67CMBA07YcUkj0khyCQKgIAIIMNSE8wQdulRTTSc77LAGGejckM
> > MNGJwyzzW/YJBM
> > NeFcwQO94YSiyCJn6HCNGzC4MUMy16DjhQIco0MBCi0cgk4BBUTwTQS/fBNOMs
> > C40w06T9DyDTrg
> > HHCNy78MUkghdkySxyST9EHJHXZUQgceeMix9CSWNPXIGWSIQUMMNNAgQwwyaB
> > 3DBRdggAE2GFxQ
> > Axlo94DHJDv8kEPYd2ygQQYZyJ1BAwukFAJICCz/gdMCgjwQxR9eTDABC6C4Ik
> > osVKDwwOOPpGKM
> > PfZYyY0odswRxxBFzKGmHJUP8kOHXMtggw0+AEJ5Oea0w4wljMQu+yIMOaJKKr
> > jXGcJMxADiiQoF
> > YBGFBho08GgTTQw+RSed/PTE8380QYVSXAgSQQR+cCINVKeMk84tSHRhTjdeLC
> > NPMLpwdc01KHCT
> > jCnbmLMNBlOwsw4OMFzzTjJAmBKPMIFohjyAAQpzsENO7LAEM+SxjWCIIx7AMI
> > UBiwEL1plCFPFo
> > RzvYEQxlqMMdwFhGNrpQDm6YIhjpQIcUTGCCVvBCGvDABSsocQ16fIEe+GjBEe
> > AAhzDAgVtbqAAF
> > /+BxjiNsoR74qMAW6JGPOhBCXEqwgFu8UAYzjKENZWCFLz5DD1jMox5bKAELvj
> > gBt1QBBZDxwiGa
> > pQQktIAe9SjBB5TwgWq4AwwO8AAD9ugBCFiiFZrQBCZYgQpUHOENdUikIQhxBD
> > WooQIOIEQKHpkC
> > D7zgkph8Aa40KRszlKEMKMgCEo7Thi1sgTlHYEAKJHACLVhhFlqQwCiGAQElOA
> > ACEMhWtpSQgC0M
> > gBAkIMEJHGAICayAAR5wAgSgZolg2OISk4BGITQXByNU8w5DMMIQ0oABHsgAHH
> > qYAQqiYYFihMEC
> > 6KwNBnSgAzH8AA1zYEUcgAAN6sGgDEPIRALCU/8CFKAgAlgAxy2+8AVwgAAEGZ
> > gCIAJhigY0AAQN
> > iEALJJCF0XwCCygoQQmIMDRpXKIS9tFFfvhAjFz4BxKQmAYjErEIioWiFNhARA
> > yeYTZP/OICN7AG
> > DawRhAqdIRFomwYiEFGKWCCiCHywhgKssYEGqOABWRhAN4IRDGB0QwRXxSoFxk
> > EMUSxOF7/o0R0P
> > QIABFOATRJiEHJIwjXSkIxmVAMUv8MAfO1xjGtvoxSoWwYYeoDAd2pjCBarxjG
> > TYABjYGIcKMKAN
> > dHQjFGc4AxvoMA0+7EAIGACGNbLBggZIAwRyQ0EDntANt6YDGEzIBTnIEQw/6I
> > Ic45hAMtyxDHf/
> > TOEc4SAHIlJUAEuo4hXAdUUoksC0PRQhDkIoQhGIwFwfrOEHO4jBDWIQgxzowA
> > YZCIQnABEKTshB
> > bXiwA9PmMLRLQGIJmJCEJSyxiSlMwQsu8QLwsFAAKjwAeU1YQBOe0BMo/KETsI
> > DCArgAi2LIogCC
> > kIUgECyJVhijHGJqB1/2YIQgDEEI8MkDHuxhjljsoAg6oK7pTqc6MdkvLytVRC
> > Jit66IaCIVBVmF
> > JjoxBU8ENxZYiEUgsEA8Dezixxpowh82gRP8NuGgKBCEIEJJBUFoghPCYEcuWB
> > GLdJBDD5QIRjko
> > J44/MCMee4GHF+QB4cqFIgaAaB0N0mAKd1RD/7LA2LI9xLEKRyyDdaxrBSDiAe
> > ESEsMUrPNEBe1x
> > QQjrohwE1IY82CEPZRQAEZUzhzoaaqlV8MIYe3HrO3zRBmXI4xZmKMQ6yDGEdN
> > SDCzAYQwdsw4Kz
> > WOAT6ljHzt7xDi6YgRryKMQOQqGObZCiHcJYMTFawY52nAIWx2DHNk6RQQWb40
> > qm2MspClGAJf2C
> > JrkARjycEYhCvIMeXuBCBFwojHVMGRXfcAcF0vGVenyRHmNwyygqQAJ3xBod6X
> > iHC1rgjnpMoIZf
> > uCJV2vLFemiAHO7AC1fd6s9bLMkXS1IyWljAAiTeIQGHcIsC9pmAbywJiZ4ygC
> > FG4cLaBgMWvv8Q
> > lwGikY9o8PAI/VADtw5RAV+k4xsVaEGnXmAIfvADVxS4BwXGAI16/KIMbaAENH
> > zxCVSkoVOf+IYN
> > hwENekDjAPSgBwW2hY8DHMLnekACEvAxDzAowQreOMU78nECPQpAAutpxSqO0S
> > x96IMCVkBkC/xR
> > LlC9wFqfMkQ/9NEPAfjDHy+Yhd0xKQB+9GMMXoAGqfYRDS6USx/+GIYblNCPyV
> > OAEFYQQKkOYPeS
> > 2T1bSCCBN8SVDwqcQAJ2t7s/VpDMS1gCE5e4BCtm2IY3wKEOvh8DHN6gBjio4Q
> > 1hCEMFXLCbTWpy
> > +cu/YhuAQP0gtEH6ylmOGdoAHSdoIQXDWEH/CqowjBOc4AMOQIISeMlLDpigBO
> > 7nwhas4AAnJDM6
> > J4DEQTSxPnD4Yg53cAeUQAlY5gYGqAfbNwNmcAj6AA39YAViIRa9AQcWMAM3kA
> > Y7YAR3EAdokAYW
> > 8AXR4A3RoBxloAfrpwROcAIlYEqCAAYiGA0H0AEKIAjMMwImsgGXYgKGkGBXIA
> > hVcAIQEEyTgAkK
> > pAm5Rwy2UAl9wAdMOAdzwAfJJQQYiAbgUAYYgAOmgAHgAAMzAANcaAFuIANdIw
> > ZrkAiKwAplAA7A
> > gQNBAARGoABw2AEnAgIFwAVTsC9McAXXgAV/oAJe4AquYC8ggDxZcAgGYABZQG
> > CxAAufIAhr/wMJ
> > 0mAJk7AHtNAf01AEp4ALnQAMcrAJ14AGbMBS2DBVpoBT1MA1UxAMGKAB1cAD75
> > ADlxAMK6YIPhAV
> > p2AKnxAMRhAF1aAA79ABYAANWRABXnAOwbAwwNAJ0oAFriIA2QCInRAMpvAE48
> > AF5yAABgAOXBAL
> > tNAHebAL0lA0cUALuZAfc1AgoqAN3SANwNAILWUJS9ADNZBTOyUDNfAg1KVT03
> > ADQzANKgZU0uBO
> > HnJUfBAOG3AOctgAUYACWNANU+AiwEAK6dAN3TAOhUAOtAAKoDANyfAL6UAFp3
> > AO6ZAzBBABexAf
> > wYAIFFYNpZAfe1AgnhAMeaAJ2ZAKjaAIUP/gDAcSCMewIDQwDYGgiqx4Ae+AAR
> > ngDGdABHSwBtJg
> > B2KgA6lYBE9ADRkgDcQDAg/QACHgkCEQCM9gClcVAtsQAuPwBQizDcBFDhFwDl
> > HwAOfwAANAAEEj
> > NJOYAHdQCZPINHZgB3SQB5bAC7zQCGxwBlZjOjKQBjewAzZwNWHDAxhgDd30A1
> > SjCGTQB3uAXEEQ
> > BJSQCZeyCyMwDCawBSNQACqgAlhABVEgGIKBBS0SAhQ3AbfwChrJOI7zOA8wB2
> > jAXHIwBwkABHPw
> > A0WQXMr1A2ygCI3gCI3QAz9AA28zXQPDA9N1AY4ZBBiQhRiQAz9QA6NTBHKQA9
> > 6JAU6SAEYmsAEb
> > wAcKIIMasADqmQFzwxHumQR3gwJxaQBesF2DoAIoQJ4bEBAAOw== Content-Type:
> > multipart/alternative --d49718178131ebc038c576f007a40642
> > Content-Type:
> > text/plain; charset=iso-8859-1 Content-Transfer-Encoding:
> > 8bit Dear Robin
> > Wilson Below are the details of the Proposal Submission Form
> > you filled in
> > at 2HostMe Media Services Logo / produktnaam test Thema / slogan:
> > Steekwoorden* Aantal (ca.): Kleur item: Budget (minimum en
> > maximum prijs in
> > euros) tussen euro en euro per produkt item Gewenste
> > leverdatum 27-01-2007
> > Streef Datum Eventueel eigen produkt ideeën Opmerkingen /
> > aanvullende info
> > Content-Type: text/html; charset=iso-8859-1
> > Content-Transfer-Encoding: 8bit
> > Dear Robin Wilson
> >
> > Below are the details of the Proposal Submission Form you
> > filled in at
> > 2HostMe Media Services
> >
> > Logo / produktnaam test
> > Thema / slogan:
> > Steekwoorden*
> > Aantal (ca.):
> > Kleur item:
> > Budget (minimum en maximum prijs in euros) tussen euro en
> > euro per produkt
> > item
> > Gewenste leverdatum 27-01-2007 Streef Datum
> > Eventueel eigen produkt ideeën
> > Opmerkingen / aanvullende info
> > --d49718178131ebc038c576f007a40642-- 
> >
> >
> >
> > ""Jake McHenry"" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > >I take it there are no errors... And your using windows... 
> Sending to
> > > exchange... I guess with seeing what you posted, I would
> > start by echoing
> > > out what you have in  $to, $subject, $msg, $headers. Are
> > there any errors
> > > in
> > > Exchange logs? Do you see the message coming into Exchange queue?
> > >
> > > Jake
> > >
> > >
> > >> -----Original Message-----
> > >> From: Robin Wilson [mailto:[EMAIL PROTECTED]
> > >> Sent: Friday, March 23, 2007 9:53 PM
> > >> To: [email protected]
> > >> Subject: [PHP] What is wrong with this function please?
> > >>
> > >> Hello
> > >>
> > >> I'm trying to do a function that emails users and sends an
> > >> attachment. But I
> > >> think something is in the wrong order or something as when
> > I send it
> > >> Exchange discards it.
> > >>
> > >> This is the function which I have put together from
> > various sources:
> > >>
> > >> I would really appreciate any help as I have been up half the
> > >> night and got
> > >> nowhere!
> > >> Thanks
> > >> Robin
> > >>
> > >> function sendMail($to, $toName, $from, $fromName,
> > $subject, $message,
> > >> $uploadfile, $fileName, $fileType, $fileSize) {
> > >>  $eol="\r\n";
> > >>   $mime_boundary=md5(time());
> > >>
> > >>   # Common Headers
> > >>   $headers .= 'From: '. $fromName .' <'. $from .'>'.$eol;
> > >>   $headers .= 'Reply-To: '. $toName .' <'. $to .'>'.$eol;
> > >>   $headers .= 'Return-Path: '. $fromName.' <'. $from
> > >> .'>'.$eol;    // these
> > >> two to set reply address
> > >>   $headers .= "Message-ID:
> > >> <".$mime_boundary."@".$_SERVER['SERVER_NAME'].">".$eol;
> > >>   $headers .= "X-Mailer: PHP v".phpversion().$eol;
> > >> // These two to
> > >> help avoid spam-filters
> > >>
> > >>   # Boundry for marking the split & Multitype Headers
> > >>   $headers .= 'MIME-Version: 1.0'.$eol;
> > >>   $headers .= "Content-Type: multipart/related;
> > >> boundary=\"".$mime_boundary."\"".$eol;
> > >>
> > >>  $msg = " ";
> > >>
> > >>  if ($uploadfile != "") {
> > >>   # File for Attachment
> > >>        $file_name = substr($uploadfile, (strrpos($uploadfile,
> > >> "/")+1));
> > >>
> > >>        $handle=fopen($uploadfile, 'rb');
> > >>        $f_contents=fread($handle, $fileSize);
> > >>        $f_contents=chunk_split(base64_encode($f_contents));
> > >>  //Encode The
> > >> Data For Transition using base64_encode();
> > >>        fclose($handle);
> > >>
> > >>        # Attachment
> > >>        $msg .= "--".$mime_boundary.$eol;
> > >>        $msg .= "Content-Type: ".$fileType.";
> > >> name=\"".$file_name."\"".$eol;
> > >>        $msg .= "Content-Transfer-Encoding: base64".$eol;
> > >>        $msg .= "Content-Disposition: attachment;
> > >> filename=\"".$file_name."\"".$eol.$eol; // !! This line needs
> > >> TWO end of
> > >> lines !! IMPORTANT !!
> > >>        $msg .= $f_contents.$eol.$eol;
> > >>  }
> > >>
> > >>  # Setup for text OR html
> > >>    $msg .= "Content-Type: multipart/alternative".$eol;
> > >>
> > >>    # Text Version
> > >>    $msg .= "--".$mime_boundary.$eol;
> > >>    $msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
> > >>    $msg .= "Content-Transfer-Encoding: 8bit".$eol;
> > >>    $msg .= strip_tags(str_replace("<br>", "\n",
> > $message)).$eol.$eol;
> > >>
> > >>    # HTML Version
> > >>    $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
> > >>    $msg .= "Content-Transfer-Encoding: 8bit".$eol;
> > >>    $msg .= $message.$eol.$eol;
> > >>
> > >>    # Finished
> > >>    $msg .= "--".$mime_boundary."--".$eol.$eol;  // finish
> > >> with two eol's for
> > >> better security. see Injection.
> > >>
> > >>
> > >>  // Mail it
> > >>  mail($to, $subject, $msg, $headers);
> > >> }
> > >>
> > >> -- 
> > >> PHP General Mailing List (http://www.php.net/)
> > >> To unsubscribe, visit: http://www.php.net/unsub.php
> > >>
> > >> -- 
> > >> No virus found in this incoming message.
> > >> Checked by AVG Free Edition.
> > >> Version: 7.5.446 / Virus Database: 268.18.17/730 - Release
> > >> Date: 3/22/2007 7:44 AM
> > >>
> > >>
> > >
> > > -- 
> > > No virus found in this outgoing message.
> > > Checked by AVG Free Edition.
> > > Version: 7.5.446 / Virus Database: 268.18.17/730 - Release
> > Date: 3/22/2007
> > > 7:44 AM
> > >
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > -- 
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release
> > Date: 3/23/2007 3:27 PM
> >
> >
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.17/731 - Release 
> Date: 3/23/2007
> 3:27 PM
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.18/733 - Release 
> Date: 3/25/2007 11:07 AM
>  
> 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.18/733 - Release Date: 3/25/2007
11:07 AM
 

--- End Message ---
--- Begin Message ---
Tijnema ! wrote:

> On 3/25/07, PHP Developer <[EMAIL PROTECTED]> wrote:
>
>> hello all,
>> As we know, there are a lot of php design patterns(more than 20). I
>> want to know that which patterns are important and necessary for ZCE
>> exam.
>> PHP5 Study Guide only covers Singleton,Factory,Registry,MVC and
>> ActiveRecord. But i still feel that more patterns are necessary for
>> the exam.
>> Cheers,
>> Daniel
>
>
> I'm not able to give an answer, but was it really needed to post this
> message three times??
>
> Tijnema

Taking the Zend ZCE exam puts you under a strict NDA.  Nobody can tell
you what you will see on the exam.

Study the exam guide and if design patterns really interest you then
take it to the next level out of personal interest.  Since patterns are
not "PHP-only" you can really study these from any language, or even
grab a language-agnostic design pattern book.

Travis Doherty

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

I'm trying to add the SNMP module with a compile-from-source PHP 5.2.1
installation. This is on a Fedora Core 5 system with target web server
being lighttpd.

This is the configure script that I have:

./configure --enable-fastcgi --enable-discard-path
--enable-force-redirect --with-mysql --with-mbstring --with-mcrypt
--with-gd --with-jpeg-dir=/usr/lib/ --with-zlib-dir=/usr/lib/
--with-net-snmp --with-gnu-ld

I don't have any errors whatsoever at this point. However, when I do
the "make" I get an error like the one below:

/usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php] Error 1

I tried to check if it was missing a package but I see that
libtool-ltdl is already installed on the server.

Anyone know what could be wrong here?

Regards,
Matt

--
Stand before it and there is no beginning.
Follow it and there is no end.
Stay with the ancient Tao,
Move with the present.

--- End Message ---
--- Begin Message ---
On 3/26/07, Matt Arnilo S. Baluyos (Mailing Lists)
<[EMAIL PROTECTED]> wrote:
Hello everyone,
I'm trying to add the SNMP module with a compile-from-source PHP 5.2.1
installation. This is on a Fedora Core 5 system with target web server
being lighttpd.

This is the configure script that I have:

./configure --enable-fastcgi --enable-discard-path
--enable-force-redirect --with-mysql --with-mbstring --with-mcrypt
--with-gd --with-jpeg-dir=/usr/lib/ --with-zlib-dir=/usr/lib/
--with-net-snmp --with-gnu-ld

I don't have any errors whatsoever at this point. However, when I do
the "make" I get an error like the one below:

/usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php] Error 1

I tried to check if it was missing a package but I see that
libtool-ltdl is already installed on the server.

Anyone know what could be wrong here?

Ok. I got it to compile. Turns out I had to add the libtool-ltdl-devel package.

It's strange though because I don't see an SNMP section on the result
of a phpinfo();

--
Stand before it and there is no beginning.
Follow it and there is no end.
Stay with the ancient Tao,
Move with the present.

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

We have moved our DNS server from one IP to another. But on a Linux
server, the PHP programs keep using the old DNS server IP. For 
example, for a simple php file:

<? echo gethostbyname ("smtp.cpttm"); ?>

When it is run, it tries to lookup smtp.cpttm using the old DNS 
server (I know it using tcpdump). The new DNS server is specified in 
/etc/resolv.conf. If I issue "ping smtp.cpttm" in a command prompt,
then tcpdump shows that it is accessing the new DNS server.

Any idea? Thanks.

--- End Message ---
--- Begin Message ---
Kent Tong wrote:
We have moved our DNS server from one IP to another. But on a Linux
server, the PHP programs keep using the old DNS server IP. For example, for a simple php file:

<? echo gethostbyname ("smtp.cpttm"); ?>

When it is run, it tries to lookup smtp.cpttm using the old DNS server (I know it using tcpdump). The new DNS server is specified in /etc/resolv.conf. If I issue "ping smtp.cpttm" in a command prompt,
then tcpdump shows that it is accessing the new DNS server.

Assuming you're using a web server it's possible PHP is caching the DNS server details. Try restarting the web server. Alternatively try the same script on the command line.

-Stut

--- End Message ---
--- Begin Message ---
Stut <stuttle <at> gmail.com> writes:

> Assuming you're using a web server it's possible PHP is caching the DNS 
> server details. Try restarting the web server. Alternatively try the 
> same script on the command line.

Wow! You're right! Stopping apache and then starting it (in two steps) 
solves the problem! In fact, I had tried restarting it 
(/etc/init.d/apache restart) but it didn't make any difference.

--- End Message ---
--- Begin Message ---
Hi All

I am porting some perl to PHP and have struck a small snag. The perl
script has quite a few substitutions that take place so data can be fed
into a html page.

The script uses the following perl syntax

$html = `cat search_results.html`;
$html =~ s/%Accom/$accom/g;

As I understand perl that should cat the html file into a variable called
$html. It should then perform a global substitution replacing %Accom with
the contents of the variable $accom.

Is such a thing possible in PHP? If so how? I have been doing google
searches for a while and can find no simple explanation of how to perform
this in PHP. The nearest I can find is using a preg_replace but I am
unsure if that will do what I need.

Does anyone know if this can be done?

Regards

Richard Luckhurst

--- End Message ---

Reply via email to