php-general Digest 25 Dec 2002 20:26:44 -0000 Issue 1784

Topics (messages 129317 through 129327):

Re: Problem with Include
        129317 by: sport4ever

Writing byte 0A to a file (LF / CR related)
        129318 by: BBun
        129319 by: BBun
        129320 by: Thomas Seifert

CVS download
        129321 by: Bc. Radek Krejča

How To Get Last Item Of An Array?
        129322 by: . Nilaab
        129323 by: Chris Wesley

MySQL
        129324 by: Parry60.aol.com

Re: Problem with comma in mail form
        129325 by: Chris Wesley

Good class for managing settings stored in INI (or other format) file?
        129326 by: Leif K-Brooks
        129327 by: John W. Holmes

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 ---
Thanks to all whom answered me

while there is no solution for my problem (including more than one PHP file
in a HTML page through SSI) :(
I want to return to my server old configuration, It was:
RedHat Linux 7.3
Apach 1.3
PHP 4.0.1
except PHP, because I have encountered some problems with PHP 4.0.1,
and please tell me what I (exactly) suppose to reinstall (Linux,Apache or
PHP)...

Is there any way to undo my upgrade ( what I call downgrade :-) )?
thanx anyway
______
http://www.sport4ever.net
Administrator of Sport4ever.Net
[EMAIL PROTECTED]

----- Original Message -----
From: "sport4ever" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Tom Ray" <[EMAIL PROTECTED]>
Sent: Tuesday, December 24, 2002 8:04 AM
Subject: Re: [PHP] Problem with Include


> It's PHP problem because I can include any number of files with other
> extensions. only PHP which I can not include more than one file at a
page...
>
> maybe there is something wrong with php.ini
> notice that I faced with this problem just after I upgraded to (PHP
4.2.1),
> (Apache2), everything was great before!
>
> >
> > sport4ever wrote:
> >
> >Hello,
> >my problem is that I can't use more than one SSI INCLUDE in a page....
> >
> >Please access this test page to check the problem yourself:
> >http://www.sport4ever.com/test/hello.shtml
> >
> >The first INCLUDE will appear correctly and prints "HELLO World, include
#1" which is the output of "hello.php"
> >
> >Whereas the second INCLUDE won't appear, and instead, it will print the
content (code) of "hello2.php", which is the follwoing:
> ><? echo "HELLO World, include #1"; ?>
> >
> >So, it always executes the first include statement perfectly, and doesn't
> execute the rest!
> >
> >note: the problem appears only if I include a PHP file, it will execute
> it correctly if it's a SHTML or HTML file.
> >
> >PLEASE is there any solution for this strange problem!
> >
> >
> >
> >
>


--- End Message ---
--- Begin Message ---
Hey,

I am trying to write some binary data (image) to a file, but using fputs,
every 0A byte will be written as 0D 0A. This is because of the windows
representation of a new line (\r\n), but I'm not writing a text file! I'm
writing binary data! Does anyone know how I can make this work correctly?

Thanks



--- End Message ---
--- Begin Message ---
Hey,

I am trying to write some binary data (image) to a file, but using fputs,
every 0A byte will be written as 0D 0A. This is because of the windows
representation of a new line (\r\n), but I'm not writing a text file! I'm
writing binary data! Does anyone know how I can make this work correctly?

Thanks


--- End Message ---
--- Begin Message ---
from the manual:

Note:  On systems which differentiate between binary and text files (i.e. Windows) the 
file must be opened with 'b' included in fopen() mode parameter.



Thomas

On Wed, 25 Dec 2002 11:43:13 +0100 [EMAIL PROTECTED] (Bbun) wrote:

> Hey,
> 
> I am trying to write some binary data (image) to a file, but using fputs,
> every 0A byte will be written as 0D 0A. This is because of the windows
> representation of a new line (\r\n), but I'm not writing a text file! I'm
> writing binary data! Does anyone know how I can make this work correctly?
> 
> Thanks
> 
> 
--- End Message ---
--- Begin Message ---
Hello,
I want to download PHP from CVS and a wrote this command (from
manual):

cvs -d :pserver:[EMAIL PROTECTED]:/repository co -r PHP_4_2_3 php4

But I got this message:

cvs [server aborted]: no such tag PHP_4_2_3

Where is problem?
Thanks Radek


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

I have an multi-dimensional array called $cat_data, which is info extracted
from a MySQL DB. I want to retrieve the very last item of that array. How
would I do that? I know the first item can be retrieved by simply asking for
$cat_data[0][0], which contains an id number. But I can't figure out how to
get the last item in that same array -- $cat_data[x][0] where x is the last
item in the array.

P.S. - I read the section on Arrays at php.net, but unfortunately I didn't
find my answer there. I also checked my PHP books, no mention of my problems
there either.

--- End Message ---
--- Begin Message ---
On Wed, 25 Dec 2002, @ Nilaab wrote:

> I have an multi-dimensional array called $cat_data, which is info extracted
> from a MySQL DB. I want to retrieve the very last item of that array. How
> would I do that? I know the first item can be retrieved by simply asking for
> $cat_data[0][0], which contains an id number. But I can't figure out how to
> get the last item in that same array -- $cat_data[x][0] where x is the last
> item in the array.

Naturally, the index of last item of an array is one less than the total
number of elements in the array.

$num_elements = count( $cat_data );
$last_element = $cat_data[$num_elements-1][0];
// 0 being what you were seeking

        Cheers!
        ~Chris


--- End Message ---
--- Begin Message ---
I'm having some problems with MySQL.  PHP just isn't working with it.
I'm running Apache 1.3.27 with PHP 4.2.3 and MySQL 3.23.49 on OpenBSD 3.2.  
Apache and PHP were compiled with source (PHP was configured with 
--with-mysql and --with-apxs), and MySQL was installed from a package.
I can connect to MySQL via the command-line interface, but not via PHP.  
phpBB always reports "cannot connect to database".  I've checked the 
permissions and everything, and it all should work.
I've also set the mysql socket in php.ini to /var/run/mysql/mysql.sock 
because that's where it is.

Thanks,
Parry60
--- End Message ---
--- Begin Message ---
On Wed, 25 Dec 2002, Ben Edwards wrote:

> I have a fairly simple mail form which gets email, subject and message and
> posts to itself.
> It then use mail() function to send a email.
> mail( $admin_email, $subject, $message, "From: $email" );
> Problem is the message gets truncated if there is a comma in the message
> after the comma.

I have forms that have identical functionality, but don't exhibit that
erroneous behavior.  I can't tell what you've done to the arguments to
mail() before using them, but the only thing I do is run them through
stripslashes() and trim().  i.e. -

$message = trim( stripslashes( $_POST['message'] ) );

If that's what you do too ... weird!  If not, give it a try and see what
happens.

        g.luck & cheers!
        ~Chris

--- End Message ---
--- Begin Message --- I'm looking for a class to manage settings stored in a .ini (or other format) file. I could store them in a database, but they need to be there even when the DB's down. Any ideas?

--
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 ---
> I'm looking for a class to manage settings stored in a .ini (or other
> format) file.  I could store them in a database, but they need to be
> there even when the DB's down.  Any ideas?

Parse_ini_file() may be of use. Or search phpclasses.org, they are sure
to have something. 

www.php.net/parse_ini_file

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


--- End Message ---

Reply via email to