php-general Digest 11 Nov 2002 02:14:57 -0000 Issue 1697

Topics (messages 123687 through 123738):

Re: attachement
        123687 by: Oliver Witt
        123691 by: Ernest E Vogelsinger
        123692 by: Oliver Witt
        123708 by: Jonathan Sharp
        123715 by: Manuel Lemos

Re: Questions on PHP Variables
        123688 by: Ray Seals
        123689 by: Rasmus Lerdorf
        123690 by: Leif K-Brooks
        123693 by: Ernest E Vogelsinger
        123698 by: Rasmus Lerdorf

Strange ....Date problem
        123694 by: Dhaval Desai
        123697 by: Marco Tabini
        123707 by: Rasmus Lerdorf

PHP installation _ help needed
        123695 by: Bob G

Online Booking System/Framework question
        123696 by: Steve Purkiss
        123725 by: olinux

Re: set_error_handler() Keeps Triggering Errors
        123699 by: Monty
        123719 by: Michael Sims

Replacing X-Powered-By header?
        123700 by: Leif K-Brooks
        123701 by: Rasmus Lerdorf

Performance through the 4.x-series
        123702 by: Thomas Seifert
        123704 by: Rasmus Lerdorf
        123716 by: Thomas Seifert
        123718 by: Rasmus Lerdorf

An interesting (at least I think) test
        123703 by: Marco Tabini
        123712 by: Maxim Maletsky
        123717 by: Marco Tabini

2 questions about PHP download
        123705 by: SED
        123706 by: Rasmus Lerdorf

Re: Create associative  array from comments by preg
        123709 by: Jonathan Sharp

Re: Most current non-beta version, and bcc
        123710 by: Jill S
        123711 by: Rasmus Lerdorf

fs functions & unicode
        123713 by: Carlos

enable CLI
        123714 by: Pierre Vaudrey
        123723 by: Pierre Vaudrey

PHP's mail() function doesn't work on my server
        123720 by: unknown

Global variables question
        123721 by: Mathieu Dumoulin
        123731 by: Ernest E Vogelsinger

Re: upload whole direcotry using ftp functions
        123722 by: electroteque

Would appreciate thoughts on session management
        123724 by: Charles Wiltgen
        123726 by: Justin French
        123732 by: Ernest E Vogelsinger
        123733 by: Charles Wiltgen

Re: esayphp
        123727 by: Iguider
        123728 by: Maxim Maletsky
        123729 by: Iguider

mysql DECODE question
        123730 by: Donahue Ben

How good is PHP to ASP?
        123734 by: Wee Keat [Amorphosium]
        123735 by: John Meyer
        123738 by: Khalid El-Kary

missing Parser Error ?
        123736 by: Hatem Ben
        123737 by: Ernest E Vogelsinger

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 ---
Ernest E Vogelsinger schrieb:

> In your mail headers, you should see some MIME like
>
>         Content-Type: multipart/alternative;
>                 boundary=GU4wuTSk68F
>
> ("alternative" could also read "related" - depends on the content, the
> "multipart" is the point here)
>
> which would tell the client browser that the next mail consists of a couple
> of separate parts, with a separator line as "--GU4wuTSk68F".
>

I had it set like this:

$fp = fopen($file, "r");
$contents = fread($fp, $file_size);
$encoded_file = chunk_split(base64_encode($contents));
fclose($fp);

unset($header);
$header = "FROM:$name_abs<$adresse_abs>\n";
$header.= "MIME-version: 1.0\n";
$header.= "Content-type: multipart/mixed; ";
$header.= "boundary=\"Message-Boundary\"\n";
$header.= "Content-transfer-encoding: 7BIT\n";
$header.= "X-attachments: $file_name";

$body = "--Message-Boundary\n";
$body .= "Content-type: text/plain; charset=US-ASCII\n";
$body .= "Content-Disposition: inline";
$body .= "Content-transfer-encoding: 7BIT\n";
$body .= "Content-description: Mail message body\n\n";
$body .= $text;
$body.= "\n\n--Message-Boundary\n";
$body.= "Content-type: $file_type; name=\"$file_name\"\n";
$body.= "Content-Transfer-Encoding: PLAINTEXT\n";
$body.= "Content-disposition: attachment; filename=\"$file_name\"\n\n";
$body.= "$encoded_file\n";
$body.= "--Message-Boundary--\n";

That's the same as a friend of mine uses it. He's saying it's working fine...
I'll try to do what you told me.
Olli

--- End Message ---
--- Begin Message ---
At 15:27 10.11.2002, Oliver Witt said:
--------------------[snip]--------------------
>I had it set like this:
>
>$fp = fopen($file, "r");
>$contents = fread($fp, $file_size);
>$encoded_file = chunk_split(base64_encode($contents));
>fclose($fp);
>
> ...
>
>$body.= "\n\n--Message-Boundary\n";
>$body.= "Content-type: $file_type; name=\"$file_name\"\n";
>$body.= "Content-Transfer-Encoding: PLAINTEXT\n";
>$body.= "Content-disposition: attachment; filename=\"$file_name\"\n\n";
>$body.= "$encoded_file\n";
>$body.= "--Message-Boundary--\n";
--------------------[snip]-------------------- 

You must not give PLAINTEXT as encoding when you have it base64... use:
        Content-Transfer-Encoding: base64

BTW, "PLAINTEXT" is not a MIME recognized encoding type. Excerpt from RFC2045:

--------------------[snip]-------------------- 
5.2. Content-Type Defaults
Default RFC 822 messages without a MIME Content-Type header are taken
by this protocol to be plain text in the US-ASCII character set,
which can be explicitly specified as:

        Content-type: text/plain; charset=us-ascii

This default is assumed if no Content-Type header field is specified.
It is also recommend that this default be assumed when a
syntactically invalid Content-Type header field is encountered. In
the presence of a MIME-Version header field and the absence of any
Content-Type header field, a receiving User Agent can also assume
that plain US-ASCII text was the sender's intent. Plain US-ASCII
text may still be assumed in the absence of a MIME-Version or the
presence of an syntactically invalid Content-Type header field, but
the sender's intent might have been otherwise. 

6.1. Content-Transfer-Encoding Syntax
The Content-Transfer-Encoding field's value is a single token
specifying the type of encoding, as enumerated below. Formally: 

        encoding := "Content-Transfer-Encoding" ":" mechanism

        mechanism := "7bit" / "8bit" / "binary" / 
                     "quoted-printable" / "base64" /
                     ietf-token / x-token

These values are not case sensitive -- Base64 and BASE64 and bAsE64
are all equivalent. An encoding type of 7BIT requires that the body
is already in a 7bit mail-ready representation. This is the default
value -- that is, "Content-Transfer-Encoding: 7BIT" is assumed if the
Content-Transfer-Encoding header field is not present. 
--------------------[snip]-------------------- 

Therefore, for plaintext headings you should use
        Content-type: text/plain
        Content-Transfer-Encoding: 7bit (or 8bit, depends)



-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/


--- End Message ---
--- Begin Message ---
Ernest E Vogelsinger schrieb:

> At 15:27 10.11.2002, Oliver Witt said:
> --------------------[snip]--------------------
> >I had it set like this:
> >
> >$fp = fopen($file, "r");
> >$contents = fread($fp, $file_size);
> >$encoded_file = chunk_split(base64_encode($contents));
> >fclose($fp);
> >
> > ...
> >
> >$body.= "\n\n--Message-Boundary\n";
> >$body.= "Content-type: $file_type; name=\"$file_name\"\n";
> >$body.= "Content-Transfer-Encoding: PLAINTEXT\n";
> >$body.= "Content-disposition: attachment; filename=\"$file_name\"\n\n";
> >$body.= "$encoded_file\n";
> >$body.= "--Message-Boundary--\n";
> --------------------[snip]--------------------
>
> You must not give PLAINTEXT as encoding when you have it base64... use:
>         Content-Transfer-Encoding: base64
>
> BTW, "PLAINTEXT" is not a MIME recognized encoding type. Excerpt from RFC2045:
>
> --------------------[snip]--------------------
> 5.2. Content-Type Defaults
> Default RFC 822 messages without a MIME Content-Type header are taken
> by this protocol to be plain text in the US-ASCII character set,
> which can be explicitly specified as:
>
>         Content-type: text/plain; charset=us-ascii
>
> This default is assumed if no Content-Type header field is specified.
> It is also recommend that this default be assumed when a
> syntactically invalid Content-Type header field is encountered. In
> the presence of a MIME-Version header field and the absence of any
> Content-Type header field, a receiving User Agent can also assume
> that plain US-ASCII text was the sender's intent. Plain US-ASCII
> text may still be assumed in the absence of a MIME-Version or the
> presence of an syntactically invalid Content-Type header field, but
> the sender's intent might have been otherwise.
>
> 6.1. Content-Transfer-Encoding Syntax
> The Content-Transfer-Encoding field's value is a single token
> specifying the type of encoding, as enumerated below. Formally:
>
>         encoding := "Content-Transfer-Encoding" ":" mechanism
>
>         mechanism := "7bit" / "8bit" / "binary" /
>                      "quoted-printable" / "base64" /
>                      ietf-token / x-token
>
> These values are not case sensitive -- Base64 and BASE64 and bAsE64
> are all equivalent. An encoding type of 7BIT requires that the body
> is already in a 7bit mail-ready representation. This is the default
> value -- that is, "Content-Transfer-Encoding: 7BIT" is assumed if the
> Content-Transfer-Encoding header field is not present.
> --------------------[snip]--------------------
>
> Therefore, for plaintext headings you should use
>         Content-type: text/plain
>         Content-Transfer-Encoding: 7bit (or 8bit, depends)
>
> --
>    >O     Ernest E. Vogelsinger
>    (\)    ICQ #13394035
>     ^     http://www.vogelsinger.at/

thanks you very much, that's it, it's working perfectly now!!!
thx, Olli



--- End Message ---
--- Begin Message ---
see http://phpmailer.sourceforge.net

-js


Oliver Witt wrote:
> Hi,
> I wrote a php script that's supposed to enable me to attach files to an
> email. However, the attached files ends up being a mess of letters.
> "Hallo" becomes "SGFsbG8=". That must have to do with encoding. Is that
> a common problem or do you need the entire script?
> Thanks,
> Olli
> 
> 



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

On 11/10/2002 11:31 AM, Oliver Witt wrote:
Hi,
I wrote a php script that's supposed to enable me to attach files to an
email. However, the attached files ends up being a mess of letters.
"Hallo" becomes "SGFsbG8=". That must have to do with encoding. Is that
a common problem or do you need the entire script?
You need to specify that the encoding is base64.

You may want to try this class that is able to compose and send complex messages that include adding attachments, HTML messages with embedded images, message bodies with alternative text and HTML versions, etc..

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
> The fact that tutorials are outdated & using old code is not a good reason
> to stick with it :)

I agree totally.

So I'm trying to use the $_Server variables but I continue to get this
error:

Parse error: parse error, expecting 'T_STRNG' or 'T_VARIABLE' or
'T_NUM_STRING' in <blah, blah, blah> on line 33.

Here is the script that is doing this:

<?php


        // File Name: auth04.php
        // Check to see if $PHP_AUTH_USER already contains info

        if (!isset($_SERVER["PHP_AUTH_USER"])) {

                // If empty, send header causing dialog box to appear

                header('WWW-Authenticate: Basic realm="My Private
Stuff"');
                header('HTTP/1.0 401 Unauthorized');
                exit;

        } else if (isset($_SERVER["PHP_AUTH_USER"])) {

                // If non-empty, check the database for matches
                // connect to MySQL

                mysql_connect("hostname", "username", "password")

                        or die ("Unable to connect to database.");

                // select database on MySQL server

                mysql_select_db("dev_i2ii_com")
                        or die ("Unable to select database.");

                // Formulate the query

                $sql = "SELECT *
                FROM users
                WHERE username='$_SERVER["PHP_AUTH_USER"]' and
password='$_SERVER["PHP_AUTH_PW"]'";



                // Execute the query and put results in $result

                $result = mysql_query($sql);

                // Get number of rows in $result. 0 if invalid, 1 if
valid.

                $num = mysql_numrows($result);

                if ($num != "0") {
                        echo "<P>You're authorized!</p>";
                        exit;

                } else {

                        header('WWW-Authenticate: Basic realm="My
Private Stuff"');
                        header('HTTP/1.0 401 Unauthorized');
                        echo 'Authorization Required.';
                        exit;

                }

        }



?>

----------------------
The data base stuff hasn't been put in yet, I'm just trying to get the
script to load cleanly before I trouble shoot the database connector
side.

Ray

--- End Message ---
--- Begin Message ---
Don't use quotes around the array index inside a quoted string.

-Rasmus

On 10 Nov 2002, Ray Seals wrote:

> > The fact that tutorials are outdated & using old code is not a good reason
> > to stick with it :)
>
> I agree totally.
>
> So I'm trying to use the $_Server variables but I continue to get this
> error:
>
> Parse error: parse error, expecting 'T_STRNG' or 'T_VARIABLE' or
> 'T_NUM_STRING' in <blah, blah, blah> on line 33.
>
> Here is the script that is doing this:
>
> <?php
>
>
>         // File Name: auth04.php
>         // Check to see if $PHP_AUTH_USER already contains info
>
>         if (!isset($_SERVER["PHP_AUTH_USER"])) {
>
>                 // If empty, send header causing dialog box to appear
>
>                 header('WWW-Authenticate: Basic realm="My Private
> Stuff"');
>                 header('HTTP/1.0 401 Unauthorized');
>                 exit;
>
>         } else if (isset($_SERVER["PHP_AUTH_USER"])) {
>
>                 // If non-empty, check the database for matches
>                 // connect to MySQL
>
>                 mysql_connect("hostname", "username", "password")
>
>                         or die ("Unable to connect to database.");
>
>                 // select database on MySQL server
>
>                 mysql_select_db("dev_i2ii_com")
>                         or die ("Unable to select database.");
>
>                 // Formulate the query
>
>                 $sql = "SELECT *
>                 FROM users
>                 WHERE username='$_SERVER["PHP_AUTH_USER"]' and
> password='$_SERVER["PHP_AUTH_PW"]'";
>
>
>
>                 // Execute the query and put results in $result
>
>                 $result = mysql_query($sql);
>
>                 // Get number of rows in $result. 0 if invalid, 1 if
> valid.
>
>                 $num = mysql_numrows($result);
>
>                 if ($num != "0") {
>                         echo "<P>You're authorized!</p>";
>                         exit;
>
>                 } else {
>
>                         header('WWW-Authenticate: Basic realm="My
> Private Stuff"');
>                         header('HTTP/1.0 401 Unauthorized');
>                         echo 'Authorization Required.';
>                         exit;
>
>                 }
>
>         }
>
>
>
> ?>
>
> ----------------------
> The data base stuff hasn't been put in yet, I'm just trying to get the
> script to load cleanly before I trouble shoot the database connector
> side.
>
> Ray
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Uh, no.  That makes it think it's a constant, which generates a notice.

Rasmus Lerdorf wrote:

Don't use quotes around the array index inside a quoted string.

-Rasmus

On 10 Nov 2002, Ray Seals wrote:


The fact that tutorials are outdated & using old code is not a good reason
to stick with it :)

I agree totally.

So I'm trying to use the $_Server variables but I continue to get this
error:

Parse error: parse error, expecting 'T_STRNG' or 'T_VARIABLE' or
'T_NUM_STRING' in <blah, blah, blah> on line 33.

Here is the script that is doing this:

<?php


// File Name: auth04.php
// Check to see if $PHP_AUTH_USER already contains info

if (!isset($_SERVER["PHP_AUTH_USER"])) {

// If empty, send header causing dialog box to appear

header('WWW-Authenticate: Basic realm="My Private
Stuff"');
header('HTTP/1.0 401 Unauthorized');
exit;

} else if (isset($_SERVER["PHP_AUTH_USER"])) {

// If non-empty, check the database for matches
// connect to MySQL

mysql_connect("hostname", "username", "password")

or die ("Unable to connect to database.");

// select database on MySQL server

mysql_select_db("dev_i2ii_com")
or die ("Unable to select database.");

// Formulate the query

$sql = "SELECT *
FROM users
WHERE username='$_SERVER["PHP_AUTH_USER"]' and
password='$_SERVER["PHP_AUTH_PW"]'";



// Execute the query and put results in $result

$result = mysql_query($sql);

// Get number of rows in $result. 0 if invalid, 1 if
valid.

$num = mysql_numrows($result);

if ($num != "0") {
echo "<P>You're authorized!</p>";
exit;

} else {

header('WWW-Authenticate: Basic realm="My
Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;

}

}



?>

----------------------
The data base stuff hasn't been put in yet, I'm just trying to get the
script to load cleanly before I trouble shoot the database connector
side.

Ray


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




--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.


--- End Message ---
--- Begin Message ---
At 15:28 10.11.2002, Ray Seals said:
--------------------[snip]--------------------
>Parse error: parse error, expecting 'T_STRNG' or 'T_VARIABLE' or
>'T_NUM_STRING' in <blah, blah, blah> on line 33.
>
>Here is the script that is doing this:
>
> [...]
>
>                $sql = "SELECT *
>                FROM users
>                WHERE username='$_SERVER["PHP_AUTH_USER"]' and
>password='$_SERVER["PHP_AUTH_PW"]'";
--------------------[snip]-------------------- 

You need to put the array dereference in curly brackets:

$sql = "SELECT *
     FROM users
        WHERE username='{$_SERVER['PHP_AUTH_USER']}' and
        password='{$_SERVER['PHP_AUTH_PW']}'";

Note that I used single quotes within the array - it's for the paranoid
like me only, it's a few nanosecs faster :)


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/


--- End Message ---
--- Begin Message ---
Uh, no.  Your problem is obvious:

   $sql = "SELECT *
           FROM users
           WHERE username='$_SERVER["PHP_AUTH_USER"]' and
           password='$_SERVER["PHP_AUTH_PW"]'";

You have double-quotes inside a double-quoted string.

Like I said, don't use quotes around the array index inside a quoted
string.  So change the above to:

   $sql = "SELECT *
           FROM users
           WHERE username='$_SERVER[PHP_AUTH_USER]' and
           password='$_SERVER[PHP_AUTH_PW]'";

Constants are not expanded inside a quoted string, so that is the correct
way to handle array indices if you want to keep them inside the quoted
string.

-Rasmus

On Sun, 10 Nov 2002, Leif K-Brooks wrote:

> Uh, no.  That makes it think it's a constant, which generates a notice.
>
> Rasmus Lerdorf wrote:
>
> >Don't use quotes around the array index inside a quoted string.
> >
> >-Rasmus
> >
> >On 10 Nov 2002, Ray Seals wrote:
> >
> >
> >
> >>>The fact that tutorials are outdated & using old code is not a good reason
> >>>to stick with it :)
> >>>
> >>>
> >>I agree totally.
> >>
> >>So I'm trying to use the $_Server variables but I continue to get this
> >>error:
> >>
> >>Parse error: parse error, expecting 'T_STRNG' or 'T_VARIABLE' or
> >>'T_NUM_STRING' in <blah, blah, blah> on line 33.
> >>
> >>Here is the script that is doing this:
> >>
> >><?php
> >>
> >>
> >>        // File Name: auth04.php
> >>        // Check to see if $PHP_AUTH_USER already contains info
> >>
> >>        if (!isset($_SERVER["PHP_AUTH_USER"])) {
> >>
> >>                // If empty, send header causing dialog box to appear
> >>
> >>                header('WWW-Authenticate: Basic realm="My Private
> >>Stuff"');
> >>                header('HTTP/1.0 401 Unauthorized');
> >>                exit;
> >>
> >>        } else if (isset($_SERVER["PHP_AUTH_USER"])) {
> >>
> >>                // If non-empty, check the database for matches
> >>                // connect to MySQL
> >>
> >>                mysql_connect("hostname", "username", "password")
> >>
> >>                        or die ("Unable to connect to database.");
> >>
> >>                // select database on MySQL server
> >>
> >>                mysql_select_db("dev_i2ii_com")
> >>                        or die ("Unable to select database.");
> >>
> >>                // Formulate the query
> >>
> >>                $sql = "SELECT *
> >>                FROM users
> >>                WHERE username='$_SERVER["PHP_AUTH_USER"]' and
> >>password='$_SERVER["PHP_AUTH_PW"]'";
> >>
> >>
> >>
> >>                // Execute the query and put results in $result
> >>
> >>                $result = mysql_query($sql);
> >>
> >>                // Get number of rows in $result. 0 if invalid, 1 if
> >>valid.
> >>
> >>                $num = mysql_numrows($result);
> >>
> >>                if ($num != "0") {
> >>                        echo "<P>You're authorized!</p>";
> >>                        exit;
> >>
> >>                } else {
> >>
> >>                        header('WWW-Authenticate: Basic realm="My
> >>Private Stuff"');
> >>                        header('HTTP/1.0 401 Unauthorized');
> >>                        echo 'Authorization Required.';
> >>                        exit;
> >>
> >>                }
> >>
> >>        }
> >>
> >>
> >>
> >>?>
> >>
> >>----------------------
> >>The data base stuff hasn't been put in yet, I'm just trying to get the
> >>script to load cleanly before I trouble shoot the database connector
> >>side.
> >>
> >>Ray
> >>
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >>
> >
> >
> >
> >
>
> --
> The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
>to decrypt it will be prosecuted to the full extent of the law.
>
>
>

--- End Message ---
--- Begin Message --- Hi!

If you try this in php:

2002-01-6 > 2002-01-10
returns true

2002-01-6 > 2002-01-9
returns false

Jut a leading 0 in the date makes it false...this is really strange..

Any comments?





_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail

--- End Message ---
--- Begin Message ---
I think you should convert them to dates--otherwise the server compares
them as strings.


Marco

-- 
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com


On Sun, 2002-11-10 at 09:56, Dhaval Desai wrote:
> Hi!
> 
> If you try this in php:
> 
> 2002-01-6 > 2002-01-10
> returns true
> 
> 2002-01-6 > 2002-01-9
> returns false
> 
> Jut a leading 0 in the date makes it false...this is really strange..
> 
> Any comments?
> 
> 
> 
> 
> 
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*. 
> http://join.msn.com/?page=features/featuredemail
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message ---
Why is it strange?  By default strings are sorted alphabetically.  6 > 10
when sorted alphabetically.  Convert your strings to numbers in some
logical manner and compare numbers or easier, use strnatcmp() to compare
the strings directly using a natural alphanumeric comparison.

-Rasmus

On Sun, 10 Nov 2002, Dhaval Desai wrote:

> Hi!
>
> If you try this in php:
>
> 2002-01-6 > 2002-01-10
> returns true
>
> 2002-01-6 > 2002-01-9
> returns false
>
> Jut a leading 0 in the date makes it false...this is really strange..
>
> Any comments?
>
>
>
>
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Hi people!
    I have MySQL working with ASP under win2000 and IIS. I have recently
tried unsuccessfully  to install PHP. Initially I started with zip binary
distribution. I tested it with:-
<html>
<head>
<title>PHP Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<?php echo "Hello World<p>"; ?>
</body>
</html>
Couldn't be much simpler!

Nothing worked but "view source" showed the above code. The implication
being that the sever did not parse the code.
I then deleted every thing and tried "InstallShield" with exactly the same
result.
I have reinstalled IIS - no change
I have added PHP to the application mapping.
I have given exec permissions to C:/PHP
The setup instructions say that I must rename PHP TO PHP.INI in WINNT and
that is all. Is this true. If not what precisely must I do?
Failing the .INI question I think I have done everything in the OPINS. But
you guys will know better. What have I missed?
All thoughts gratefully appreciated
Thanks Bob



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

I wrote a site a while back which has a booking system for event guest
lists. It was my first venture into PHP, and now that it needs some more
work done on it (mainly making the site more open so people don't have to
sign up until they book on the guest list)  I really want to rework the
back-end (making it object-oriented like I should have done in the first
place, cutting down the number of database requests, getting rid of the
JavaScript validation, etc.), and I want to obviously make the most use of
any classes/frameworks that are already out there.

I've been looking at CMS such as PostNuke, but most seem to be an overkill
for what I need, and the aesthetic design is pretty specific so it has to
fit into that. I've also looked at using ADODB, which seems pretty useful,
and PEAR, which seems to do the same and a bit more, such as HTML templates.
I can find many membership management systems, but as yet haven't found any
open source booking systems - anyone know of any or should I bear this in
mind and release one from the outcome of this development?

Can anyone recommend frameworks/starting points/websites that could be
useful to me? I seem to be going round in circles at the moment and don't
want to go for one particular solution in case it's the 'wrong' one and I
regret it later. Once I go for a particular solution, it's going to take a
lot of learning, so I don't want to (and can't afford to) waste lots of time
on the wrong one.

The site is http://www.belugablues.com (there's no events on it at the
moment - the content manager hasn't quite got round the concept of having to
keep a site up-to-date, but will do :O) - you can log in using the username
'testing' and password '123123'

Many thanks in advance for your advice and help,

Steve Purkiss




--- End Message ---
--- Begin Message ---
Lots of good ideas here:
http://www.databaseanswers.com/data_models/index.htm

olinux


--- Steve Purkiss <[EMAIL PROTECTED]>
wrote:
> Hi all,
> 
> I wrote a site a while back which has a booking
> system for event guest
> lists. It was my first venture into PHP, and now
> that it needs some more
> work done on it (mainly making the site more open so
> people don't have to
> sign up until they book on the guest list)  I really
> want to rework the
> back-end (making it object-oriented like I should
> have done in the first
> place, cutting down the number of database requests,
> getting rid of the
> JavaScript validation, etc.), and I want to
> obviously make the most use of
> any classes/frameworks that are already out there.
> 
> I've been looking at CMS such as PostNuke, but most
> seem to be an overkill
> for what I need, and the aesthetic design is pretty
> specific so it has to
> fit into that. I've also looked at using ADODB,
> which seems pretty useful,
> and PEAR, which seems to do the same and a bit more,
> such as HTML templates.
> I can find many membership management systems, but
> as yet haven't found any
> open source booking systems - anyone know of any or
> should I bear this in
> mind and release one from the outcome of this
> development?
> 
> Can anyone recommend frameworks/starting
> points/websites that could be
> useful to me? I seem to be going round in circles at
> the moment and don't
> want to go for one particular solution in case it's
> the 'wrong' one and I
> regret it later. Once I go for a particular
> solution, it's going to take a
> lot of learning, so I don't want to (and can't
> afford to) waste lots of time
> on the wrong one.
> 
> The site is http://www.belugablues.com (there's no
> events on it at the
> moment - the content manager hasn't quite got round
> the concept of having to
> keep a site up-to-date, but will do :O) - you can
> log in using the username
> 'testing' and password '123123'
> 
> Many thanks in advance for your advice and help,
> 
> Steve Purkiss
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2
--- End Message ---
--- Begin Message ---
Hi Earnest. I found these user notes in the PHP manual, but, it's confusing
and seems to be a bit contradictory:

-----[snip]-----

error_reporting() has no effect if you have defined your own error handler
with set_error_handler()

[Editor's Note: This is not quite accurate.

E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR and
E_COMPILE_WARNING error levels will be handled as per the error_reporting
settings. 

All other levels of errors will be passed to the custom error handler
defined by set_error_handler().

-----[/snip]-----

PHP's error-handling seems to need to re-working. I just can't get this to
work after having tried some other things I found online. All I want is for
PHP to NOT report E_NOTICE errors, but, there seems to be no way to do this,
even if I re-define the E_NOTICE constant vars.

Thanks.


> From: [EMAIL PROTECTED] (Ernest E Vogelsinger)
> Newsgroups: php.general
> Date: Sun, 10 Nov 2002 10:42:05 +0100
> To: Monty <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] set_error_handler() Keeps Triggering Errors
> 
> At 06:34 10.11.2002, Monty said:
> --------------------[snip]--------------------
>> When I use set_error_handler('error_function') in my scripts, errors are
>> constantly being triggered that I've never seen before. If I comment the
>> handler function out, the errors go away. I have the error reporting set
>> very loosely: error_reporting (E_ERROR | E_USER_ERROR) - so not sure why it
> 
> It's somewhere in the docs - can't remember where just now, I believe
> isomewhere in the user comments for error_handler:
> 
> your error_handler gets _all_ type of error,warning,notice, regardless of
> the actual setting of error_reporting (which only decides if the
> error/warning/notice gets sent to the client or not).
> 
>> keeps triggering an error, because the error I keep getting is:
>> 
>> Undefined variable: target
>> 
>> This is the same error message no matter what script I run. I don't even use
>> a variable named $target anywhere in any of my scripts, so, this is
>> baffling. And this seems like an E_NOTICE error message, but, I'm only
>> asking for E_ERROR and E_USER_ERROR notices.
> --------------------[snip]--------------------
> 
> Might point to a dynamic variable named target:
> 
> <?php
> error_reporting(E_ALL);
> $varname = 'target';
> if ($$varname) {
> ;
> }
> ?>
> 
> 
> gets me
> Notice: Undefined variable: target in /www/test/test.php on line 4
> 
> Do a grep for "target" on your source files.
> 
> 
> -- 
>> O     Ernest E. Vogelsinger
> (\)    ICQ #13394035
> ^     http://www.vogelsinger.at/
> 
> 

--- End Message ---
--- Begin Message ---
On Sun, 10 Nov 2002 10:48:46 -0500, you wrote:

>Hi Earnest. I found these user notes in the PHP manual, but, it's confusing
>and seems to be a bit contradictory:

It's simple:  A user defined error handler cannot handle parse errors
or compile time errors.  That makes sense to me...if your script
doesn't parse and can't complete the compile phase then how would you
expect your custom function to be able to handle the error?  It hasn't
been compiled yet...

>I just can't get this to
>work after having tried some other things I found online. All I want is for
>PHP to NOT report E_NOTICE errors, but, there seems to be no way to do this,
>even if I re-define the E_NOTICE constant vars.

The answer is in the editor's note that you quoted, two paragraphs
after you snipped the quote:

"if (!($type & error_reporting())) return;"

$type is the error code..i.e. the first parameter passed to your error
handler.  Add that line to the top of your error handling function and
it will behave the way you expect.

PHP's error reporting value is a bitmask...a combination of all of the
error type constants that you want PHP to report.  The line of code
above takes the current error's bit value and does a bitwise AND with
the error reporting level.  If the result is 0, that means that the
current error's bit value is not turned on in the current error
reporting level.  If this is so, then the line above will return from
your error handling function without doing anything...effectively
ignoring the error.
--- End Message ---
--- Begin Message --- I'm trying to replace the X-Powered-By header out of security concerns. I know it can't really hurt - just me being paranoid. Anyway, I'm using:

header("X-Powered-By: somethingthatisntphp",true);

But it has 2 headers. Is there any way to do this?

--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.


--- End Message ---
--- Begin Message ---
See the expose_php php.ini directive.

On Sun, 10 Nov 2002, Leif K-Brooks wrote:

> I'm trying to replace the X-Powered-By header out of security concerns.
>  I know it can't really hurt - just me being paranoid.  Anyway, I'm using:
>
> header("X-Powered-By: somethingthatisntphp",true);
>
> But it has 2 headers.  Is there any way to do this?
>
> --
> The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
>to decrypt it will be prosecuted to the full extent of the law.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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

did anyone do any Performance measurement through the php4.x-series?

I've heard that the performance decreased from 4.0.x to 4.1.x to 4.2.x ... ?

Are there any numbers or benchmarks for this?


Thanks in advance,

Thomas
--- End Message ---
--- Begin Message ---
You have heard?  There have been a number of performance improvements in
many different areas of php actually.

-Rasmus

On Sun, 10 Nov 2002, Thomas Seifert wrote:

> Hi there,
>
> did anyone do any Performance measurement through the php4.x-series?
>
> I've heard that the performance decreased from 4.0.x to 4.1.x to 4.2.x ... ?
>
> Are there any numbers or benchmarks for this?
>
>
> Thanks in advance,
>
> Thomas
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Sorry, yeah I've heard and I cannot prove it, therefore I ask.
I didn't want to troll or similar, just curious about it.

Are there any benchmarks through the different versions with a common-app
or similar available?


Regards,

Thomas

On Sun, 10 Nov 2002 08:08:04 -0800 (PST) Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:

> You have heard?  There have been a number of performance improvements in
> many different areas of php actually.
> 
> -Rasmus
> 
> On Sun, 10 Nov 2002, Thomas Seifert wrote:
> 
> > Hi there,
> >
> > did anyone do any Performance measurement through the php4.x-series?
> >
> > I've heard that the performance decreased from 4.0.x to 4.1.x to 4.2.x ... ?
> >
> > Are there any numbers or benchmarks for this?
> >
> >
> > Thanks in advance,
> >
> > Thomas
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 
--- End Message ---
--- Begin Message ---
Not that I know of.

On Sun, 10 Nov 2002, Thomas Seifert wrote:

> Sorry, yeah I've heard and I cannot prove it, therefore I ask.
> I didn't want to troll or similar, just curious about it.
>
> Are there any benchmarks through the different versions with a common-app
> or similar available?
>
>
> Regards,
>
> Thomas
>
> On Sun, 10 Nov 2002 08:08:04 -0800 (PST) Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
>
> > You have heard?  There have been a number of performance improvements in
> > many different areas of php actually.
> >
> > -Rasmus
> >
> > On Sun, 10 Nov 2002, Thomas Seifert wrote:
> >
> > > Hi there,
> > >
> > > did anyone do any Performance measurement through the php4.x-series?
> > >
> > > I've heard that the performance decreased from 4.0.x to 4.1.x to 4.2.x ... ?
> > >
> > > Are there any numbers or benchmarks for this?
> > >
> > >
> > > Thanks in advance,
> > >
> > > Thomas
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
>

--- End Message ---
--- Begin Message ---
Hey all, I was playing around this morning with a little test to decide
whether string substitution is faster or slower than concatenation. I
figured that, since printing variable values is one of the most common
actions in a script finding which method is best would be important.
I've been suspecting that string substitution was slower and have tried
not to use it as a general rule of thumbs.

I found it sort-of interesting that--at least according to my
test--string substitution is significantly slower than concatenation by
quite a bit (like 40%).

Here's my script--let me know if you find any flaws that skew the
results:

<?

$num_tries = 500000;

function print_microtime($t)
{
        $t = explode (' ', $t);
        return number_format ($t[1]+$t[0], 10);
}
function print_microtime_diff($t1, $t2, &$res)
{
        $t1 = explode (' ', $t1);
        $t2 = explode (' ', $t2);

        $res = ($t2[1] + $t2[0]) - ($t1[1] + $t1[0]);

        return number_format ($res, 10);
}


$start = microtime();

$s = 'test string';

for ($i = 0; $i < $num_tries; $i++)
        $a = 'test ' . $s . ' string';

$end = microtime();

echo "Normal concatenation\n";
echo 'Start: ' . print_microtime($start) . "\n";
echo 'End:   ' . print_microtime($end) . "\n";
echo 'Diff:  ' . print_microtime_diff ($start, $end, $diff1) . "\n\n";

$start = microtime();

$s = 'test string';

for ($i = 0; $i < $num_tries; $i++)
        $a = "test $s string";

$end = microtime();

echo "String substitution\n";
echo 'Start: ' . print_microtime($start) . "\n";
echo 'End:   ' . print_microtime($end) . "\n";
echo 'Diff:  ' . print_microtime_diff ($start, $end, $diff2) . "\n\n";

echo 'Difference in timing: ' . ($diff2 - $diff1) . ' (' . number_format
(($diff2 - $diff1) / $diff1 * 100, 2) . "%)\n\n";

?>



--- End Message ---
--- Begin Message ---
I think you shouldn't be care much about it as I would call it with one
word - paranoia.

I have made these tests long ago and some are even present on
www.phpbeginner.com. Basically double quotes with one or two variables
in it is faster. Then goes concatenation via single quotes and dot. But,
the fastest of all is actually inline php (when you leave php with ?>
and return to it again <?php).

Anyhow, these can rarely be of any importance to you as this makes
really no big difference within the script. Assuming you learn how to
use it -- you will save %0.001 percent of execution speed.

Simply use single quotes all the time unless you need to stick variables
into the string.

-- 
Maxim Maletsky
[EMAIL PROTECTED]


On 10 Nov 2002 10:51:49 -0500 Marco Tabini <[EMAIL PROTECTED]> wrote:

> Hey all, I was playing around this morning with a little test to decide
> whether string substitution is faster or slower than concatenation. I
> figured that, since printing variable values is one of the most common
> actions in a script finding which method is best would be important.
> I've been suspecting that string substitution was slower and have tried
> not to use it as a general rule of thumbs.
> 
> I found it sort-of interesting that--at least according to my
> test--string substitution is significantly slower than concatenation by
> quite a bit (like 40%).
> 
> Here's my script--let me know if you find any flaws that skew the
> results:
> 
> <?
> 
> $num_tries = 500000;
> 
> function print_microtime($t)
> {
>       $t = explode (' ', $t);
>       return number_format ($t[1]+$t[0], 10);
> }
> function print_microtime_diff($t1, $t2, &$res)
> {
>       $t1 = explode (' ', $t1);
>       $t2 = explode (' ', $t2);
> 
>       $res = ($t2[1] + $t2[0]) - ($t1[1] + $t1[0]);
> 
>       return number_format ($res, 10);
> }
> 
> 
> $start = microtime();
> 
> $s = 'test string';
> 
> for ($i = 0; $i < $num_tries; $i++)
>       $a = 'test ' . $s . ' string';
> 
> $end = microtime();
> 
> echo "Normal concatenation\n";
> echo 'Start: ' . print_microtime($start) . "\n";
> echo 'End:   ' . print_microtime($end) . "\n";
> echo 'Diff:  ' . print_microtime_diff ($start, $end, $diff1) . "\n\n";
> 
> $start = microtime();
> 
> $s = 'test string';
> 
> for ($i = 0; $i < $num_tries; $i++)
>       $a = "test $s string";
> 
> $end = microtime();
> 
> echo "String substitution\n";
> echo 'Start: ' . print_microtime($start) . "\n";
> echo 'End:   ' . print_microtime($end) . "\n";
> echo 'Diff:  ' . print_microtime_diff ($start, $end, $diff2) . "\n\n";
> 
> echo 'Difference in timing: ' . ($diff2 - $diff1) . ' (' . number_format
> (($diff2 - $diff1) / $diff1 * 100, 2) . "%)\n\n";
> 
> ?>
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
> 
> I have made these tests long ago and some are even present on
> www.phpbeginner.com. Basically double quotes with one or two variables
> in it is faster. Then goes concatenation via single quotes and dot. But,
> the fastest of all is actually inline php (when you leave php with ?>
> and return to it again <?php).
> 

Except concatenation is the fastest in my tests...

But, yeah, it's probably not all *that* important. :-)

--- End Message ---
--- Begin Message ---
Is it possible to use the PHP-extentions for Apahce with the PHP for the
CGI version, while the version number matches?

What is the md5-hash beneath the download for?


Regards,
Sumarlidi E. Dadason

SED - Graphic Design
_________________________________
Tel: 896-0376, 461-5501
E-mail: [EMAIL PROTECTED]
website: www.sed.is

--- End Message ---
--- Begin Message ---
> Is it possible to use the PHP-extentions for Apahce with the PHP for the
> CGI version, while the version number matches?

Yes

> What is the md5-hash beneath the download for?

To verify that the file you download (from a mirror, for example) matches
the official tarball from www.php.net and hasn't been modified in some
way.  Check it with md5sum from the command line.

-Rasmus

--- End Message ---
--- Begin Message ---
Here's the code...

-js


$string = <<<EOF
<!-- comname 1--!>
value 1
<!-- end comname 1--!>

<!-- comname 2--!>
value 2
<!-- end comname 2--!>
EOF;

preg_match_all('/<!--\s*(.*)\s*--!>\s*(.*)\s*<!--\s*end\s*\\1\s*--!>/i',
$string, $matched);
$array = array();
foreach ( $matched[1] AS $i => $m )
{
    $array[$m] = $matched[2][$i];
}



Alawi albaity wrote:
> I have comments like that : 
> <!-- comname1 --!>
> value1 
> <!-- end comname1 --!>
> 
> <!-- comname2 --!>
> value2 
> <!-- end comname2 --!>
> Now : 
> How can me get associative array like this
> $var["comname1"] = "value1";
> $var["comname2"] = "value2";
> 
> can any body help me to do that ?
> 
> 



--- End Message ---
--- Begin Message ---
Thanks to everyone who kindly responded with 
their views regarding whether or not PHP v.4.2.3.
is a "beta" version or not a "beta" version.

Because the opinions offered were so adamant and 
so contradictory, I contacted Zend.   I just received
the reply (below)...

  Hi Jill,  Nice talking with you the other day and thanks 
  for your follow-up email.  PHP v. 4.2.3 is definitely not 
  a beta version. I checked with Zev Suraski who is one 
  of the developers of the Zend engine, the scripting 
  language that powers PHP.

____________________________________________


At 09:16 PM 11/7/02 -0700, you wrote:
>At 02:38 PM 11/7/02 -0600, Jill S wrote:
>>so again I'll ask - Are the  4.2.3 downloads at the top of the
>>page at: http://www.php.net/downloads/  "beta versions" or
>>non-"beta" versions?
>
>4.2.3 is currently the latest stable released version of PHP.  Yes, that 
>means NOT BETA.
>
>Anything that makes it to the downloads page is stable code.
>
>
>4.3.0 should be out soon, but is not yet considered stable.  It has also 
>passed the BETA state and is in its second pre-release final testing.
>
>
>If you want to get it you have to look at snaps.php.net or the CVS 
>server.  Code from these sources is under active development and at any 
>given time may not even compile. (Not that it happens often.) I can 
>understand why a hosting provider might not want to run them.  On the other 
>hand I switched to PHP4 at Beta 2 and never looked back.
>
>Rick

--- End Message ---
--- Begin Message ---
Who in the world told you that 4.2.3 was beta?

On Sun, 10 Nov 2002, Jill S wrote:

> Thanks to everyone who kindly responded with
> their views regarding whether or not PHP v.4.2.3.
> is a "beta" version or not a "beta" version.
>
> Because the opinions offered were so adamant and
> so contradictory, I contacted Zend.   I just received
> the reply (below)...
>
>   Hi Jill,  Nice talking with you the other day and thanks
>   for your follow-up email.  PHP v. 4.2.3 is definitely not
>   a beta version. I checked with Zev Suraski who is one
>   of the developers of the Zend engine, the scripting
>   language that powers PHP.
>
> ____________________________________________
>
>
> At 09:16 PM 11/7/02 -0700, you wrote:
> >At 02:38 PM 11/7/02 -0600, Jill S wrote:
> >>so again I'll ask - Are the  4.2.3 downloads at the top of the
> >>page at: http://www.php.net/downloads/  "beta versions" or
> >>non-"beta" versions?
> >
> >4.2.3 is currently the latest stable released version of PHP.  Yes, that
> >means NOT BETA.
> >
> >Anything that makes it to the downloads page is stable code.
> >
> >
> >4.3.0 should be out soon, but is not yet considered stable.  It has also
> >passed the BETA state and is in its second pre-release final testing.
> >
> >
> >If you want to get it you have to look at snaps.php.net or the CVS
> >server.  Code from these sources is under active development and at any
> >given time may not even compile. (Not that it happens often.) I can
> >understand why a hosting provider might not want to run them.  On the other
> >hand I switched to PHP4 at Beta 2 and never looked back.
> >
> >Rick
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Php file system functions seem to hate unicode paths or filenames. I was
working on generic download script and it works fine for regular ascii(?)
files but when i tried a unicode-named file it failed.

$file1 = c:\blah\I've Sound [Air] 鳥の詩(Lia).mp3
$file2 = c:\blah\bleh.mp3

readfile, fopen, filesize etc... fail on $file1, but succeed on $file2.

consider the following:

$fn = $_POST["filename"];
$enfn = urlencode($_POST["filename"]);
header ("Content-type: octet/stream");
header ("Content-disposition: attachment; filename=".basename($encfn).";");
header ("Content-Length: ".filesize($fn)); //fails
readfile($fn); //fails
exit;

is unicode support in filesystem functions non-existant or am i doing
something wrong?
is there a work around?


--- End Message ---
--- Begin Message --- I'm running PHP4 on Mac OS 10.2.1 using Marc Liyanage's binaries compiled with --disable-cli option .Is there any possibility to install an extension to enable CLI ?
Thanks for your help .

Pierre Vaudrey
email [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Le dimanche, 10 nov 2002, 12:24 Europe/Paris, .: B i g D o g :. a crit :

The best way to enable cli is to re-configure php without apache and
everything else you want.
You mean 2 PHP implementation : one for Apache(existing) and a new one standalone ?

I like to add --bindir to the configuration so i can put the executable
in the /usr/local/bin directory for my cli programs..

This should work for you and create a cli executable program that you
can use...



On Sun, 2002-11-10 at 18:00, Pierre Vaudrey wrote:
I'm running PHP4 on Mac OS 10.2.1 using Marc Liyanage's binaries
compiled with --disable-cli option .Is there any possibility to install
an extension to enable CLI ?
Thanks for your help .

Pierre Vaudrey
email [EMAIL PROTECTED]
--
.: B i g D o g :.



--- End Message ---
--- Begin Message ---
I have sendmail installed and the path to it in the php.ini is correct, when i try a 
file just containing the mail() function (no errors in that!) it starts sendmail but 
nothing gets sent!

root     22508  0.0  0.2  3556 1520 pts/2    S    20:09   0:00 php test.php
smmsp    22509  0.0  0.2  3416 1440 pts/2    S    20:09   0:00 /usr/sbin/sendmail -t -i

help!
--- End Message ---
--- Begin Message ---
Hi, i got this project i'm building right now. It basically a core system to
do adminsitrative modules for web sites.

I got tons of classes that get created on call of a function like
sql_setup(), frm_setup(). These functions create the objects from the
classes so they can be used later in other objects...yada yada yada...

Now my thing is, instead of always starting my method of an object with
"global sql_server;" and "global frm_builder", is there a way that these
variables are declared as global automatically, just like i would get
$_GET[], $_POST[] and so on, they are already global. I want to do this to
simplify development since this project is going to be HUGE. And also it
will facilitate debugging as i've been using "global" at a lot of places and
when you forget one, PHP assumes the creation of a dummy variable messing up
everything.

I'm waiting for an anwser,
thank you

Mathieu Dumoulin
Programmer / Analayst in web solutions
Groupimage Comunications


--- End Message ---
--- Begin Message ---
At 21:49 10.11.2002, Mathieu Dumoulin said:
--------------------[snip]--------------------
>Hi, i got this project i'm building right now. It basically a core system to
>do adminsitrative modules for web sites.
>
>I got tons of classes that get created on call of a function like
>sql_setup(), frm_setup(). These functions create the objects from the
>classes so they can be used later in other objects...yada yada yada...
>
>Now my thing is, instead of always starting my method of an object with
>"global sql_server;" and "global frm_builder", is there a way that these
>variables are declared as global automatically, just like i would get
>$_GET[], $_POST[] and so on, they are already global. I want to do this to
>simplify development since this project is going to be HUGE. And also it
>will facilitate debugging as i've been using "global" at a lot of places and
>when you forget one, PHP assumes the creation of a dummy variable messing up
>everything.
--------------------[snip]-------------------- 

Hi Mathieu,

to begin with, if this project is HUGE as you said, try to avoid globals as
good as you can - they're absolze poison for the readability, stability,
and scalability of any application that extends a single source file with a
couple of lines. Of course this is only MHO, I'm sure others will chime in
here.

I am currently working on an application core that's expected to work with
a nice number of objects, and it is not feasible here to have objects a)
global and simply not possible to have every part of the application using
its own reference to the object instance.

What I did is to create a container for objects and wrap it into a class I
call CCache. As soon as an object gets instantiated it registers itself
with the cache (being uniquely identified by Type and ID). Any part of the
application simply calls the systemwide cache object with type and ID to
retrieve a reference to the specific object it needs just now.

I did a performance profiling on this system, and retrieving an object
reference from the cache needs approx. 0.001 msec.

Just to tell you, not even the cache object is global - there is a public
wrapper function around it to return a reference to the global cache
object. Currently we have approx. 85,000 lines of code, and absolutely no
global variable of our own...


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/


--- End Message ---
--- Begin Message ---
i seriously dont get it how are you suppose to use the ftp functions if the
only way is via the browser uploader which goes to the server first anyway
??

"Justin French" <[EMAIL PROTECTED]> wrote in message
news:B9F47504.16CA2%justin@;indent.com.au...
> From the browser window, I believe you can only upload individual files to
> the server... you can do multiples at once, but you can't (IMHO) upload an
> entire directory off your desktop THROUGH your browser, to the server.
>
> You could .zip, .tar or .sit a folder of course, but then you'd have to
> uncompress on the server, which is possible for SOME compression types.
>
>
> Justin
>
>
> on 10/11/02 7:30 PM, AKHIL KODALI ([EMAIL PROTECTED]) wrote:
>
> >
> >
> > Its a question.
> > I want to know if there is any method to upload a directory,
> > If yes, then how.
> >
> >
> >
> >
> > On Sun, 10 Nov 2002, electroteque wrote:
> >
> >> was this an answer or a question ?
> >>
> >> "Akhil Kodali" <[EMAIL PROTECTED]> wrote in message
> >> news:Pine.LNX.4.44.0211091958120.10474-100000@;gdit.iiit.net...
> >>> Hi,
> >>>
> >>> I there anyway to upload entire directory.
> >>>
> >>> --
> >>> AKHIL K
> >>> 200101009
> >>> Room No. 15
> >>> BH-2
> >>> IIIT
>
>>> ------------------------------------------------------------------------
--
> >>>
> >>> Look at me. My life has no meaning or direction, and I'm happy
> >>>
> >>>
> >>
> >>
> >>
> >>
> >
>
> --------------------
> Creative Director
> http://Indent.com.au
> --------------------
>


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

I'm about to implement session management, and I'm considering rolling my
own instead of using PHP's.

Specifically, I'm considering using hidden fields for persistent object
properties because (1) I don't want cookies to be an issue, (2) I prefer not
to have session IDs appear in a URL, and (3) I prefer not to use require a
database just to store persistent properties.

Are there drawbacks to storing persistent object properties as a serialized
value in hidden fields that I'm missing?  This is a newbie's first major web
application, so I really appreciate your input.

-- Charles Wiltgen

--- End Message ---
--- Begin Message ---
on 11/11/02 7:41 AM, Charles Wiltgen ([EMAIL PROTECTED]) wrote:

> Are there drawbacks to storing persistent object properties as a serialized
> value in hidden fields that I'm missing?  This is a newbie's first major web
> application, so I really appreciate your input.
 
Doesn't that mean you'd have to use forms for getting between each page?
There are only three ways to pass a session ID around:

1. via the URL (GET)
2. via cookies
3. via a form (POST)


If you categorically rule out 1 & 2, then you're left with 3.  3 means that
every link across your site has to be a form submit.  Yuk!!!


Or have I misunderstood your question?


Justin French
--------------------
Creative Director
http://Indent.com.au
--------------------

--- End Message ---
--- Begin Message ---
At 22:41 10.11.2002, Charles Wiltgen said:
--------------------[snip]--------------------
>I'm about to implement session management, and I'm considering rolling my
>own instead of using PHP's.

Hmm - NIH syndrome?
(>>not invented here<<)

>Specifically, I'm considering using hidden fields for persistent object
>properties because (1) I don't want cookies to be an issue, (2) I prefer not
>to have session IDs appear in a URL, and (3) I prefer not to use require a
>database just to store persistent properties.
--------------------[snip]-------------------- 

As Justin already pointed out you make yourself stick to forms, not
allowing any "normal" page be session-dependent - but that's only one of
the drawbacks.

The issue that would disturb me the most is data security - if you use the
client browser to store object persistent data this opens up a whole world
of possibilities to hack your data... Of course you could always check if
the hidden fields are still ok, using some md5 or whetever, but why the hassle?

If you don't want cookies (I too don't use them for a session and have
disabled session cookies in our php.ini), PHP will transparently merge the
session identifier into its output (as long as you don't use ob_gzhandler,
that is). But why don't you like the session ID magled into links?

"prefer not to use a database" - that's not the case with standard php
sessions, they get written to a file somewhere. Just make sure that this
"somewhere" is
    a) read/writable by apache
    b) not read/writable by anyone else
and you are (relatively) secure.


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/


--- End Message ---
--- Begin Message ---
Justin wrote...

> ...every link across your site has to be a form submit.  Yuk!!!

Yeah, yuk.  I'm very silly and didn't realize this until after I'd posted.
It's possible since links will be generated automatically, but yuk.

Ernest wrote...

> Hmm - NIH syndrome?
> (>>not invented here<<)

No, I'm far too lazy for that luxury.   :^)

> If you don't want cookies (I too don't use them for a session and have
> disabled session cookies in our php.ini), PHP will transparently merge the
> session identifier into its output (as long as you don't use ob_gzhandler,
> that is). But why don't you like the session ID magled into links?

Well, I'm still a newbie to PHP, and for some reason thought that all
persistant data (not just the session ID) would have to be serialized into
the links.

Many thanks, Justin and Ernest, for straightening me out on PHP sessions --
my only excuse is that the otherwise very-helpful "Professional PHP
Programming" barely discusses them.

-- Charles Wiltgen

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

Hi
I have installed esayphp v 1.4.0.0 on my pc  (windows 98) . How can I know the version 
of PHP and of mysql ?

Thanks
--- End Message ---
--- Begin Message ---
<? phpinfo(); ?>

-- 
Maxim Maletsky
[EMAIL PROTECTED]


On Sun, 10 Nov 2002 22:42:59 -0000 "Iguider" <[EMAIL PROTECTED]> wrote:

> 
> 
> Hi
> I have installed esayphp v 1.4.0.0 on my pc  (windows 98) . How can I know the 
>version of PHP and of mysql ?
> 
> Thanks

--- End Message ---
--- Begin Message ---
thanks a lot

----- Original Message -----
From: "Maxim Maletsky" <[EMAIL PROTECTED]>
To: "Iguider" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, November 10, 2002 10:48 PM
Subject: Re: [PHP] Fw: esayphp


>
> <? phpinfo(); ?>
>
> --
> Maxim Maletsky
> [EMAIL PROTECTED]
>
>
> On Sun, 10 Nov 2002 22:42:59 -0000 "Iguider" <[EMAIL PROTECTED]> wrote:
>
> >
> >
> > Hi
> > I have installed esayphp v 1.4.0.0 on my pc  (windows 98) . How can I
know the version of PHP and of mysql ?
> >
> > Thanks
>
>
> __________________________________________________
> Modem offert : 150,92 euros rembourss sur le Pack eXtense de Wanadoo !
> Haut dbit  partir de 30 euros/mois : http://www.ifrance.com/_reloc/w


__________________________________________________
Modem offert : 150,92 euros rembourss sur le Pack eXtense de Wanadoo ! 
Haut dbit  partir de 30 euros/mois : http://www.ifrance.com/_reloc/w

--- End Message ---
--- Begin Message ---
SELECT DECODE(ENCODE('password', 'sec'), 'sec') ->
password

When I try:
SELECT DECODE(ENCODE('password', 'sec'),
'SUBSTRING("secret",1,3)'); or without quotes around
SUBSTRING function

This does not produce the same output, i am not sure
what the problem is.

Ben

__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2
--- End Message ---
--- Begin Message ---
Hi all,

I'm not too sure if this is the right place to get my answers but I really need to 
know this:

    How can I convince my clients that PHP is really good? I mean not a lot of 
non-programmers have heard of PHP language. Most of them only heard of things like 
C/C++, ASP and the like. So, how can I prove to them that PHP is a much better 
language to use? 

    Can anyone point me to the right resources for me to show and prove to my clients?

    Thanks a lot and sorry if this is the wrong place to ask this question.


Yours,

Wee Keat Chin

-----------------------------------
"Don't find a fault; find a remedy" 
--- End Message ---
--- Begin Message ---
First off, I wouldn't go comparing one language to another as "better" (a
jihad has broken out on another list between Perl and PHP, substituting
belief for anything remotely resembling a civilized and intelligent
discussion), but if you want to convince them about the merits of PHP, look
up the news stories about Yahoo abandoning its own  proprietary language for
PHP.  Also, if any of your clients have experience with Perl, you can use
the comparison about regular expression handling there.  You can also refer
to http://www.php.net/usage.php for a description of the popularity of PHP.

-----Original Message-----
From: Wee Keat [Amorphosium] [mailto:weekeat@;amorphosium.com]
Sent: Sunday, November 10, 2002 6:42 PM
To: PHP [General]
Subject: [PHP] How good is PHP to ASP?


Hi all,

I'm not too sure if this is the right place to get my answers but I really
need to know this:

    How can I convince my clients that PHP is really good? I mean not a lot
of non-programmers have heard of PHP language. Most of them only heard of
things like C/C++, ASP and the like. So, how can I prove to them that PHP is
a much better language to use?
    Can anyone point me to the right resources for me to show and prove to
my clients?
    Thanks a lot and sorry if this is the wrong place to ask this question.


Yours,

Wee Keat Chin

-----------------------------------
"Don't find a fault; find a remedy"

--- End Message ---
--- Begin Message --- oh man you missed a great opportunity, through the last few days some one posted a message saying "convince the boss" containing a list of well-known websites running PHP, go check the list archive it will be available there







_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail

--- End Message ---
--- Begin Message ---
why PHP don't return a parse error here ? 

<code>
  case "browse" :
   $text = $myobject->browse();;;;;;;;;;;;;;;;;;;
    //   some codes ...
  break;

</code>

i guess syntax isn't correct or what do you think ?!

Best regards
Hatem

--- End Message ---
--- Begin Message ---
At 02:51 11.11.2002, Hatem Ben said:
--------------------[snip]--------------------
>why PHP don't return a parse error here ? 
>
><code>
>  case "browse" :
>   $text = $myobject->browse();;;;;;;;;;;;;;;;;;;
>    //   some codes ...
>  break;
>
></code>
>
>i guess syntax isn't correct or what do you think ?!
--------------------[snip]-------------------- 

hmm - it's a little bit inefficient in terms of nanosecs, but syntactically
correct. You simply have 18 successive empty statements...


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/


--- End Message ---

Reply via email to