php-general Digest 15 Nov 2003 21:30:47 -0000 Issue 2417

Topics (messages 169731 through 169765):

Re: CGI error when loading iFRAME
        169731 by: Marek Kilimajer

What is "white space"
        169732 by: Gerard Samuel
        169739 by: Chris Shiflett
        169755 by: Robert Cummings

Using $_SERVER
        169733 by: Gerard Samuel

Alternet row colors
        169734 by: PAUL FERRIE
        169735 by: Boaz Yahav
        169736 by: PAUL FERRIE
        169737 by: zhuravlev alexander
        169760 by: Kim Steinhaug

Who controls PHP?
        169738 by: John Smith
        169740 by: Chris Shiflett
        169741 by: Nathan Taylor
        169754 by: John Nichel
        169756 by: Derek Ford

Re: Include an encoder into PHP distribution?
        169742 by: John Smith
        169743 by: Nathan Taylor
        169745 by: Chris Shiflett
        169746 by: John Smith
        169748 by: John Smith
        169749 by: Eugene Lee
        169750 by: John Smith
        169752 by: zhuravlev alexander
        169753 by: Ryan A
        169764 by: Manuel Lemos
        169765 by: John Smith

Re: strtotime bad logic or strtotime bug?
        169744 by: Chris Shiflett

Storing images
        169747 by: Paul Marinas
        169751 by: Boaz Yahav
        169757 by: Kim Steinhaug
        169759 by: Chris Shiflett

Can't fetch HTTP POST data in PHP?
        169758 by: Ivan Marenic
        169761 by: Chris Shiflett
        169762 by: Manuel Lemos
        169763 by: Ivan Marenic

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 --- Miroslav I. wrote:
Hi, people

#The problem:
There is an error message that stops proper loading of one iFRAME, I
couldn't understand what is the problem.
Complete error message issued:

CGI Error

The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:<<


###Additional: PHP Version 4.3.3 is running on Windows 2000 server


This is a common problem with php on iis, google for the error string to get possible solutions.

--- End Message ---
--- Begin Message ---
Most of the time, I edit files via the command line, (FBSD).
When the files are saved, it adds a \n (newline) character (at least I believe 
that is what it is) after the closing ?>
When viewing these files in a windows GUI editor, there is an extra line
after the ?> closing tag.
Using the php function headers_sent(), doesn't show that there is any output 
being created by these extra lines after closing ?>

So is "white space" only physical space (\s) or can it be anything like
\t \r \n???

Thanks.

--- End Message ---
--- Begin Message ---
--- Gerard Samuel <[EMAIL PROTECTED]> wrote:
> Most of the time, I edit files via the command line, (FBSD). When
> the files are saved, it adds a \n (newline) character (at least I
> believe that is what it is) after the closing ?> When viewing these
> files in a windows GUI editor, there is an extra line after the ?>
> closing tag. Using the php function headers_sent(), doesn't show that
> there is any output being created by these extra lines after closing
> ?>
> 
> So is "white space" only physical space (\s) or can it be anything
> like \t \r \n???

This is a feature/bug of PHP, depending on your perspective. When a
closing ?> is followed by a newline, the newline is not output.

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/
RAMP Training Courses
     http://www.nyphp.org/ramp

--- End Message ---
--- Begin Message ---
On Sat, 2003-11-15 at 12:12, Chris Shiflett wrote:
> --- Gerard Samuel <[EMAIL PROTECTED]> wrote:
> > Most of the time, I edit files via the command line, (FBSD). When
> > the files are saved, it adds a \n (newline) character (at least I
> > believe that is what it is) after the closing ?> When viewing these
> > files in a windows GUI editor, there is an extra line after the ?>
> > closing tag. Using the php function headers_sent(), doesn't show that
> > there is any output being created by these extra lines after closing
> > ?>
> > 
> > So is "white space" only physical space (\s) or can it be anything
> > like \t \r \n???
> 
> This is a feature/bug of PHP, depending on your perspective. When a
> closing ?> is followed by a newline, the newline is not output.

FYI, if you're woprried about the "header cannot be sent due to
output..." error, then if your file only has code and no HTML, then you
can omit the ?> tag at the end of your script. This solves countless
issues with there being a space, a tab, a newline, or any whitespace
after the closing tag.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Whats your take on adding your own data in the $_SERVER array?
For example, if I wanted to add a value to the $_SERVER array like ->
$_SERVER['foo'] = 'bar';

Yes its possible, but Im looking for "legality" issues with this frame of 
thought.

Thanks

--- End Message ---
--- Begin Message ---
Hello all

I have been working on this website
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/index2.htm
I did not design the site i have just been asked to tweak it
My php knowledge is limited always learning something new.  Anyways I have
been trying to use a code that i got from
www.hotscripts.com the scipts retutns alternet rows colors for information
sent back from the database when displayed in the broswer.

Here is the script:
//-------------------


function alternate_rows(
// color_1 and color_2 have default values, but can be over-ridden.
    $data,
    $color_1 = '#999999',
    $color_2 = 'black'
)
{
// Declare $color as static so it retains its value when program
// execution leaves the local function's scope.
    static $color;

// Set the color to that's not currently set.
    if ( $color == $color_1 )
    {
        $color = $color_2;
    }
    else
    {
        $color = $color_1;
    }

    echo '<tr bgcolor="' . $color . '"><td>' . $data . '</td></tr>';
}

I have tried a few was of implamenting this into my current php code but i
have had no luck :(


Could some one help me with this please :)
If you check the website and click "top ten"
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/index2.htm


The code for return the top ten result is :
$result = mysql_query("SELECT * FROM albums where id <15");

$Count = @mysql_num_rows($result);

 echo "<table border=1 cellpadding=3 cellspacing=0
bordercolor='#000000'>\n";
    echo "<tr><td bgcolor='#666666'>ID</td><td
bgcolor='#666666'>ARTIST</td><td bgcolor='#666666'>TITLE</td><td
bgcolor='#666666'>LABEL</td><td bgcolor='#666666'>PRICE</td></tr>\n";

for ($count = 0; $count < $Count; $count++) {
    // Extract post details from database
    $myrow = mysql_fetch_array($result);
    $id = $myrow ['id'];
   $artist = $myrow ['artist'];
 $title = $myrow ['title'];
 $label = $myrow ['label'];
 $price = $myrow ['price'];

    printf("<tr
bgcolor='#000000'><td>$id</td><td>$artist</td><td>$title</td><td>$label</td>
<td>£$price</tr>\n");
}
 echo "</table>\n";

?>

Cheers
Paul

--- End Message ---
--- Begin Message ---
You can also check :

A PHP function To Make Alternative Colored table rows
http://www.weberdev.com/get_example.php3?count=3609

Alternating background color for HTML table rows
http://www.weberdev.com/get_example.php3?count=3482

Another way to alternate table rows
http://www.weberdev.com/get_example.php3?count=1832

How to display any array in several rows and columns of a table. Not just in one 
column or in alternate rows. This example shows a nice color table generated with PHP, 
but can be used with any array values(e.g. Database)
http://www.weberdev.com/get_example.php3?count=1761

HTML Table with random alternating colours, helps you see what you colour options are.
http://www.weberdev.com/get_example.php3?count=1555

Sincerely
 
berber
 
Visit http://www.weberdev.com/ & http://www.weberblog.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com
Search for PHP Code from your browser http://toolbar.weberdev.com
Share your thoughts : http://www.weberblog.com/submit.php?type=story&topic=PHP_Web_Logs



-----Original Message-----
From: PAUL FERRIE [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 15, 2003 5:46 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Alternet row colors


Hello all

I have been working on this website 
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/index2.htm
I did not design the site i have just been asked to tweak it
My php knowledge is limited always learning something new.  Anyways I have been trying 
to use a code that i got from www.hotscripts.com the scipts retutns alternet rows 
colors for information sent back from the database when displayed in the broswer.

Here is the script:
//-------------------


function alternate_rows(
// color_1 and color_2 have default values, but can be over-ridden.
    $data,
    $color_1 = '#999999',
    $color_2 = 'black'
)
{
// Declare $color as static so it retains its value when program // execution leaves 
the local function's scope.
    static $color;

// Set the color to that's not currently set.
    if ( $color == $color_1 )
    {
        $color = $color_2;
    }
    else
    {
        $color = $color_1;
    }

    echo '<tr bgcolor="' . $color . '"><td>' . $data . '</td></tr>'; }

I have tried a few was of implamenting this into my current php code but i have had no 
luck :(


Could some one help me with this please :)
If you check the website and click "top ten" 
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/index2.htm


The code for return the top ten result is :
$result = mysql_query("SELECT * FROM albums where id <15");

$Count = @mysql_num_rows($result);

 echo "<table border=1 cellpadding=3 cellspacing=0 bordercolor='#000000'>\n";
    echo "<tr><td bgcolor='#666666'>ID</td><td bgcolor='#666666'>ARTIST</td><td 
bgcolor='#666666'>TITLE</td><td bgcolor='#666666'>LABEL</td><td 
bgcolor='#666666'>PRICE</td></tr>\n";

for ($count = 0; $count < $Count; $count++) {
    // Extract post details from database
    $myrow = mysql_fetch_array($result);
    $id = $myrow ['id'];
   $artist = $myrow ['artist'];
 $title = $myrow ['title'];
 $label = $myrow ['label'];
 $price = $myrow ['price'];

    printf("<tr 
bgcolor='#000000'><td>$id</td><td>$artist</td><td>$title</td><td>$label</td>
<td>£$price</tr>\n");
}
 echo "</table>\n";

?>

Cheers
Paul

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

--- End Message ---
--- Begin Message ---
Thats pretty much what i have got off www.hotscripts.com.  The problem is
adding it to my exsisting code.

~cheers
Paul

"Boaz Yahav" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
You can also check :

A PHP function To Make Alternative Colored table rows
http://www.weberdev.com/get_example.php3?count=3609

Alternating background color for HTML table rows
http://www.weberdev.com/get_example.php3?count=3482

Another way to alternate table rows
http://www.weberdev.com/get_example.php3?count=1832

How to display any array in several rows and columns of a table. Not just in
one column or in alternate rows. This example shows a nice color table
generated with PHP, but can be used with any array values(e.g. Database)
http://www.weberdev.com/get_example.php3?count=1761

HTML Table with random alternating colours, helps you see what you colour
options are.
http://www.weberdev.com/get_example.php3?count=1555

Sincerely

berber

Visit http://www.weberdev.com/ & http://www.weberblog.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com
Search for PHP Code from your browser http://toolbar.weberdev.com
Share your thoughts :
http://www.weberblog.com/submit.php?type=story&topic=PHP_Web_Logs



-----Original Message-----
From: PAUL FERRIE [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 15, 2003 5:46 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Alternet row colors


Hello all

I have been working on this website
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/index2.htm
I did not design the site i have just been asked to tweak it
My php knowledge is limited always learning something new.  Anyways I have
been trying to use a code that i got from www.hotscripts.com the scipts
retutns alternet rows colors for information sent back from the database
when displayed in the broswer.

Here is the script:
//-------------------


function alternate_rows(
// color_1 and color_2 have default values, but can be over-ridden.
    $data,
    $color_1 = '#999999',
    $color_2 = 'black'
)
{
// Declare $color as static so it retains its value when program //
execution leaves the local function's scope.
    static $color;

// Set the color to that's not currently set.
    if ( $color == $color_1 )
    {
        $color = $color_2;
    }
    else
    {
        $color = $color_1;
    }

    echo '<tr bgcolor="' . $color . '"><td>' . $data . '</td></tr>'; }

I have tried a few was of implamenting this into my current php code but i
have had no luck :(


Could some one help me with this please :)
If you check the website and click "top ten"
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/index2.htm


The code for return the top ten result is :
$result = mysql_query("SELECT * FROM albums where id <15");

$Count = @mysql_num_rows($result);

 echo "<table border=1 cellpadding=3 cellspacing=0
bordercolor='#000000'>\n";
    echo "<tr><td bgcolor='#666666'>ID</td><td
bgcolor='#666666'>ARTIST</td><td bgcolor='#666666'>TITLE</td><td
bgcolor='#666666'>LABEL</td><td bgcolor='#666666'>PRICE</td></tr>\n";

for ($count = 0; $count < $Count; $count++) {
    // Extract post details from database
    $myrow = mysql_fetch_array($result);
    $id = $myrow ['id'];
   $artist = $myrow ['artist'];
 $title = $myrow ['title'];
 $label = $myrow ['label'];
 $price = $myrow ['price'];

    printf("<tr
bgcolor='#000000'><td>$id</td><td>$artist</td><td>$title</td><td>$label</td>
<td>£$price</tr>\n");
}
 echo "</table>\n";

?>

Cheers
Paul

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

--- End Message ---
--- Begin Message ---
On Sat, Nov 15, 2003 at 06:09:18PM +0200, Boaz Yahav wrote:
> 
> function alternate_rows(
> // color_1 and color_2 have default values, but can be over-ridden.
>     $data,
>     $color_1 = '#999999',
>     $color_2 = 'black'
> )
> {
> // Declare $color as static so it retains its value when program // execution leaves 
> the local function's scope.
>     static $color;
> 
> // Set the color to that's not currently set.
>     if ( $color == $color_1 )
>     {
>         $color = $color_2;
>     }
>     else
>     {
>         $color = $color_1;
>     }
> 
>     echo '<tr bgcolor="' . $color . '"><td>' . $data . '</td></tr>'; }
> 
> I have tried a few was of implamenting this into my current php code but i have had 
> no luck :(
> 
> 
> Could some one help me with this please :)
> If you check the website and click "top ten" 
> http://thor.ancilenetworks.co.uk/~pferrie/vinrev/index2.htm
> 
> 
> The code for return the top ten result is :
> $result = mysql_query("SELECT * FROM albums where id <15");
> 
> $Count = @mysql_num_rows($result);
> 
>  echo "<table border=1 cellpadding=3 cellspacing=0 bordercolor='#000000'>\n";
>     echo "<tr><td bgcolor='#666666'>ID</td><td bgcolor='#666666'>ARTIST</td><td 
> bgcolor='#666666'>TITLE</td><td bgcolor='#666666'>LABEL</td><td 
> bgcolor='#666666'>PRICE</td></tr>\n";
> 
> for ($count = 0; $count < $Count; $count++) {
>     // Extract post details from database
>     $myrow = mysql_fetch_array($result);
>     $id = $myrow ['id'];
>    $artist = $myrow ['artist'];
>  $title = $myrow ['title'];
>  $label = $myrow ['label'];
>  $price = $myrow ['price'];
> 
        
        replace 

>     printf("<tr 
> bgcolor='#000000'><td>$id</td><td>$artist</td><td>$title</td><td>$label</td>
> <td>?$price</tr>\n");

        with 
        echo '<tr bgcolor="'.($count % 2) ? '#fefefe' : 
'#efefef'.'"><td>'.$id.'</td><td>'.$artist.'</td><td>'.$title.'</td><td>'.$label.'</td><td>'.$price."</td></tr>\n";

> }
>  echo "</table>\n";
> 
> ?>
> 

                                     -- zhuravlev alexander
                                           u l s t u  n o c
                                             ([EMAIL PROTECTED])

--- End Message ---
--- Begin Message ---
Well, first of all Ill just scrap you script since this one is so easy
its better to do it from scratch.

OK, somewhere in your script you have the code that accually
aoutputs the tables you are working with. Im refferring to lines
here, and Im meaning the bottom of this document which is
the scipt you posted, and I have numbered the lines.

Overview of your script.
Line 5 - we print out the table header
Line 11 - 23 is the loop which prints out all the lines, or rows.
Line 24 closes the table.

So what we have to do?

First we need to declare the values we want to use as backround
colours, lets use logical names :

(fig a)
    $backcolor1="#fafafa";
    $backcolor2="#c0c0c0";
    $backcolor=$backcolor1;    // we assign color 1

This code has to be written before the loop starts, so somewhere
before line 11.

In the loop (11-23) we need to switch between the colours where
we write the colour of the <tr>. So we write something like :

(fig b)
    echo '<tr style="background-color:' . $backcolor . ';">';
    // continue with the rest of <td....... </td></tr> here
    // which is -> your code.

This will print out the first background color, nice. Now we need it
to switch color, so we need to add a little logic. This will be inserted
right before the loop ends (infact, you can put it where ever you like
aslong as its in the loop).

(fig c)
    if($backcolor=backcolor1)
    $backcolor=$backcolor2;
    else
    $backcolor=$backcolor1;

As you see above the logic is quite simple, if the color is 1 -> we set it
to 2,
else we set it to 1. If you think of it, if you process this logic over and
over again
you will infact get 1, 2, 1, 2, 1, 2, 1, 2 all the time, :) Nice!

There you have it, and I hope you got the hang of it.

To take your code and implement my colorswither all you need to do is,

1. On line 21 replace #000000 width $backcolor
2. Insert the logic (figc), all lines, into line 19
3. Place fig a in line 4.

-- 
Kim Steinhaug
---------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
---------------------------------------------------------------


The code for return the top ten result is :
1 $result = mysql_query("SELECT * FROM albums where id <15");
2
3 $Count = @mysql_num_rows($result);
4
5  echo "<table border=1 cellpadding=3 cellspacing=0
6 bordercolor='#000000'>\n";
7    echo "<tr><td bgcolor='#666666'>ID</td><td
8 bgcolor='#666666'>ARTIST</td><td bgcolor='#666666'>TITLE</td><td
9 bgcolor='#666666'>LABEL</td><td bgcolor='#666666'>PRICE</td></tr>\n";
10
11 for ($count = 0; $count < $Count; $count++) {
12   // Extract post details from database
13    $myrow = mysql_fetch_array($result);
14   $id = $myrow ['id'];
15   $artist = $myrow ['artist'];
16 $title = $myrow ['title'];
17 $label = $myrow ['label'];
18 $price = $myrow ['price'];
19
20   printf("<tr
21bgcolor='#000000'><td>$id</td><td>$artist</td><td>$title</td><td>$label</t
d>
22<td>£$price</tr>\n");
23}
24 echo "</table>\n";

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

Please, can someone shed a little light on this subject: who controls PHP?

How much Zend has the power to say what goes into PHP and what not?

How much does the "community" actually have power?

For example, there are practical reasons why one should be concerned about
this: PHP doesn't have an opcode compiler/loader built in. I find this quite
frustrating to have to use some additional software to do that, which for
example Java and Python has built-in.

Please, tell me that Zend is not the dictator here.

John

--- End Message ---
--- Begin Message ---
--- John Smith <[EMAIL PROTECTED]> wrote:
> Please, can someone shed a little light on this subject: who controls
> PHP?

PHP is open source. You should have received the license when you
downloaded it. It is not something to be controlled.

> Please, tell me that Zend is not the dictator here.

No one is a dictator.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/
RAMP Training Courses
     http://www.nyphp.org/ramp

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

Zend in no way dictates PHP, they are simply a major player in it's development and 
are just as important as the PHP community.  Zend develops much of the core extensions 
for PHP but at the same time, they do not own or even run.

Nathan
  ----- Original Message ----- 
  From: John Smith 
  To: [EMAIL PROTECTED] 
  Sent: Saturday, November 15, 2003 11:59 AM
  Subject: [PHP] Who controls PHP?


  Hi,

  Please, can someone shed a little light on this subject: who controls PHP?

  How much Zend has the power to say what goes into PHP and what not?

  How much does the "community" actually have power?

  For example, there are practical reasons why one should be concerned about
  this: PHP doesn't have an opcode compiler/loader built in. I find this quite
  frustrating to have to use some additional software to do that, which for
  example Java and Python has built-in.

  Please, tell me that Zend is not the dictator here.

  John

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


--- End Message ---
--- Begin Message --- Chris Shiflett wrote:
--- John Smith <[EMAIL PROTECTED]> wrote:
>>
Please, tell me that Zend is not the dictator here.


No one is a dictator.

Chris

So there is an opening for a dictator then? How can I get my name on the ballot? ;)


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message --- John Nichel wrote:

Chris Shiflett wrote:

--- John Smith <[EMAIL PROTECTED]> wrote:

>>


Please, tell me that Zend is not the dictator here.



No one is a dictator.


Chris


So there is an opening for a dictator then? How can I get my name on the ballot? ;)

I am the only dictator here.
--- End Message ---
--- Begin Message ---
Ok then, that's nice to hear.

How about then the idea of including a reasonably good compiler/encoder into
standard PHP distribution? For example Turck MMcache is one, gpl'd and comes
as a php/zend extension.

I don't think there are other free encoders as this, so there wouldn't even
be a dispute over which to choose?

--- End Message ---
--- Begin Message ---
Well that's all good and grand but why increase the size of the distribution when it's 
not necessary to?  Nobody wants to download something they don't necessarily need 
included.

Nathan
  ----- Original Message ----- 
  From: John Smith 
  To: [EMAIL PROTECTED] 
  Sent: Saturday, November 15, 2003 12:24 PM
  Subject: Re: [PHP] Include an encoder into PHP distribution?


  Ok then, that's nice to hear.

  How about then the idea of including a reasonably good compiler/encoder into
  standard PHP distribution? For example Turck MMcache is one, gpl'd and comes
  as a php/zend extension.

  I don't think there are other free encoders as this, so there wouldn't even
  be a dispute over which to choose?

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


--- End Message ---
--- Begin Message ---
--- John Smith <[EMAIL PROTECTED]> wrote:
> How about then the idea of including a reasonably good
> compiler/encoder into standard PHP distribution? For example Turck
> MMcache is one, gpl'd and comes as a php/zend extension.
> 
> I don't think there are other free encoders as this, so there wouldn't
> even be a dispute over which to choose?

Which one should be chosen? Doesn't it seem a bit ridiculous for the PHP
development team to be picking a winner? Open source is all about choice,
in my opinion.

If I had to choose a winner, personally, I wouldn't pick your choice
anyway:

http://apc.communityconnect.com/

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/
RAMP Training Courses
     http://www.nyphp.org/ramp

--- End Message ---
--- Begin Message ---
I think Zend even has their business model partly in the encoder software,
there must be some need for it. Don't you think so?

Granted, this would increase the size of the download by a hundred
kilobytes.

I have no connection to Turck MMcache in any way than just a user who needs
it. But distributing software encoded with it is difficult while it is not
so easily available (have to be separately downloaded and installed).

Don't you think that this kind of functionality would be good for *PHP
language* in general, in many ways? It would encourage some people to adopt
PHP in the first place and not think of alternatives which offer this by
default. And of course this kind of software increases the performance too,
while it has the caching functionality as well.

-JS


> "Nathan Taylor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Well that's all good and grand but why increase the size of the
distribution when it's not necessary to?  Nobody wants to download something
> they don't necessarily need included.

> Nathan

--- End Message ---
--- Begin Message ---
> > I don't think there are other free encoders as this, so there wouldn't
> > even be a dispute over which to choose?
>
> Which one should be chosen? Doesn't it seem a bit ridiculous for the PHP
> development team to be picking a winner? Open source is all about choice,
> in my opinion.
>
> If I had to choose a winner, personally, I wouldn't pick your choice
> anyway:
>
> http://apc.communityconnect.com/

Yes, but,

I don't think APC, while a good cacher, has the source code protecting
(encoding into opcode code) feature?

There is the Ioncobe encoder, Zend encoder and Turck that I know of. Of
course any of them would suit me (just one opinion while everyone has one),
but Turck is the only free one *I* know of. Well, if there is going to be a
winner comtest, maybe Ioncube or Zend wants to join it, I don't know.

-JS

--- End Message ---
--- Begin Message ---
On Sat, Nov 15, 2003 at 07:52:28PM +0200, John Smith wrote:
: 
: I have no connection to Turck MMcache in any way than just a user who needs
: it. But distributing software encoded with it is difficult while it is not
: so easily available (have to be separately downloaded and installed).

I'm still having problems getting Turck MMcache to work on FreeBSD.
It looks like the configure script is Linux-centric.  That's a bit of a
minus when it comes to distributing software across multiple platforms.

--- End Message ---
--- Begin Message ---
Yes, it's still quite a new piece of software, at least so I have
understood. But anyway, as an idea for the future. Just about any encoder
would be great.

If it's really built-in, always-on, that would be even better.

Besides encoding, I think code profiling features should be (almost) built
in too.




"Eugene Lee" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sat, Nov 15, 2003 at 07:52:28PM +0200, John Smith wrote:
> :
> : I have no connection to Turck MMcache in any way than just a user who
needs
> : it. But distributing software encoded with it is difficult while it is
not
> : so easily available (have to be separately downloaded and installed).
>
> I'm still having problems getting Turck MMcache to work on FreeBSD.
> It looks like the configure script is Linux-centric.  That's a bit of a
> minus when it comes to distributing software across multiple platforms.

--- End Message ---
--- Begin Message ---
On Sat, Nov 15, 2003 at 11:58:18AM -0600, Eugene Lee wrote:
> On Sat, Nov 15, 2003 at 07:52:28PM +0200, John Smith wrote:
> : 
> : I have no connection to Turck MMcache in any way than just a user who needs
> : it. But distributing software encoded with it is difficult while it is not
> : so easily available (have to be separately downloaded and installed).
> 
> I'm still having problems getting Turck MMcache to work on FreeBSD.
> It looks like the configure script is Linux-centric.  That's a bit of a
> minus when it comes to distributing software across multiple platforms.

        I've successfully installed turck-mmcache-2.4.6 from FreeBSD
        Ports collection.

        cd /usr/ports/www/turck-mmcache/
        make install

                                     -- zhuravlev alexander
                                           u l s t u  n o c
                                             ([EMAIL PROTECTED])

--- End Message ---
--- Begin Message ---
Hey,
Or CodeSecure from http://securecents.com

Cheers,
-Ryan
P.S - biased opinion as i work with them.




> Ok then, that's nice to hear.
>
> How about then the idea of including a reasonably good compiler/encoder
into
> standard PHP distribution? For example Turck MMcache is one, gpl'd and
comes
> as a php/zend extension.
>
> I don't think there are other free encoders as this, so there wouldn't
even
> be a dispute over which to choose?
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

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

On 11/15/2003 03:24 PM, John Smith wrote:
Ok then, that's nice to hear.

How about then the idea of including a reasonably good compiler/encoder into
standard PHP distribution? For example Turck MMcache is one, gpl'd and comes
as a php/zend extension.

I don't think there are other free encoders as this, so there wouldn't even
be a dispute over which to choose?

The right place for you to discuss that is [EMAIL PROTECTED] (aka php-dev) as it is where most core developers hang out.


Anyway, I don't think Zend people will allow a competing extension be included in the core PHP distribution precisely because it compromises their business.

At most, they will not object to be included in PECL extension repository as PECL extensions are not shipped with standard PHP distribution.

Either way, another problem of Turck is that it uses a GPL license. Most people do not understand that GPL software is not really free for the users despite what it is advertised.

There are restrictions in the GPL license that prevent the software that uses it to be linked with other software without imposing license contamination, ie, software based on GPL license becomes GPL.

This is incompatible with PHP and Apache licenses which are BSD based. Unlike GPL, BSD like licenses are really free for the users. So, linking PHP or Apache with GPL license would make them less free.

Most people do not understand this licensing thing very well because they confuse free as in gratis which is what Apache, PHP and others with BSD like licenses, with strictly conditional free of the GPL software.

IMHO, if you really want to make software free without confusion, forget GPL.



--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
> Anyway, I don't think Zend people will allow a competing extension be
> included in the core PHP distribution precisely because it compromises
> their business.

This is exactly the reason I started this thread by asking "Who controls
PHP?" ... Thanks for clearing this out.

> Either way, another problem of Turck is that it uses a GPL license. Most
> people do not understand that GPL software is not really free for the
> users despite what it is advertised.

Yes, a good point. I could suggest that they change the license Lesser GPL,
but of course I don't know how it goes (I don't have any connections to
Turck people). I had to verify that it is really GPL, and it seems so.

JS

--- End Message ---
--- Begin Message ---
--- Gnik <[EMAIL PROTECTED]> wrote:
> I isolated the problem to be in the 'strtotime' function. Here is a
> test I ran - when it runs, after getting to 2003-10-26, it scrolls
> incessently:
> 
> ----BEGIN CODE------
> <?php
> $stop= "2003-12-27" ;
> $start= "2003-01-01" ;
> While ($start <> $stop) {
>     echo "<BR> Date: " . $start ;
>     $start = date('Y-m-d', strtotime($start) + 86400);
> }
> ?>
> ----END CODE------

Your approach makes me wonder why you are bothering to convert between
timestamps and formatted dates so many times. It makes much more sense to
use timestamps for conditionals and math, and use date() only in your echo
statement.

As for your particular error, I'm sure you could easily find it with just
a few minutes of debugging. For example, output the value of $start and
$stop at the beginning and very end of each loop.

Also, you might want to use != for not equal. From the manual
(http://www.php.net/manual/en/language.expressions.php):

PHP supports > (bigger than), >= (bigger than or equal to), == (equal), !=
(not equal), < (smaller than) and <= (smaller than or equal to). These
expressions are most commonly used inside conditional execution, such as
if  statements.

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/
RAMP Training Courses
     http://www.nyphp.org/ramp

--- End Message ---
--- Begin Message ---
Hi, i was wondering which is the best way to store images. I'm using an
upload section for my site and i'm using a script  to put those  images
from the upload section on a diferent section of the site.

10x
Paul
GnuPG Key http://sgi.rdscv.ro/~paulm/paulm.PGP

--- End Message ---
--- Begin Message ---
Interesting that you should bring this up now :)
I have started a thread about this with my opinion at :
http://www.weberblog.com/article.php?story=20031115124356140

I hope people will share their experience.

Sincerely
 
berber
 
Visit http://www.weberdev.com/ & http://www.weberblog.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com
Search for PHP Code from your browser http://toolbar.weberdev.com
Share your thoughts :
http://www.weberblog.com/submit.php?type=story&topic=PHP_Web_Logs


-----Original Message-----
From: Paul Marinas [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 15, 2003 7:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Storing images



Hi, i was wondering which is the best way to store images. I'm using an
upload section for my site and i'm using a script  to put those  images
from the upload section on a diferent section of the site.

10x
Paul
GnuPG Key http://sgi.rdscv.ro/~paulm/paulm.PGP

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

--- End Message ---
--- Begin Message ---
Well as far as I can see you have 2 options.

a) Store them directly on disc
b) Store them in a database (eg. mySQL)

I would think that a) is the best way without doubt, since it doest
use any extra processing power to serve the images to your visitors
as its only the webserver doing the usuall stuff.

The b) option has a better advantage regarding the backup function,
as its easier backuping a database than backing up a directory with
scripts anyway. (Unless you are thinking FTP, but right now im
thinking automatied scripts) On the otehr hand I have succesfully
installed ZIP ability with PHP, which makes backing up directories
no problem. So all in all it depends on where you stand if you know
what I mean.

The database sollution puts extra demand on the database as it
constantly has to query the database to get the images all the time.

So if you are thinking about the health of your server, and how quick
you want your site to accessible for your visitors I would stick to a)
I dont think it good practise to store images into the database either.

-- 
Kim Steinhaug
---------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
---------------------------------------------------------------


"Paul Marinas" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Hi, i was wondering which is the best way to store images. I'm using an
> upload section for my site and i'm using a script  to put those  images
> from the upload section on a diferent section of the site.
>
> 10x
> Paul
> GnuPG Key http://sgi.rdscv.ro/~paulm/paulm.PGP

--- End Message ---
--- Begin Message ---
--- Kim Steinhaug <[EMAIL PROTECTED]> wrote:
> Well as far as I can see you have 2 options.
> 
> a) Store them directly on disc
> b) Store them in a database (eg. mySQL)
> 
> I would think that a) is the best way without doubt

I usually take this option myself, but when you are creating an
application to run on a large cluster of servers, option b is the better
choice in many cases. It eliminates having to maintain server affininty
with your load balancer or having to replicate the data among all the
servers.

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/
RAMP Training Courses
     http://www.nyphp.org/ramp

--- End Message ---
--- Begin Message ---
Any idea why?

I am sending HTTP post request from j2me mobile device.

Request is OK because it works well on ASP page.

Thanks for help!

--- End Message ---
--- Begin Message ---
--- Ivan Marenic <[EMAIL PROTECTED]> wrote:
> Any idea why?
> 
> I am sending HTTP post request from j2me mobile device.
> 
> Request is OK because it works well on ASP page.

You have to provide some information if you want anyone to help you.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/
RAMP Training Courses
     http://www.nyphp.org/ramp

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

On 11/15/2003 06:54 PM, Ivan Marenic wrote:
Any idea why?

I am sending HTTP post request from j2me mobile device.

Request is OK because it works well on ASP page.

You may want to try this class to submit HTTP request. See the test_http_post.php example script:


http://www.phpclasses.org/httpclient

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
Here is j2me code snippet:

byte[] postData="This is my test line! It works!
Yipi-Yai-Yee!!!".getBytes();

        try{

        c = (HttpConnection)Connector.open(url_post);
        c.setRequestMethod(HttpConnection.POST);
        c.setRequestProperty( "User-Agent", "Profile/MIDP-1.0
Configuration/CLDC-1.0" );
        c.setRequestProperty( "Content-Language", "en-US" );
        c.setRequestProperty( "Content-Type", "text/plain");
        c.setRequestProperty( "Connection", "close");
        c.setRequestProperty( "Content-Disposition","attachment;
name=\"userfile\"; filename=\"userfile_txt\"");
        c.setRequestProperty( "Content-Length", Integer.toString(
postData.length ) );

        os = c.openOutputStream();
        os.write( postData );
        os.close();
        os = null;


Here is PHP code snippet:

//Here I see HTTP method, and response is POST
:
echo $_SERVER['REQUEST_METHOD'];
:

:
// Show any post vars, but nothing shows - never!
if(count($_POST)>0){
 echo "POST".$new_line;
 print_r($_POST);
 echo $new_line;
}
:

// try with upload files array
if(count($_FILES)>0){
 echo "FILES".$new_line;
 print_r($_FILES);
 echo $new_line;
}


That's it.

Greetings,
Ivan

--- End Message ---

Reply via email to