php-general Digest 16 May 2004 11:09:12 -0000 Issue 2766

Topics (messages 186336 through 186346):

Re: PHP and qmail
        186336 by: Manuel Lemos
        186339 by: electroteque

Release Announcement: Hardened-PHP 0.1.1
        186337 by: Stefan Esser
        186338 by: electroteque

Re: Reposting elseif carry
        186340 by: Curt Zirzow
        186341 by: Daniel Clark
        186342 by: Ronald \"The Newbie\" Allen

PEAR::DB is great but is sooooo SLOW !
        186343 by: greg
        186344 by: greg
        186345 by: greg
        186346 by: Rainer Müller

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

On 05/15/2004 04:14 PM, Stephen Lake wrote:
Can someone tell me how I can send HTML using qmail from a Script? The MTA I
was using was changed from Sendmail to qmail and now my HTML mails actually
show the html tags in the mail body.

That looks like a bug in the mail() function because qmail comes with sendmail compatible wrapper.


Anyway, you may want to try this class for composing and sending messages including HTML formatted. It comes with a sub-class specialized in qmail but I suspected that you do not need to use it as the base class that uses mail() already comes with workarounds to use the mail()
function without the problems you are facing:


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

--- End Message ---
--- Begin Message ---
Could it not be you have to send the  html document type in the header of
the mail ?

> -----Original Message-----
> From: Manuel Lemos [mailto:[EMAIL PROTECTED]
> Sent: Sunday, May 16, 2004 8:55 AM
> To: Stephen Lake
> Cc: [EMAIL PROTECTED]
> Subject: [PHP] Re: PHP and qmail
>
>
> Hello,
>
> On 05/15/2004 04:14 PM, Stephen Lake wrote:
> > Can someone tell me how I can send HTML using qmail from a
> Script? The MTA I
> > was using was changed from Sendmail to qmail and now my HTML
> mails actually
> > show the html tags in the mail body.
>
> That looks like a bug in the mail() function because qmail comes with
> sendmail compatible wrapper.
>
> Anyway, you may want to try this class for composing and sending
> messages including HTML formatted. It comes with a sub-class specialized
> in qmail but I suspected that you do not need to use it as the base
> class that uses mail() already comes with workarounds to use the mail()
> function without the problems you are facing:
>
> 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

--- End Message ---
--- Begin Message ---
------------------------------------------------------------------------

    _  _                _                     _       ___  _  _  ___ 
   | || | __ _  _ _  __| | ___  _ _   ___  __| | ___ | _ \| || || _ \
   | __ |/ _` || '_|/ _` |/ -_)| ' \ / -_)/ _` ||___||  _/| __ ||  _/
   |_||_|\__,_||_|  \__,_|\___||_||_|\___|\__,_|     |_|  |_||_||_|  
                                                         

------------------------------------------------------------------------

The Hardened-PHP project team is pleased to announce the release of 
version 0.1.1 of our PHP security hardening patch. This new Hardened-PHP
release is the first one that is publicly announced and is considered
stable on atleast linux systems.

Hardened-PHP is a patch against the PHP codebase which adds security 
hardening features to it to protect servers on the one hand against a 
number of well known problems in hastily written PHP scripts and on 
the other hand against potential unknown vulnerabilities within the 
engine itself.

Hardened-PHP provides:

+ Protection of the Zend Memory Manager with canaries
+ Protection of Zend Linked Lists with canaries
+ Protection against internal format string exploits
+ Protection against arbitrary code inclusion
+ Syslog logging of attackers IP

We consider Hardened-PHP 0.1.1 to be the best version of Hardened-PHP
available and we strongly recommend that users of older versions upgrade
as soon as possible.

Hardened-PHP is available for download via HTTP from 

        http:///www.hardened-php.net/download.php
        
The distribution file name is:

        hardened-php-4.3.6-0.1.1.patch.gz  
        MD5 checksum: 62f7d49b89c93dace247c2bc189b7503
        
Yours,
The Hardened-PHP Project Team...
http://www.hardened-php.net

--- End Message ---
--- Begin Message ---
please define a hastily written script ?

if this is it i dont know anyone who would ever attempt this

<?php
        include $aktion;
?>


saying that anyone who codes with no security in mind should go back to
school. But i'm sure it could be possible for maybe a web host to have
something dodgy on there.

--- End Message ---
--- Begin Message ---
* Thus wrote Ronald The Newbie Allen ([EMAIL PROTECTED]):
> 
> what I currently have is
> 
>  echo "<META HTTP-EQUIV=\"refresh\" content=\"0;
> URL=./Conference_Calls.php?Date_and_Time=".$_POST["$Date_and_Time"].">";

Have you looked at what this is actually outputing?

> 
> Tried several things from the string and either they return a parsing error
> or they return ".$_POST
> 
> kind of clueless now....help please

You might want to read:
http://www.php.net/manual/en/langref.php

It'll give you a better grasp on what  you're trying to do.


> 
> The code:
> 
> <?
> $event =  $_GET['Event_Type'];
> $Date_and_Time = $_GET['Date_and_Time'];

You're using $_GET here but $_POST in the output of your meta tag,
which one is it?

> //echo "$event";
> //echo "$time";
> if ($event == "Trouble_Tickets") {
>  echo '<META HTTP-EQUIV="refresh" content="0; URL=./Trouble_Tickets.php">';
> } elseif ($event == "Conference_Calls") {
>  print '<META HTTP-EQUIV="refresh" content="0;
> URL=./Conference_Calls.php?Date_and_Time=$_POST["Date_and_Time"]">';
> } elseif ($event == "Outage_Reports") {
>  echo '<META HTTP-EQUIV="refresh" content="0; URL=./Outage_Reports.php">';
> } else {
>  echo '<META HTTP-EQUIV="refresh" content="0; URL=./log.php">';
> }
> 

A few points:
 - You're if/elseif would better be written with a switch()
   statment.
 - You shouldn't really use a meta-refresh, but redirect the user
   using header().
 - Learn the difference between how php treats the single quote (')
   vs the double quote (")
 

<?php // this start tag is highly recommended

// Grab the event from the Query String
$event = $_GET['Event_Type'];


// Make the base url for redirection.
$base_url  = 'http://' . $_SERVER['HTTP_HOST'];
$base_url .= dirname($_SERVER['REQUEST_URI']);

switch ($event) {

  case 'Trouble_Tickets':
    $redirect = $base_url . $event . '.php';
    break;

  case 'Conference_Calls':
    $redirect = $base_url . $event . '.php?Date_and_Time='. $_POST['Date_and_Time'];
    break;

  case 'Outage_Reports':
    $redirect = $base_url . $event . '.php';
    break;

  default:
    $redirect = $base_url . 'log.php';
    break;
}

// Now redirect the user
header('Location: ' . $redirect);
exit();
?>


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

--- End Message ---
--- Begin Message ---
 echo "<META HTTP-EQUIV=\"refresh\" content=\"0;
URL=./Conference_Calls.php?Date_and_Time=\".$_POST[\"$Date_and_Time\"]\">";

>>I have tried both of these statements and neither one works  Trying to get
>>the Date_and_Time to be carried in the URL.  Any Help please.
>>
>> print '<META HTTP-EQUIV="refresh" content="0;
>>URL=./Conference_Calls.php?Date_and_Time=$_POST["Date_and_Time"]">';
>>
>>or
>>
>> echo '<META HTTP-EQUIV="refresh" content="0;
>>URL=./Conference_Calls.php?Date_and_Time=$_POST["Date_and_Time"]">';

--- End Message ---
--- Begin Message ---
While I am sure that you are right.  I went to the webpages that you
identified and did not see anything on' and ".  I tried the code that typed
up and it said that Date_and_Time wher and undefinded index and also that
the headers could not be modified.

Advanced stuff for me, while I do see the logic in the operation

What is the difference in a single quote and a double quote?

the base_url is this suppose to be an I or and L
$base_url .= dirname($_SERVER['REQUEST_UR    I   ']);





"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrote Ronald The Newbie Allen ([EMAIL PROTECTED]):
> >
> > what I currently have is
> >
> >  echo "<META HTTP-EQUIV=\"refresh\" content=\"0;
> > URL=./Conference_Calls.php?Date_and_Time=".$_POST["$Date_and_Time"].">";
>
> Have you looked at what this is actually outputing?
>
> >
> > Tried several things from the string and either they return a parsing
error
> > or they return ".$_POST
> >
> > kind of clueless now....help please
>
> You might want to read:
> http://www.php.net/manual/en/langref.php
>
> It'll give you a better grasp on what  you're trying to do.
>
>
> >
> > The code:
> >
> > <?
> > $event =  $_GET['Event_Type'];
> > $Date_and_Time = $_GET['Date_and_Time'];
>
> You're using $_GET here but $_POST in the output of your meta tag,
> which one is it?
>
> > //echo "$event";
> > //echo "$time";
> > if ($event == "Trouble_Tickets") {
> >  echo '<META HTTP-EQUIV="refresh" content="0;
URL=./Trouble_Tickets.php">';
> > } elseif ($event == "Conference_Calls") {
> >  print '<META HTTP-EQUIV="refresh" content="0;
> > URL=./Conference_Calls.php?Date_and_Time=$_POST["Date_and_Time"]">';
> > } elseif ($event == "Outage_Reports") {
> >  echo '<META HTTP-EQUIV="refresh" content="0;
URL=./Outage_Reports.php">';
> > } else {
> >  echo '<META HTTP-EQUIV="refresh" content="0; URL=./log.php">';
> > }
> >
>
> A few points:
>  - You're if/elseif would better be written with a switch()
>    statment.
>  - You shouldn't really use a meta-refresh, but redirect the user
>    using header().
>  - Learn the difference between how php treats the single quote (')
>    vs the double quote (")
>
>
> <?php // this start tag is highly recommended
>
> // Grab the event from the Query String
> $event = $_GET['Event_Type'];
>
>
> // Make the base url for redirection.
> $base_url  = 'http://' . $_SERVER['HTTP_HOST'];
> $base_url .= dirname($_SERVER['REQUEST_URI']);
>
> switch ($event) {
>
>   case 'Trouble_Tickets':
>     $redirect = $base_url . $event . '.php';
>     break;
>
>   case 'Conference_Calls':
>     $redirect = $base_url . $event . '.php?Date_and_Time='.
$_POST['Date_and_Time'];
>     break;
>
>   case 'Outage_Reports':
>     $redirect = $base_url . $event . '.php';
>     break;
>
>   default:
>     $redirect = $base_url . 'log.php';
>     break;
> }
>
> // Now redirect the user
> header('Location: ' . $redirect);
> exit();
> ?>
>
>
> Curt
> -- 
> "I used to think I was indecisive, but now I'm not so sure."

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

I've just performed a few tests when using PEAR::DB and
the results weren't good at all.

If I compare a script using PEAR::DB with a script using
standard functions (and which supports mysql, pgsql and
sqlite databases), the script using PEAR::DB is 10 times
slower than the other.

In one of my projects, it slows down execution time to
0,7 sec per page !

Conclusion : if you want to use PEAR::DB package, you'll
probably will have to use cache systems for scripts that
may be request often.

Am I the only one annoying by this loss of performance ?
Because this is a huge loss in that case !

Greg
--- End Message ---
--- Begin Message --- Greg wrote:
Hello,

I've just performed a few tests when using PEAR::DB and
the results weren't good at all.

If I compare a script using PEAR::DB with a script using
standard functions (and which supports mysql, pgsql and
sqlite databases), the script using PEAR::DB is 10 times
slower than the other.

In one of my projects, it slows down execution time to
0,7 sec per page !
(original exec time was 0.06 sec)

Conclusion : if you want to use PEAR::DB package, you'll probably will have to use cache systems for scripts that may be request often.

Am I the only one annoying by this loss of performance ?
annoyed
Because this is a huge loss in that case !

Greg

--- End Message ---
--- Begin Message ---
Grrr, i'm posting too fast !
Sorry for mistakes :)

Hello,

I've just performed a few tests when using PEAR::DB and
the results weren't good at all.

If I compare a script using PEAR::DB with a script using
standard functions (and which supports mysql, pgsql and
sqlite databases), the script using PEAR::DB is 10 times
slower than the other.

In one of my projects, it slows down execution time to
0.07 sec per page ! (original exec time was 0.006 sec)

Conclusion : if you want to use PEAR::DB package, you'll
probably will have to use cache systems for scripts that
may be request often.

Am I the only one annoyed by this loss of performance ?
Because this is a huge loss in that case !

Greg
--- End Message ---
--- Begin Message --- Greg wrote:
Hello,

I've just performed a few tests when using PEAR::DB and
the results weren't good at all.

If I compare a script using PEAR::DB with a script using
standard functions (and which supports mysql, pgsql and
sqlite databases), the script using PEAR::DB is 10 times
slower than the other.

In one of my projects, it slows down execution time to
0,7 sec per page !

Conclusion : if you want to use PEAR::DB package, you'll
probably will have to use cache systems for scripts that
may be request often.

Am I the only one annoying by this loss of performance ?
Because this is a huge loss in that case !

Greg

Remember, PEAR::DB also uses the standard functions, so I can't understand, why it should be much slower.


Rainer
--- End Message ---

Reply via email to