php-general Digest 20 Aug 2003 08:11:31 -0000 Issue 2247

Topics (messages 160092 through 160143):

in the middle of shift and pop
        160092 by: Decapode Azur
        160094 by: andu
        160095 by: Ralph Guzman
        160097 by: Decapode Azur
        160105 by: Decapode Azur
        160106 by: David Otton
        160107 by: Dan Anderson
        160110 by: Dan Anderson
        160114 by: Jon Drukman

is the list getting virus spammed?
        160093 by: Matt Babineau
        160096 by: Ryan A
        160098 by: Chris W. Parker
        160099 by: Steelhead
        160100 by: Nelson Rodríguez-Peña Alarcón
        160101 by: Mike Brum
        160103 by: Jeff Pearson
        160120 by: Ashley M. Kirchner
        160121 by: Richard Baskett
        160122 by: daniel.electroteque.org

(^&*$*(^&*$% ensim web appliance
        160102 by: Dennis Gearon
        160112 by: John W. Holmes
        160113 by: Michael A Smith

Re: How to open a save-as dialog and then redirect after donwload?
        160104 by: Jean-Christian IMbeault
        160126 by: Jason Sheets
        160130 by: Jean-Christian IMbeault

Re: mysql output
        160108 by: Anthony Ritter
        160115 by: John W. Holmes
        160117 by: Anthony Ritter
        160118 by: John W. Holmes

Sessions in frames
        160109 by: Aris  Santillan
        160119 by: Justin French

HELP! I'm Desperate...
        160111 by: Michael A Smith
        160127 by: Jason Sheets
        160131 by: Curt Zirzow
        160137 by: jabber.raditha.com

Your details
        160116 by: lserv.psg.com
        160123 by: listserv.cunyvm.cuny.edu
        160124 by: John W. Holmes
        160125 by: Ashley M. Kirchner
        160129 by: daniel.electroteque.org
        160143 by: support.argontechnology.com

Re: Problems send MIME multipart/alternative mail with php
        160128 by: Manuel Lemos

Problem with mktime, need to add 30 days to current date
        160132 by: James Johnson
        160133 by: James Johnson
        160134 by: Sn!per

Apache starting error
        160135 by: Rikunj
        160138 by: murugesan

calling a user defined java class method .....
        160136 by: toby z

Help with parse error
        160139 by: James Johnson
        160141 by: Kae Verens

Re: Your application
        160140 by: majordomo.psg.com

Thank you!
        160142 by: MARMS.PHPEDIT.NET

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 ---
is it possible to remove an element of an indexed array such as this exemple
        $A = array('a', 'b', 'c', 'd', 'e', 'f');
in a way that we can optain this result :
        $A = array('a', 'b', 'd', 'e', 'f');

something like that perhaps ?
array_remove($A, 2);

If such a function does not exists, what would be the more efficient way to 
do so a lot of time on very big arrays ?



--- End Message ---
--- Begin Message ---
On Wed, 20 Aug 2003 00:25:32 +0200
Decapode Azur <[EMAIL PROTECTED]> wrote:

> is it possible to remove an element of an indexed array such as this
> exemple
>       $A = array('a', 'b', 'c', 'd', 'e', 'f');
> in a way that we can optain this result :
>       $A = array('a', 'b', 'd', 'e', 'f');
> 
> something like that perhaps ?
> array_remove($A, 2);
> 
> If such a function does not exists, what would be the more efficient
> way to do so a lot of time on very big arrays ?

unset(array[x]);

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


-- 
Andu

--- End Message ---
--- Begin Message ---
unset($A[2]);

-----Original Message-----
From: Decapode Azur [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 3:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] in the middle of shift and pop

is it possible to remove an element of an indexed array such as this
exemple
        $A = array('a', 'b', 'c', 'd', 'e', 'f');
in a way that we can optain this result :
        $A = array('a', 'b', 'd', 'e', 'f');

something like that perhaps ?
array_remove($A, 2);

If such a function does not exists, what would be the more efficient way
to 
do so a lot of time on very big arrays ?



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




--- End Message ---
--- Begin Message ---
> is it possible to remove an element of an indexed array such as this
> exemple $A = array('a', 'b', 'c', 'd', 'e', 'f');
> in a way that we can optain this result :
>       $A = array('a', 'b', 'd', 'e', 'f');
>
> something like that perhaps ?
> array_remove($A, 2);
>
> If such a function does not exists, what would be the more efficient way
> to do so a lot of time on very big arrays ?

perhaps this way :

<?php
function array_remove($array, $remove) {
    foreach ($remove as $rem)   unset($array[$rem]);
    foreach($array as $a)       $rem_array[] = $a;
    return $rem_array;
}

$array  = array('A','B','C','D','E','F','G','H','I','J');
$remove = array(2, 5, 7);

print_r($array);
$rem_array = array_remove($array, $remove);
print_r($rem_array);
?>


--- End Message ---
--- Begin Message ---
> unset($A[2]);

No this function does not exactly what I want.
unset() makes empty hole with $A[2] = Null

I would like to have this result :
Array
(
    [0] => a
    [1] => b
    [2] => d
    [3] => e
    [4] => f
)
and not this one :
Array
(
    [0] => a
    [1] => b
    [3] => d
    [4] => e
    [5] => f
)


>> is it possible to remove an element of an indexed array such as this
>> exemple
>>      $A = array('a', 'b', 'c', 'd', 'e', 'f');
>> in a way that we can optain this result :
>>      $A = array('a', 'b', 'd', 'e', 'f');
>>
>> something like that perhaps ?
>> array_remove($A, 2);
>>
>> If such a function does not exists, what would be the more efficient way
>> to do so a lot of time on very big arrays ?



--- End Message ---
--- Begin Message ---
On Wed, 20 Aug 2003 00:25:32 +0200, you wrote:

>is it possible to remove an element of an indexed array such as this exemple
>       $A = array('a', 'b', 'c', 'd', 'e', 'f');
>in a way that we can optain this result :
>       $A = array('a', 'b', 'd', 'e', 'f');
>
>something like that perhaps ?
>array_remove($A, 2);
>
>If such a function does not exists, what would be the more efficient way to 
>do so a lot of time on very big arrays ?

In the specific case, I would unset() the nth element then reindex.

unset ($A[2]);
$A = array_values ($A);

As to speed... *shrug*. Suck it and see.

In the general case (removing n elements), either a loop of unset()s or a
couple of array_slice()s to get the two halves and array_merge() to stick
them together.


--- End Message ---
--- Begin Message ---
Well, if you knew (for instance) that $A[2] should be removed then you
could do something like:

<?php
foreach ($A as $key => $value)
{
  if ($key < 2)
  {  $B[$key] = $value; }
  elseif ($key > 2)
  {  $B[($key - 1)] = $value; }
}
?>

Modify the above code as needed...

-Dan

On Tue, 2003-08-19 at 22:25, Decapode Azur wrote:
> is it possible to remove an element of an indexed array such as this exemple
>       $A = array('a', 'b', 'c', 'd', 'e', 'f');
> in a way that we can optain this result :
>       $A = array('a', 'b', 'd', 'e', 'f');
> 
> something like that perhaps ?
> array_remove($A, 2);
> 
> If such a function does not exists, what would be the more efficient way to 
> do so a lot of time on very big arrays ?
> 
> 


--- End Message ---
--- Begin Message ---
If you unset an array that isn't associative, will that mean there will
be a gap in the numbers?  Or will PHP realize "OK I need to change the
numbers indexing the other elements"?

-Dan

On Tue, 2003-08-19 at 22:27, andu wrote:
> On Wed, 20 Aug 2003 00:25:32 +0200
> Decapode Azur <[EMAIL PROTECTED]> wrote:
> 
> > is it possible to remove an element of an indexed array such as this
> > exemple
> >     $A = array('a', 'b', 'c', 'd', 'e', 'f');
> > in a way that we can optain this result :
> >     $A = array('a', 'b', 'd', 'e', 'f');
> > 
> > something like that perhaps ?
> > array_remove($A, 2);
> > 
> > If such a function does not exists, what would be the more efficient
> > way to do so a lot of time on very big arrays ?
> 
> unset(array[x]);
> 
> > 
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 
> > 
> 
> 
> -- 
> Andu


--- End Message ---
--- Begin Message --- Decapode Azur wrote:

is it possible to remove an element of an indexed array such as this exemple
        $A = array('a', 'b', 'c', 'd', 'e', 'f');
in a way that we can optain this result :
        $A = array('a', 'b', 'd', 'e', 'f');

something like that perhaps ?
array_remove($A, 2);

If such a function does not exists, what would be the more efficient way to do so a lot of time on very big arrays ?

the function exists and is called array_splice. eg:


<?

$A = array('a', 'b', 'c', 'd', 'e', 'f');

array_splice($A,2,1);

print_r($A);

?>

running this produces:

Array
(
    [0] => a
    [1] => b
    [2] => d
    [3] => e
    [4] => f
)




--- End Message ---
--- Begin Message ---
Hmm....wondering why I keep receiving email sent to the list, that has
this stupid attachment...anyone else getting these?

Matt


--- End Message ---
--- Begin Message ---
Yep me,
was wondering why am i getting so many virus attachments from the list...but
figured that a lot of the list subscribers are probably infected...was
looking out for my name in the from: field :-D

I wonder which virus/worm it is though....am too lazy to check right now.

Cheers,
-Ryan


We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com


----- Original Message ----- 
From: "Matt Babineau" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 9:20 PM
Subject: [PHP] is the list getting virus spammed?


> Hmm....wondering why I keep receiving email sent to the list, that has
> this stupid attachment...anyone else getting these?
>
> Matt
>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
Matt Babineau <mailto:[EMAIL PROTECTED]>
    on Tuesday, August 19, 2003 12:21 PM said:

> Hmm....wondering why I keep receiving email sent to the list, that has
> this stupid attachment...anyone else getting these?

It's the Sobig.F worm. My server has already refused 20 today as well as
my users have received a few bounces from other servers.

And yes everyone on the list is getting those messages.


Chris.

--- End Message ---
--- Begin Message ---
yup, I got 5 instances.  I am being slammed by viral messages today, 7 from
another client.
Bill

----- Original Message ----- 
From: "Matt Babineau" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 12:20 PM
Subject: [PHP] is the list getting virus spammed?


> Hmm....wondering why I keep receiving email sent to the list, that has
> this stupid attachment...anyone else getting these?
>
> Matt
>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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

Matt Babineau wrote:

Hmm....wondering why I keep receiving email sent to the list, that has
this stupid attachment...anyone else getting these?

Yes, I also got those mails. It's Sobig-F.


--
regards,

------------------------------------------------------------
Nelson Rodríguez-Peña A.
Diseño y Desarrollo Web y Multimedia
------------------------------------------------------------


--- End Message ---
--- Begin Message ---
Yes, it's Sobig-F: http://www.sophos.com/virusinfo/analyses/w32sobigf.html

Just don't run the attachment and everyone will be fine.

It's just one of those viruses that spoofs the from address from somebody
that it finds in the infected user's address book or their out/inbox. 

Hopefully the site that manages the list will update it's virus definitions
soon and we won't have to deal with it.

-M

-----Original Message-----
From: Matt Babineau [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 19, 2003 3:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] is the list getting virus spammed?


Hmm....wondering why I keep receiving email sent to the list, that has this
stupid attachment...anyone else getting these?

Matt


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





--- End Message ---
--- Begin Message ---
Yes. A virus is trying to spread through the list. I just read details about
it on zdnet's site.

Jeff Pearson

-----Original Message-----
From: Matt Babineau [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 12:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] is the list getting virus spammed?


Hmm....wondering why I keep receiving email sent to the list, that has
this stupid attachment...anyone else getting these?

Matt


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



--- End Message ---
--- Begin Message --- Steelhead wrote:

yup, I got 5 instances. I am being slammed by viral messages today, 7 from
another client.


27 so far have been quarantined on my end (not all originating from this list.)

--
H| I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.






--- End Message ---
--- Begin Message ---
I think you guys are bragging :)  I have had over 100 easily.. about 3 or 4
every 5 minutes..  it's pretty bad.  I work with a bunch of colleges and I
think they are the ones getting hit the worse :(

Rick

I look forward to the invention of faster-than-light travel. What I'm not
looking forward to is the long wait in the dark once I arrive at my
destination. - Marc Beland

> From: "Ashley M. Kirchner" <[EMAIL PROTECTED]>
> Organization: Photo Craft Laboratories, Inc.
> Date: Tue, 19 Aug 2003 20:46:26 -0600
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] is the list getting virus spammed?
> 
> Steelhead wrote:
> 
>> yup, I got 5 instances. I am being slammed by viral messages today, 7 from
>> another client.
> 
> 
>   27 so far have been quarantined on my end (not all originating from
> this list.)
> 
> -- 
> H| I haven't lost my mind; it's backed up on tape somewhere.
> +--------------------------------------------------------------------
> Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
> IT Director / SysAdmin / WebSmith             .     800.441.3873 x130
> Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave. #6
> http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message ---
how are they ever getting through ?

the funniest of all is the windows update spam virus shit, obviously
targetting the ladite and the weak.

> Steelhead wrote:
>
>> yup, I got 5 instances. I am being slammed by viral messages today, 7
>> from another client.
>
>
>    27 so far have been quarantined on my end (not all originating from
> this list.)
>
> --
> H| I haven't lost my mind; it's backed up on tape somewhere.
>  +--------------------------------------------------------------------
>  Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
>  IT Director / SysAdmin / WebSmith             .     800.441.3873 x130
>  Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave. #6
>  http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message --- please cc me ....

Anyone on a shared, name-based IP, ensim web appliance hosted website?

Can you tell me how to set the freekin':

php_value auto_prepend_file "/some_freekin_unknown_real_directory_path_to_HOME/my_paths/prepend.php"

value in my .htaccess file?


--- End Message ---
--- Begin Message --- Dennis Gearon wrote:
please cc me ....

Anyone on a shared, name-based IP, ensim web appliance hosted website?

Can you tell me how to set the freekin':

php_value auto_prepend_file "/some_freekin_unknown_real_directory_path_to_HOME/my_paths/prepend.php"

value in my .htaccess file?

Heh... I went through this. I could only find out the "real" path by creating an error on a PHP page. It gave the real path in the error message. Use that in your .htaccess file.


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





--- End Message ---
--- Begin Message --- Do you have

AllowOverride All

in your httpd.conf file for that dir?

-Michael
Dennis Gearon wrote:

please cc me ....

Anyone on a shared, name-based IP, ensim web appliance hosted website?

Can you tell me how to set the freekin':

php_value auto_prepend_file "/some_freekin_unknown_real_directory_path_to_HOME/my_paths/prepend.php"

value in my .htaccess file?





--- End Message ---
--- Begin Message ---
Jim Lucas wrote:

> actually, you should be able to do this without ever leaving the page that
> were clicking from.

I wasn't clear enough in my original post. You are right that the user
never leaves the page he is on. That's ok.

But what I would like to do is have the page reload itself so that it
can remove the file that has just been downloaded from it's list.

Is that possible?

Thanks,

Jean-Christian Imbeault


--- End Message ---
--- Begin Message --- Use PHP's file functions to read the file and output it to the browser, sending the attachment header so it opens the save as dialog. After you finish outputing the file unlink() the file.

Another way to do this is to store the files outside your www root, then authorize the user to access the file by giving them a URL with a unique id on the end like auth=ADFS_Ddadfass that is randomly generated. When the script is visited it looks in the database, checks to see if the auth variable is a valid download key if it is it reads the file and outputs it, if it isn't then it refuses the download. This method allows you to set a timeout for example they can download the file for 4 hours (store the unix timestamp in the database and look for records that are less than 4 hours long and match the download key). If you only wanted them to download once with this method just delete the key from the database once the download occurs, this will be less resource intensive because you aren't copying and deleting files on every download.

Jason

Jean-Christian IMbeault wrote:

Jim Lucas wrote:



actually, you should be able to do this without ever leaving the page that
were clicking from.



I wasn't clear enough in my original post. You are right that the user never leaves the page he is on. That's ok.

But what I would like to do is have the page reload itself so that it
can remove the file that has just been downloaded from it's list.

Is that possible?

Thanks,

Jean-Christian Imbeault






--- End Message ---
--- Begin Message ---
Jason Sheets wrote:

> Use PHP's file functions to read the file and output it to the browser, 
> sending the attachment header so it opens the save as dialog.  After you 
> finish outputing the file unlink() the file.

You didn't quite catch what I wanted to do. No file exists on my server.
I just give a bunch of buttons to the user, the buttons are in a form.
The form's action is another PHP script.

That script generates some data and forces a save-as dialog to open so
the user can save the data as a file. The script also stores in a
database the fact that this user has generated this file so that the
next time he visits the button for generating this particular file will
not appear in the list again.

The problem is that the page the user is on doesn't change once he
clicks the button.

What I want is that after a button has been clicked the current page,
the I generate the data file, cause a save-as dialog to open, and then
reload the current page (file list) so that I can present the user with
a list of buttons (data files he can generate) again (with the button he
clicked no longer in the list).

Do-able?

Jean-Christian Imbeault


--- End Message ---
--- Begin Message ---
> You also asked a very, very common question, i.e. how to alternate colors
in
> table rows... there are a ton of websites/tutorials out there that explain
> ways to do this.
>
> ---John Holmes...
........................................

Apologies for the lengthy code.

I've tried using a few tutorials and am still adrift.

Here's a snippet:

Thank you for any assistance.
Tony Ritter
..................

<?

<table width=100% cellpadding=3 cellspacing=1 border=1>
   <tr>
   <th bgcolor=\"#497fbf\"><font color=\"#ffffff\">AUTHOR</font>
   </th>
   <th bgcolor=\"#497fbf\"><font color=\"#ffffff\">POST</font></th>
   </tr>";

   while ($posts_info = mysql_fetch_array($get_posts_res)) {
       $post_id = $posts_info['post_id'];
       $post_text = nl2br(stripslashes($posts_info['post_text']));
       $post_create_time = $posts_info['fmt_post_create_time'];
       $post_owner = stripslashes($posts_info['post_owner']);

       $color1 = "#CCFFCC";
       $color2 = "#BFD8BC";
       $posts_info = 0;
       $row_color = ($posts_info % 2) ? $color1 : $color2;

       //add to display
       $display_block .= "
       <tr>
       <td width=35% valign=top
bgcolor=\"$row_color\"><p>$post_owner<br>[$post_create_time]</td>
       <td width=65% valign=top bgcolor=\"$row_color\"><p>$post_text<br><br>
       <a href=\"replytopost.php?post_id=$post_id\"><strong>REPLY TO
POST</strong></a></td>

       </tr>";

   }

  //close up the table
  $display_block .= "</table>";
?>
.................



--- End Message ---
--- Begin Message --- Anthony Ritter wrote:

You also asked a very, very common question, i.e. how to alternate colors

in


table rows... there are a ton of websites/tutorials out there that explain
ways to do this.

---John Holmes...

........................................


Apologies for the lengthy code.

I've tried using a few tutorials and am still adrift.

Here's a snippet:

Thank you for any assistance.
Tony Ritter
..................

<?

<table width=100% cellpadding=3 cellspacing=1 border=1>
   <tr>
   <th bgcolor=\"#497fbf\"><font color=\"#ffffff\">AUTHOR</font>
   </th>
   <th bgcolor=\"#497fbf\"><font color=\"#ffffff\">POST</font></th>
   </tr>";

   while ($posts_info = mysql_fetch_array($get_posts_res)) {
       $post_id = $posts_info['post_id'];
       $post_text = nl2br(stripslashes($posts_info['post_text']));
       $post_create_time = $posts_info['fmt_post_create_time'];
       $post_owner = stripslashes($posts_info['post_owner']);

       $color1 = "#CCFFCC";
       $color2 = "#BFD8BC";
       $posts_info = 0;

Move the above line outside of your while loop


$row_color = ($posts_info % 2) ? $color1 : $color2;

$row_color = ($posts_info++ % 2) ? $color1 : $color2;


You were setting $posts_info to zero in each loop, so it's never going to change. You must set it to zero outside of the loop, then increment it within.

You could make this real easy and just do:

$row_color = ($row_color == $color1) ? $color2 : $color1;

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





--- End Message ---
--- Begin Message ---
Thanks very much John.

I found the following and inserted it into my snippet for alternating
backgoriund colors.

However, I'm not sure I understand the logic.

This part:
...............................

$alternate = "2";
   while ($posts_info = mysql_fetch_array($get_posts_res)) {
       $post_id = $posts_info['post_id'];
       $post_text = nl2br(stripslashes($posts_info['post_text']));
       $post_create_time = $posts_info['fmt_post_create_time'];
       $post_owner = stripslashes($posts_info['post_owner']);

if ($alternate == "1") {
$color = "#eaf3da";
$alternate = "2";
}
else {
$color = "#d5eae9";
$alternate = "1";
}
........................

Best...
Tony
.........................

$display_block = "
   <P>Showing posts for the <strong>$topic_title</strong> topic:</p>

   <table width=100% cellpadding=3 cellspacing=1 border=0>
   <tr>
   <th bgcolor=\"#497fbf\"><font color=\"#ffffff\">AUTHOR</font>
   </th>
   <th bgcolor=\"#497fbf\"><font color=\"#ffffff\">POST</font></th>
   </tr>";
   $alternate = "2";
   while ($posts_info = mysql_fetch_array($get_posts_res)) {
       $post_id = $posts_info['post_id'];
       $post_text = nl2br(stripslashes($posts_info['post_text']));
       $post_create_time = $posts_info['fmt_post_create_time'];
       $post_owner = stripslashes($posts_info['post_owner']);

if ($alternate == "1") {
$color = "#eaf3da";
$alternate = "2";
}
else {
$color = "#d5eae9";
$alternate = "1";
}


       //add to display
       $display_block .= "
       <tr>
       <td width=35% valign=top bgcolor=\"$color\"><p><a
href=mailto:$post_owner>$post_owner<br></a>[$post_create_time]</td>
       <td width=65% valign=top bgcolor=\"$color\"><p>$post_text<br><br>
       <a href=\"replytopost.php?post_id=$post_id\"><img src=\"reply.gif\"
border=\"0\" align=\"right\"></a></td>

       </tr>";

   }

  //close up the table
  $display_block .= "</table>";


----- Original Message -----
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "Anthony Ritter" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 9:59 PM
Subject: Re: [PHP] mysql output


> Anthony Ritter wrote:
>
> >>You also asked a very, very common question, i.e. how to alternate
colors
> >
> > in
> >
> >>table rows... there are a ton of websites/tutorials out there that
explain
> >>ways to do this.
> >>
> >>---John Holmes...
> >
> > ........................................
> >
> > Apologies for the lengthy code.
> >
> > I've tried using a few tutorials and am still adrift.
> >
> > Here's a snippet:
> >
> > Thank you for any assistance.
> > Tony Ritter
> > ..................
> >
> > <?
> >
> > <table width=100% cellpadding=3 cellspacing=1 border=1>
> >    <tr>
> >    <th bgcolor=\"#497fbf\"><font color=\"#ffffff\">AUTHOR</font>
> >    </th>
> >    <th bgcolor=\"#497fbf\"><font color=\"#ffffff\">POST</font></th>
> >    </tr>";
> >
> >    while ($posts_info = mysql_fetch_array($get_posts_res)) {
> >        $post_id = $posts_info['post_id'];
> >        $post_text = nl2br(stripslashes($posts_info['post_text']));
> >        $post_create_time = $posts_info['fmt_post_create_time'];
> >        $post_owner = stripslashes($posts_info['post_owner']);
> >
> >        $color1 = "#CCFFCC";
> >        $color2 = "#BFD8BC";
> >        $posts_info = 0;
>
> Move the above line outside of your while loop
>
> >        $row_color = ($posts_info % 2) ? $color1 : $color2;
>
> $row_color = ($posts_info++ % 2) ? $color1 : $color2;
>
> You were setting $posts_info to zero in each loop, so it's never going
> to change. You must set it to zero outside of the loop, then increment
> it within.
>
> You could make this real easy and just do:
>
> $row_color = ($row_color == $color1) ? $color2 : $color1;
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> PHP|Architect: A magazine for PHP Professionals – www.phparch.com
>
>
>
>
> ---
> [This E-mail scanned for viruses by gonefishingguideservice.com]
>
>

---
[This E-mail scanned for viruses by gonefishingguideservice.com]


--- End Message ---
--- Begin Message --- Anthony Ritter wrote:

I found the following and inserted it into my snippet for alternating
backgoriund colors.

However, I'm not sure I understand the logic.
[snip]
if ($alternate == "1") {
$color = "#eaf3da";
$alternate = "2";
}
else {
$color = "#d5eae9";
$alternate = "1";
}

It's just a long way of alternating colors. When $alternate is one, color1 is set, then $alternate is set to two. The next time through the loop, the color will be set to color2, then $alternate is set back to one. Then the cycle repeats.


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





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

how can i use session variables in a page with  multiple framesets?
where in all frame will get the session variables being passed

thanks

--- End Message ---
--- Begin Message --- It's the same as any other web page. When you define a frameset, you do so with URLs, so the session value can be passed to each window of the frameset via the URL.

Obviously cookies or PHP enabled with enable-trans-sid will make this job easy/transparent.

The real issue you have is that a frameset is designed so that only one frame loads on a click, while the others stay static. With sessions, this means that active windows will keep 'up-to-date' with session vars, whilst static frames (like a navigation bar) will fall behind.

So, a major issue will be if all frames need to remain up-to-date? If so, you need a way (javascript or re-draw the whole frameset) of refreshing them all (or just the ones you need) at certain intervals, or upon certain actions.

As you're no doubt thinking, this makes life very difficult, and with all the refreshing going on, the whole point of having frames is lost.


Ask yourself if frames are REALLY required to create the right user experience with your site. Look at all the big sites... Do any of them use frames? No way.


IMO, They're more trouble than any possible benefit they provide -- especially when you have issues like sessions, shopping carts and anything else which requires state.


Justin French




On Wednesday, August 20, 2003, at 11:20 AM, Aris Santillan wrote:

hi

how can i use session variables in a page with  multiple framesets?
where in all frame will get the session variables being passed

thanks


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

I'm going off to school and won't have computer access for like 9 months... :-\ .. and I need someone with a couple of hours every week to monitor my CMS for bug reports, and to fix bugs (if they want). I would appreciate it so much. The project resides at: http://sourceforgen.net/projects/prattcms/. Please let me know in the next week!

Thanks!
-Michael


--- End Message ---
--- Begin Message --- Why not go to a cybercafe every few days or once a week and check on the project? You can also go to Kinkos or your local library, most of them have internet enabled pcs.

Jason

Michael A Smith wrote:

Hi,

I'm going off to school and won't have computer access for like 9 months... :-\ .. and I need someone with a couple of hours every week to monitor my CMS for bug reports, and to fix bugs (if they want). I would appreciate it so much. The project resides at: http://sourceforgen.net/projects/prattcms/. Please let me know in the next week!

Thanks!
-Michael




--- End Message ---
--- Begin Message ---
* Thus wrote Jason Sheets ([EMAIL PROTECTED]):
> Why not go to a cybercafe every few days or once a week and check on the 
> project?  You can also go to Kinkos or your local library, most of them 
> have internet enabled pcs.
 
The library is good, plenty of reading material while waiting for
a computer.  I did that for 2 months, brushed up on number theory.


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

--- End Message ---
--- Begin Message --- Did you put in a 'help wanted' at sourceforge? usually works.



Jason Sheets wrote:

Why not go to a cybercafe every few days or once a week and check on the project? You can also go to Kinkos or your local library, most of them have internet enabled pcs.

Jason

Michael A Smith wrote:

Hi,

I'm going off to school and won't have computer access for like 9 months... :-\ .. and I need someone with a couple of hours every week to monitor my CMS for bug reports, and to fix bugs (if they want). I would appreciate it so much. The project resides at: http://sourceforgen.net/projects/prattcms/. Please let me know in the next week!

Thanks!
-Michael






--

Raditha Dissanayake
-------------------------------------------------------------
http://www.radinks.com/sftp/
Lean and mean Secure FTP applet with Graphical User Inteface.
just 150 Kilo Bytes



--- End Message ---
--- Begin Message ---
Please see the attached file for details.

--- End Message ---
--- Begin Message ---
Please see the attached file for details.

--- End Message ---
--- Begin Message --- [EMAIL PROTECTED] wrote:

Please see the attached file for details.


Did anyone's AV pick up a virus in this email? It went right through mine but obviously doesn't belong on this list. I just got the latest definitions from Norton, too...


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





--- End Message ---
--- Begin Message --- John W. Holmes wrote:

Did anyone's AV pick up a virus in this email? It went right through mine but obviously doesn't belong on this list. I just got the latest definitions from Norton, too...

Mine did. MIMEDefang with SpamAssassin on the mail spool.


--
H| I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.






--- End Message ---
--- Begin Message ---
i got it 10 times today

> [EMAIL PROTECTED] wrote:
>
>> Please see the attached file for details.
>>
>
> Did anyone's AV pick up a virus in this email? It went right through
> mine but obviously doesn't belong on this list. I just got the latest
> definitions from Norton, too...
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> PHP|Architect: A magazine for PHP Professionals – www.phparch.com
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message ---
See the attached file for details

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

On 08/19/2003 04:56 PM, Dan Van Derveer wrote:
I have had no success sending multipart/alternative emails with php. I have
tried everyone's various code snippets with no luck. I test the results with
Outlook and Outlook Express. Everytime my boundary tag ends up showing as
part of my message and thus the plain text and html portions show up as one
long blob of unformatted text. Below is the code I am currently using. Any
suggestions would be greatly appreciated.

That looks like a bug of the mail() function. You may want to try this class that provides an easy interface for composing and sending multipart/alternative MIME messages and has workarounds for some of the mail() function problems:


http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

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


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

I need to make a date that is 30 days from the current date, and, am
having problems with mktime

Here's what I've tried:


--- End Message ---
--- Begin Message ---
Sorry about the previous post. 

Hi,

I need to make a date that is 30 days from the current date, and, am
having problems with mktime

Here's what I've tried:

$endDate=date('Y-m-d',mktime(0,0,0,date('m',time()),30,date('y',time()))
);

Return this: 2003-08-30

Is there an easy way to do this?

Thanks,
James


--- End Message ---
--- Begin Message ---
print date('Y-m-d',mktime(0,0,0,date('m'),date('d')+30,date('Y')));

Quoting James Johnson <[EMAIL PROTECTED]>:

> Sorry about the previous post. 
> 
> Hi,
> 
> I need to make a date that is 30 days from the current date, and, am
> having problems with mktime
> 
> Here's what I've tried:
> 
> $endDate=date('Y-m-d',mktime(0,0,0,date('m',time()),30,date('y',time()))
> );
> 
> Return this: 2003-08-30
> 
> Is there an easy way to do this?
> 
> Thanks,
> James
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 





---------------------------------------------------
Sign Up for free Email at http://ureg.home.net.my/
---------------------------------------------------

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

I am new to this group please do not ignore..

I am running redhat 7.1 Linux Apache/1.3.27 (Unix).

The server got restarted due to power malfunction. After it restarted
again it is unable to start httpd service display below error.

[warn] Loaded DSO libexec/libphp4.so uses plain Apache 1.3 API, this
module might crash under EAPI! (please recompile it with -DEAPI)

What should I do to repair it?

Thanks in advance for any help.

Rp...



--- End Message ---
--- Begin Message ---
Check this
http://www.phpbuilder.com/mail/php-general/2000062/0811.php
-murugesan
----- Original Message ----- 
From: "Rikunj" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 20, 2003 11:53 AM
Subject: [PHP] Apache starting error


> Hello all,
> 
> I am new to this group please do not ignore..
> 
> I am running redhat 7.1 Linux Apache/1.3.27 (Unix).
> 
> The server got restarted due to power malfunction. After it restarted
> again it is unable to start httpd service display below error.
> 
> [warn] Loaded DSO libexec/libphp4.so uses plain Apache 1.3 API, this
> module might crash under EAPI! (please recompile it with -DEAPI)
> 
> What should I do to repair it?
> 
> Thanks in advance for any help.
> 
> Rp...
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
hay guyz

i am trying to call, in php ,  a java class method which happens to
be my own as well .... user defined that is

how do i go about this ????
and that also if its possible at all .....

thanx a million

toby


________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/

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

I'm trying to figure out this error I'm getting in my code:

Parse error: parse error in /home/.paco/campuscb/AdPayment.php on line 9

This is the code on line 9:

$sDate = date('Y-m-d',time());

Does this look valid?
Thanks,
James


--- End Message ---
--- Begin Message --- James Johnson wrote:
Hi,

I'm trying to figure out this error I'm getting in my code:

Parse error: parse error in /home/.paco/campuscb/AdPayment.php on line 9

This is the code on line 9:

$sDate = date('Y-m-d',time());

if you're looking for the current time, then this is sufficient: $sDate=date('Y-m-d');

the error is most likely on a line above that one. I've never seen date() called in the way you did, though - the documentation (http://php.net/date) says that time() is the default for the second parameter, so is never actually needed.

Kae


--- End Message ---
--- Begin Message ---
Please see the attached file for details.

--- End Message ---
--- Begin Message ---
See the attached file for details

--- End Message ---

Reply via email to