php-general Digest 1 Aug 2004 12:40:31 -0000 Issue 2911

Topics (messages 192423 through 192433):

Re: function similar to to sizeof
        192423 by: raditha dissanayake
        192424 by: bruce
        192432 by: Justin Patrin

Another problem with grids and checkboxes
        192425 by: Henri Marc
        192426 by: John Holmes

Re: Invisible watermarking / GD2
        192427 by: Jason Wong

Re: php4.3.7 + phpBB 2.0.10 + Apache - zero sized replies with no hits/errors logged 
by apache
        192428 by: John Nichel

Re: php4.3.7 + phpBB 2.0.10 + Apache - zero sized replies with
        192429 by: ADFH
        192433 by: John Nichel

Re: SPAMCEASE ???
        192430 by: ADFH

Re: Still need help with regex function
        192431 by: Justin Patrin

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 ---
bruce wrote:

does php have a function similar to the 'C' sizeof function...


yep in PHP 5 but it's just an alias for count.

i'm looking to copy an object, and i'd like to be able to copy it at the
binary level....


So how about using the clone feature of PHP5 instead of doing this manually.

but i need to be able to determine the size of the object...


not sure why you want to do that.

any thoughts/comments..???



quick and dirty way to copy and object serialize it into a string and deserialize it back again.


thanks

-bruce





--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/         | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.

--- End Message ---
--- Begin Message ---
specifically, i'm looking to return an object using the socket_write(). this
requires that i be able to give it the size of the object being passed...

if you know of another approach, i'm more than interested...

-thanks


-----Original Message-----
From: raditha dissanayake [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 31, 2004 6:16 PM
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] function similar to to sizeof


bruce wrote:

>does php have a function similar to the 'C' sizeof function...
>
>
yep in PHP 5 but it's just an alias for count.

>i'm looking to copy an object, and i'd like to be able to copy it at the
>binary level....
>
>
So how about using the clone feature of PHP5 instead of doing this manually.

>but i need to be able to determine the size of the object...
>
>
not sure why you want to do that.

>any thoughts/comments..???
>
>

quick and dirty way to copy and object serialize it into a string and
deserialize it back again.

>thanks
>
>-bruce
>
>
>


--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/         | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.

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

--- End Message ---
--- Begin Message ---
On Sat, 31 Jul 2004 18:24:06 -0700, bruce <[EMAIL PROTECTED]> wrote:
> specifically, i'm looking to return an object using the socket_write(). this
> requires that i be able to give it the size of the object being passed...
> 
> if you know of another approach, i'm more than interested...
> 
> -thanks
> 

serialize() it, then get the size of the string, send it, and
deserialize() it on the other side.

> 
> 
> 
> -----Original Message-----
> From: raditha dissanayake [mailto:[EMAIL PROTECTED]
> Sent: Saturday, July 31, 2004 6:16 PM
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] function similar to to sizeof
> 
> bruce wrote:
> 
> >does php have a function similar to the 'C' sizeof function...
> >
> >
> yep in PHP 5 but it's just an alias for count.
> 
> >i'm looking to copy an object, and i'd like to be able to copy it at the
> >binary level....
> >
> >
> So how about using the clone feature of PHP5 instead of doing this manually.
> 
> >but i need to be able to determine the size of the object...
> >
> >
> not sure why you want to do that.
> 
> >any thoughts/comments..???
> >
> >
> 
> quick and dirty way to copy and object serialize it into a string and
> deserialize it back again.
> 
> >thanks
> >
> >-bruce
> >
> >
> >
> 
> --
> Raditha Dissanayake.
> ------------------------------------------------------------------------
> http://www.radinks.com/sftp/         | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 128 KB | with progress bar.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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

I have another problem with my program. Again!

Here it is:
I have some grids. To make it simple, let's say I have
two grids like this:

<td style="vertical-align: top;">1<input
name="grid[1][1]" value="1" type="checkbox"><br>
              </td>
<td style="vertical-align: top;">2<input
name="grid[1][2]" value="2" type="checkbox"><br>
              </td>
            </tr>
<tr align="center"><td style="vertical-align:
top;">3<input name="grid[1][3]" value="3"
type="checkbox"><br>

<td style="vertical-align: top;">1<input
name="grid[2][1]" value="1" type="checkbox"><br>
              </td>
<td style="vertical-align: top;">2<input
name="grid[2][2]" value="2" type="checkbox"><br>
              </td>
            </tr>
<tr align="center"><td style="vertical-align:
top;">3<input name="grid[2][3]" value="3"
type="checkbox"><br>

Each grid has 3 numbers, 1, 2 and 3.
There is grid[1][1], grid[1][2] and grid[1][3]
There is also the second grid, grid[2][1], grid[2][2],
grid[2][3]

The checked boxes are in an array $grid.
If the user doesn't check enough boxes, the program
must print the form again with the first choices of
this user.
I made a function for this task:

function was_selected($option)   {
GLOBAL $grid;
for ($j=1;$j<3;$j++) {//number of grids
   for ($k=1;$k<4;$k++) {//number of boxes
      if (isset($grid[$j][$k])) {
      if ($grid[$j][$k]==$option)   {
return TRUE;

Then my form is something like that:
<td style="vertical-align: top;">1<input
name="grid[1][1]" value="1" <?php
if(was_selected("1"))) {echo "checked";}?>
type="checkbox"><br>

So, normally, if the user chooses the box 1 from the
first grid, the first box of the first grid should be
checked when the browser prints the form again. But in
fact, the first box of the second grid is also
checked.

The reason is certainly because the values are the
same in all the grids. But I can't change them as it's
to make a lottery with many grids.
How can I solve this problem?

Thank you so much for your help.


        

        
                
Vous manquez d’espace pour stocker vos mails ? 
Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour 
dialoguer instantanément avec vos amis. A télécharger gratuitement sur 
http://fr.messenger.yahoo.com

--- End Message ---
--- Begin Message ---
Henri Marc wrote:

<td style="vertical-align: top;">1<input
name="grid[1][1]" value="1" type="checkbox"><br>
              </td>
[snip]
<td style="vertical-align: top;">1<input
name="grid[2][1]" value="1" type="checkbox"><br>
              </td>

Is there a reason you're sending a 1, 2 or 3 value with the checkboxes? You already know what was checked by the keys of the $grid array. I'd leave it similar to how you have it, but just pass 1 for every value (since you won't be needing it). You can create your grid like this:


<td style="vertical-align: top;">1<input name="grid[1][1]" value="1" type="checkbox"<?php if(isset($grid[1][1])){echo ' checked';}?>><br></td>

<td style="vertical-align: top;">2<input name="grid[2][2]" value="1" type="checkbox"<?php if(isset($grid[2][2])){echo ' checked';}?>><br></td>

etc...

That'll "remember" what boxes were checked when the grid is redisplayed, also.

--

John Holmes

php|architect - The magazine for PHP professionals - http://www.phparch.com
--- End Message ---
--- Begin Message ---
On Sunday 01 August 2004 07:10, Joseph Hill wrote:

> I use GD for stamping images with a visible watermark - in this case, a
> text string and a tracking number appended to the bottom of each image.
>
> However, I'd like to embed tracking information (I sometimes see my pics
> crop up on mailing lists... And they're the ones I see copied!) into the
> picture.
>
> Digimarc have a nifty looking copyrighting setup, but with a price-tag of
> over three grand for an automated system, it's not affordable.

Well it's their IP and they're free to make money from it.

> Does anyone know how to have PHP /GD invisibly watermark images? The info
> on the PHP site's GD info pages suggests this can't be done.

If I'm not mistaken, the only tools you need are the ability to read the 
colour info of a particular pixel, and the ability to set the colour of a 
particular pixel. The GD lib provides functions to do both.

The only other thing you need (which the GD lib does not provide) is a 
watermarking algorithm. I suspect google will have more info on those.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
"Card readers?  We don't need no stinking card readers."
-- Peter da Silva (at the National Academy of Sciencies, 1965, in a
   particularly vivid fantasy)
*/

--- End Message ---
--- Begin Message ---
ADFH wrote:

My IHP, Netset, currently went into what I think is Chapter 7.
I was stuck without a host for my messageboard..
Someone steps in and offers me a host.. cool.. I have a SQL dump..

I install phpBB, I import the data, I go to log in...
I get a zero sized response from apache!
Check the error logs.. nothing..
Check the hit logs.. nothing..
<big ole snip-a-roo>

How was the dump made, mysqldump? PHPMyAdmin? Something else?

How are you trying to import it? Command line MySQL? PHPMyAdmin? Something else?

How big is the dump file?  Greater than two megs?

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

--- End Message ---
--- Begin Message ---
> How was the dump made, mysqldump? PHPMyAdmin? Something else?

-- MySQL dump 9.10 - first dump
-- MySQL dump 9.11 - second dump (see below)

> How are you trying to import it?  Command line MySQL? PHPMyAdmin? 
> Something else?

command line (have SSH/SCP/SFTP access)

mysql dbname < dumpname.sql
(u/p in ~/.my.cnf, 0600)

> How big is the dump file?  Greater than two megs?

11M Jul 28 12:57 200405009-025130.sql
21M Jul 29 23:19 20040509-clean.sql
30K Jul 29 12:10 freshdb.sql

11MB for the initial dump
21MB for non-optimised dump from same DB tested as working, redumped
     from other system

Ie. I imported it into another system, fixed a few things like missing
    themes, and re-dumped it.

First DB is 2.0.8 DB
Second DB is updated to 2.0.10 DB
update tool finds no errors in DB

Also corrected things in phpbb_config that changed between hosts and
when I was testing etc.

--- End Message ---
--- Begin Message --- ADFH wrote:
How are you trying to import it? Command line MySQL? PHPMyAdmin? Something else?

command line (have SSH/SCP/SFTP access)

mysql dbname < dumpname.sql
(u/p in ~/.my.cnf, 0600)

How big is the dump file? Greater than two megs?

11M Jul 28 12:57 200405009-025130.sql 21M Jul 29 23:19 20040509-clean.sql 30K Jul 29 12:10 freshdb.sql

11MB for the initial dump
21MB for non-optimised dump from same DB tested as working, redumped
     from other system

Ie. I imported it into another system, fixed a few things like missing
    themes, and re-dumped it.

Well, that eliminates the first thought I had. Things like phpMyAdmin have problems with dump files greater than 2mb's (sometimes even if you set the file upload size and timeout higher on PHP).


Can you verify that the data is actually in the db?

Also, you may want to try importing the dump and not relying on your MySQL configuration file....

mysql --user=<username> -p dbname < dumpname.sql

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

--- End Message ---
--- Begin Message ---
> I got the following e-mail from this list. Is this legit? I'm skeptical
> because the URL it tells me to click on leads to what looks like a SPAM site
> to me. Here's the full e-mail I received with headers:
...
> Received: from tgpnexus.com ([66.17.150.83]) by mc3-f36.hotmail.com with
> Microsoft SMTPSVC(5.0.2195.6824); Thu, 22 Jul 2004 04:21:34 -0700
> Received: (from [EMAIL PROTECTED])by tgpnexus.com (8.11.6/8.11.6) id
> i6MB4jg26425; Thu, 22 Jul 2004 07:04:45 -0400

Looks like a spam to me!

--- End Message ---
--- Begin Message ---
On Sat, 31 Jul 2004 18:07:07 -0600, C.F. Scheidecker Antunes
<[EMAIL PROTECTED]> wrote:
> Hello,
> 
> In order to get the filenames from the output below I have tried the
> following:
> 
> preg_match_all('/inflating:"(.*?)"/', $stdout, $matches);

Why do you have " around the (.*?)? The sample text below doesn't have
". Also, you can use ^ for the beginning of the line and $ for the end
if you use the m modifier.
preg_match_all('/^inflating:(.*)$/m', $stdout, $matches);

> print_r($matches);
> return $matches[1];
> 
> But I only get empty arrays with it.
> 
> I need to fix that so I can have the filenames stored on arrays and also
> evaluate the type of output according to
> the situations ilustrated bellow.
> 
> Contents of $stdout:
> 
> unzip test.zip
> Archive:  test.zip
>  inflating: arch1.txt
>  inflating: arch2.txt
>  inflating: arch3.txt
>  inflating: arch4.txt
>  inflating: arch5.txt
>  inflating: arch6.txt
> 
> The same I have from a pkware execution :
> 
> pkunzip teste.zip
> PKZIP(R)  Version 6.0  FAST!  Compression Utility for Linux X86
> Copyright 1989-2002 PKWARE Inc.  All Rights Reserved. Evaluation Version
> PKZIP Reg. U.S. Pat. and Tm. Off.  Patent No. 5,051,745
> 
> Extracting files from .ZIP: teste.zip
>    Inflating: arch1.txt
>    Inflating: arch2.txt
>    Inflating: arch3.txt
>    Inflating: arch4.txt
>    Inflating: arch5.txt
> 
> So, I need some help on how to write a regexp to get the values after
> inflating, that is the filenames, and put them in an array. Both outputs
> above are stored on a $stdout php variable.
> 
> Also, I need to be able to indentify errors with the unzip utility that
> does not support some types of zip file, the output is like this:
> 
> unzip test1.zip
> Archive:  test1.zip
>   skipping: test1.txt              `shrink' method not supported
> 
> There's a skipping instead of a inflating or Inflating in pkware.
> 
> The third situation is an error on the zip file itself :
> 
> unzip test2.zip
> Archive:  test2.zip
>  End-of-central-directory signature not found.  Either this file is not
>  a zipfile, or it constitutes one disk of a multi-part archive.  In the
>  latter case the central directory and zipfile comment will be found on
>  the last disk(s) of this archive.
> unzip:  cannot find zipfile directory in one of test2.zip or
>        test2.zip.zip, and cannot find test2.zip.ZIP, period.
> 
> or
> 
> pkunzip test2.zip
> PKZIP(R)  Version 6.0  FAST!  Compression Utility for Linux X86
> Copyright 1989-2002 PKWARE Inc.  All Rights Reserved. Evaluation Version
> PKZIP Reg. U.S. Pat. and Tm. Off.  Patent No. 5,051,745
> 
> Extracting files from .ZIP: test2.zip
> Errors were found in .ZIP file, attempt to fix (<Y>es/<N>o)? N
> 
> PKZIP: (Z152) No CE signature found
> 
> Help is much appreacited.
> 
> Thanks in advance to all.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> !DSPAM:410c3369274921203516279!
> 
> 


-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

--- End Message ---

Reply via email to