Re: [PHP] quotemeta() question...

2005-02-10 Thread Chris
Because it's parsing $WRW as a string, because of the double quotes. so 
you would need to do it like this:

quotemeta('pat:1$WRW')
to not let it parse any variables
or
quotemeta("pat:1\$WRW")
to not parse that particular variable
Steve Kaufman wrote:
Why does
 quotemeta("pat:1$WRW")
return
 pat:1
instead of
 pat:1\$WRW
What am I misunderstanding about quotemeta function? 

 

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


Re: [PHP] Creating a varable with a name held in a string

2005-02-10 Thread John Holmes
Randy Johnson wrote:
I like to do this:
foreach( $row as $key=>$val) {
  $$key = $row[$key];
   
}
You're just recreating a slower version of extract()...
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Creating a varable with a name held in a string

2005-02-10 Thread Randy Johnson
I will read over extract and change my ways ;-)
Randy

John Holmes wrote:
Randy Johnson wrote:
I like to do this:
foreach( $row as $key=>$val) {
  $$key = $row[$key];
   }

You're just recreating a slower version of extract()...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Foreach problem.

2005-02-10 Thread Robert Cummings
On Thu, 2005-02-10 at 14:26, Richard Lynch wrote:
> Mirco Blitz wrote:
> > HI,
> > I am really confused.
> > I have an array, that looks like this:
> >
> > print_r($elementsarr) = Array ( [0] => knr [1] => subject [2] => title [3]
> > => kat [4] => pages [5] => access [6] => dofile [7] => MAX_FILE_SIZE [8]
> > =>
> > pdf [9] => dolink [10] => link [11] => erstam [12] => endless [13] => from
> > [14] => until [15] => openbem [16] => history [17] => closedbem [18] =>
> > [19]
> > => b [20] => br [21] => bw [22] => bay [23] => h [24] => hb [25] => hh
> > [26]
> > => mv [27] => n [28] => nw [29] => rp [30] => s [31] => sa [32] => sh [33]
> > => sn [34] => t [35] => bund )
> >
> > Now i try to work with this array in a foreach.
> >
> > foreach($elementsarr as $key=>$tmp);
> > {
> >  echo "$key=>$tmp";
> > }
> >
> > Now the result of that is:
> >
> > 35=>bund
> >
> > Ist not the first time i work with foreach. But it is the first time it
> > just
> > returns the last value.
> >
> > Do you have an idea why?
> 
> Perhaps you need to use http://php.net/reset
> 
> You see, when you do foreach or each or any of those, there is an
> "internal" setting in the array that is altered to keep track of where you
> are.  Kind of like a big "You are here" arrow inside the guts of the
> array.
> 
> If you've gone through the whole thing already, you have to reset the
> internal point back to the beginning.
> 
> "Be Kind, Rewind!"

>From the PHP docs:

Note: When foreach first starts executing, the internal array pointer is
automatically reset to the first element of the array. This means that
you do not need to call reset() before a foreach loop.

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.  |
`'

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



Re: [PHP] Creating a varable with a name held in a string

2005-02-10 Thread Randy Johnson
I like to do this:
foreach( $row as $key=>$val) {
  $$key = $row[$key];

}
John Holmes wrote:
Ben Edwards (lists) wrote:
I have the following code;_
$sql = "select * from  text where id= '$id' ";
   
$row = fetch_row_row( $sql, $db );

$img_loc= $row["img_loc"];
$text_type= $row["text_type"];
$seq= $row["seq"];
$rec_type= $row["rec_type"];
$section= $row["section"];
$code= $row["code"];
$repeat= $row["repeat"];

$description= $row["description"] );
$text = $row["text"] );

Was wondering if there was a clever way of doing this with foreach on
$row.  something like
foreach( $row as $index => value ) {
create_var( $index, $value );
}
So the question is is there a function like create_var which takes a
string and a value and creates a variable?

I think extract() is what you're after. Just note that the quickest way 
to do things isn't always the best.

Is $description going to be shown to the users? How are you protecting 
it so that it doesn't contain HTML/JavaScript code? Is any of this going 
into form elements? How are you preparing it so that a double/single 
quote doesn't end the form element?

Just pointing out that although you can quickly create the variables 
you're after with extract(), there may still be other things you should 
do before you use them.

Also, why are you wasting processing time creating $text instead of just 
using $row['text'] in whatever output you have? It's a few more 
characters to type, but it takes away one level of possible confusion 
when you come back to this code later.

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


Re: [PHP] Creating a varable with a name held in a string

2005-02-10 Thread John Holmes
Ben Edwards (lists) wrote:
I have the following code;_
$sql = "select * from  text where id= '$id' ";

$row = fetch_row_row( $sql, $db );

$img_loc= $row["img_loc"];
$text_type  = $row["text_type"];
$seq= $row["seq"];
$rec_type   = $row["rec_type"];
$section= $row["section"];
$code   = $row["code"];
$repeat = $row["repeat"];

$description= $row["description"] );
$text   = $row["text"] );
Was wondering if there was a clever way of doing this with foreach on
$row.  something like
foreach( $row as $index => value ) {
create_var( $index, $value );
}
So the question is is there a function like create_var which takes a
string and a value and creates a variable?
I think extract() is what you're after. Just note that the quickest way 
to do things isn't always the best.

Is $description going to be shown to the users? How are you protecting 
it so that it doesn't contain HTML/JavaScript code? Is any of this going 
into form elements? How are you preparing it so that a double/single 
quote doesn't end the form element?

Just pointing out that although you can quickly create the variables 
you're after with extract(), there may still be other things you should 
do before you use them.

Also, why are you wasting processing time creating $text instead of just 
using $row['text'] in whatever output you have? It's a few more 
characters to type, but it takes away one level of possible confusion 
when you come back to this code later.

Just my $0.02.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Foreach problem.

2005-02-10 Thread trlists
On 10 Feb 2005 Richard Lynch wrote:

> Perhaps you need to use http://php.net/reset
> 
> You see, when you do foreach or each or any of those, there is an
> "internal" setting in the array that is altered to keep track of where you
> are.  Kind of like a big "You are here" arrow inside the guts of the
> array.

I believe this is incorrect.  Or if not, the docs are wrong.  From 
http://www.php.net/manual/en/control-structures.foreach.php:

Note:  When foreach first starts executing, the internal array
pointer is automatically reset to the first element of the array.
This means that you do not need to call reset() before a foreach 
loop.

I don't know why the original poster had a problem, it seems mysterious 
so far, but it seems it probably wasn't for lack of a reset() call.

--
Tom

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



Re: [PHP] Foreach problem.

2005-02-10 Thread Marek Kilimajer
Richard Lynch wrote:
Mirco Blitz wrote:
HI,
I am really confused.
I have an array, that looks like this:
print_r($elementsarr) = Array ( [0] => knr [1] => subject [2] => title [3]
=> kat [4] => pages [5] => access [6] => dofile [7] => MAX_FILE_SIZE [8]
=>
pdf [9] => dolink [10] => link [11] => erstam [12] => endless [13] => from
[14] => until [15] => openbem [16] => history [17] => closedbem [18] =>
[19]
=> b [20] => br [21] => bw [22] => bay [23] => h [24] => hb [25] => hh
[26]
=> mv [27] => n [28] => nw [29] => rp [30] => s [31] => sa [32] => sh [33]
=> sn [34] => t [35] => bund )
Now i try to work with this array in a foreach.
foreach($elementsarr as $key=>$tmp);
{
echo "$key=>$tmp";
}
Now the result of that is:
35=>bund
Ist not the first time i work with foreach. But it is the first time it
just
returns the last value.
Do you have an idea why?

Perhaps you need to use http://php.net/reset
You see, when you do foreach or each or any of those, there is an
"internal" setting in the array that is altered to keep track of where you
are.  Kind of like a big "You are here" arrow inside the guts of the
array.
If you've gone through the whole thing already, you have to reset the
internal point back to the beginning.
This is not true for foreach - taken from the manual:
Note:  When foreach first starts executing, the internal array 
pointer is automatically reset to the first element of the array. This 
means that you do not need to call reset() before a foreach  loop.

Note: Also note that foreach operates on a copy of the specified 
array and not the array itself. Therefore, the array pointer is not 
modified as with the each() construct, and changes to the array element 
returned are not reflected in the original array. However, the internal 
pointer of the original array is advanced with the processing of the 
array. Assuming the foreach loop runs to completion, the array's 
internal pointer will be at the end of the array.

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


Re: [PHP] Re: [users@httpd] Favorite Linux Distribution

2005-02-10 Thread Greg Donald
On Thu, 10 Feb 2005 11:10:46 -0800 (PST), Richard Lynch <[EMAIL PROTECTED]> 
wrote:
> Believe it or not, I don't *want* to be a Linux guy, or a SysAdmin nor
> track versions of 100 software packages nor subscribe to a half-dozen
> security forums, nor ...

I enjoy sysadmin work myself.

> I just want to USE my computer to do what I wanted to do with it.
> 
> I don't fix my own car either.

Not all drivers are mechanics.  Not all computer users are sysadmins.

> So I use Fedora and let the experts handle the software updates.

If it works great for you then great, I'm happy for you.

> I've tried other systems, and, yes, it was nice to have a lean mean
> computing machine and to have complete control and all that -- It also was
> incredibly expensive on my time, which is my most limited resource, right
> ahead of the almighty dollar.

Not all of us are CEOs of big companies, some of us are just mechanics
working under the hood trying to make a living.


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

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



Re: [PHP] Re: php in free() error

2005-02-10 Thread Gerard Samuel
Jason Barnett wrote:
Gerard Samuel wrote:
...

$array = array(0 => array('world'));
class RecursiveArrayIterator extends ArrayIterator implements
RecursiveIterator
{
   function hasChildren()
   {
   return (is_array($this->current()));
   }
   function getChildren()
   {
   return new self($this->current());
   }
}
$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($array));
foreach($it as $key => $val)
{
   var_dump($key, $val);
}
?>

This may be a platform-specific bug.  I ran your test script on my box
(Win2000, php 5.0.3) and it executed with no errors. 

Ok.  Off to check for, or post a bug report...
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] quotemeta() question...

2005-02-10 Thread Steve Kaufman
Why does
  quotemeta("pat:1$WRW")
return
  pat:1
instead of
  pat:1\$WRW

What am I misunderstanding about quotemeta function? 

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



[PHP] quotemeta() question...

2005-02-10 Thread Steve Kaufman
Why does
  quotemeta("pat:1$WRW")
return
  pat:1
instead of
  pat:1\$WRW

What am I misunderstanding about quotemeta function?

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



[PHP] quotemeta() function...

2005-02-10 Thread Steve Kaufman
Why does
  quotemeta("pat:1$WRW")
return
  pat:1
instead of
  pat:1\$WRW

What am I misunderstanding about the quotemeta function?

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



[PHP] Re: Its me

2005-02-10 Thread schuld
The file is protected with the password ghj001.


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

Re: [PHP] Creating a varable with a name held in a string

2005-02-10 Thread Richard Davey
Hello Ben,

Friday, February 11, 2005, 12:36:16 AM, you wrote:

BEl> So the question is is there a function like create_var which
BEl> takes a string and a value and creates a variable?

$var_name = "new_variable";
$$var_name = "hello world";
echo $new_variable;

Search for "variable variables" in the PHP manual for more info.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

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



[PHP] Creating a varable with a name held in a string

2005-02-10 Thread Ben Edwards (lists)
I have the following code;_

$sql = "select * from  text where id= '$id' ";

$row = fetch_row_row( $sql, $db );

$img_loc= $row["img_loc"];
$text_type  = $row["text_type"];
$seq= $row["seq"];
$rec_type   = $row["rec_type"];
$section= $row["section"];
$code   = $row["code"];
$repeat = $row["repeat"];

$description= $row["description"] );
$text   = $row["text"] );


Was wondering if there was a clever way of doing this with foreach on
$row.  something like

foreach( $row as $index => value ) {
create_var( $index, $value );
}

So the question is is there a function like create_var which takes a
string and a value and creates a variable?

Ben
-- 
Ben Edwards - Poole, UK, England
If you have a problem sending me email use this link
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)

-- 
Ben Edwards - Poole, UK, England
If you have a problem sending me email use this link
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)



signature.asc
Description: This is a digitally signed message part


[PHP] Re: php in free() error

2005-02-10 Thread Jason Barnett
Gerard Samuel wrote:
...

$array = array(0 => array('world'));
class RecursiveArrayIterator extends ArrayIterator implements
RecursiveIterator
{
   function hasChildren()
   {
   return (is_array($this->current()));
   }
   function getChildren()
   {
   return new self($this->current());
   }
}
$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($array));
foreach($it as $key => $val)
{
   var_dump($key, $val);
}
?>
This may be a platform-specific bug.  I ran your test script on my box
(Win2000, php 5.0.3) and it executed with no errors.
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


Re: [PHP] Re: Multi-Page Forms

2005-02-10 Thread Jason Barnett
Gh wrote:
Question. Does the Tabs and Divs work under Mozilla Based Browsers?

Generally speaking... if it's a part of a standard / RFC then it will be
supported by Mozilla.  If not, then probably not.
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


AW: [PHP] export mysql to csv prob

2005-02-10 Thread Mirco Blitz
Hi, 
Probably the Pear Excel_Syltesheet_Writer works for you.
http://pear.php.net/package/Spreadsheet_Excel_Writer

I found out that it is faster with huge data sets on my system.

Greetings
Mirco

-Ursprüngliche Nachricht-
Von: Redmond Militante [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 11. Februar 2005 00:02
An: php-general@lists.php.net
Betreff: [PHP] export mysql to csv prob

hi

i have a script that exports the result of a mysql query to a csv file
suitable for downloading

the code looks like
$result = mysql_query("select * from user,mjp1,mjp2,mjp3,mjp4");
while($row = mysql_fetch_array($result)) { 
 $csv_output .= "$row[userid] $row[firstname] $row[lastname]\n" }
 
 header("Content-type: application/vnd.ms-excel");
 header("Content-disposition: csv" . date("Y-m-d") . ".xls");  print
$csv_output;

this works fine, except that when i expand the line $csv_output
.="$row[userid] $row[firstname] $row[lastname] $row[anotherfield]
$row[anotherfield] ...\n"} -to include an increasing number of fields, it
tends to bog down the speed at which the $csv_output file can be printed.
when i have this line output 30+ fields for each row, wait time for output
file generation is almost 4-5 minutes.

is this the most efficient way to do this?  i'd like to be able to generate
the file as quickly as possible.

thanks
redmond

--
Redmond Militante
Software Engineer / Medill School of Journalism FreeBSD 5.2.1-RELEASE-p10
#0: Wed Sep 29 17:17:49 CDT 2004 i386  4:45PM  up  4:01, 3 users, load
averages: 0.00, 0.00, 0.00

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



Re: [PHP] Re: Multi-Page Forms

2005-02-10 Thread GH
Question. Does the Tabs and Divs work under Mozilla Based Browsers?



On Wed, 09 Feb 2005 23:58:52 -0200, Manuel Lemos <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> on 02/09/2005 01:38 PM [EMAIL PROTECTED] said the following:
> > I have a form which is too long to be useful displayed on one page.  I
> > have it broken up into 7 sections.  All 7 are generated by the same PHP
> > source file, from data in a database.
> >
> > When the user updates a section they can submit it and go to the next
> > section, or submit it and finish (return to a higher-level page).
> > There is also a navigation form at the top that lets them jump from any
> > section to any other, and uses JavaScript to prompt if they try to jump
> > without having saved changes they made to the page.  All of this is
> > working fine.
> >
> > What's bothering me here is that when the user is done editing the data
> > I use their input to regenerate a style sheet (the form allows them to
> > customize the appearance of a web page for their customers).  That's
> > expensive -- relatively speaking -- in server load so I'd rather do it
> > only once, when they're really done.  But right now I do it every time
> > they submit any page -- i.e. whenever any of the seven pages is
> > submitted, the generation code runs.  I don't see any simple way to let
> > them jump around between pages, yet for me to know when they are truly
> > finished with all the data.  Of course I can give the required
> > instructions -- "after you are done you have to click submit to save
> > all the data" but I bet that those won't be read and the users will
> > jump around, fail to save, and then complain that their changes are
> > getting lost.
> >
> > Any thoughts on the design issues here?
> 
> You may want to take a look at this class than handles multipage forms
> with pages either as wizard like (sequential access) or tabbed like
> (random access):
> 
> http://www.phpclasses.org/multipageforms
> 
> There is also this generates a single page using Javascript and DIVs to
> show you only part of the form at a time and links to switch to other pages:
> 
> http://www.phpclasses.org/wizard
> 
> --
> 
> Regards,
> Manuel Lemos
> 
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
> 
> PHP Reviews - Reviews of PHP books and other products
> http://www.phpclasses.org/reviews/
> 
> Metastorage - Data object relational mapping layer generator
> http://www.meta-language.net/metastorage.html
> 
> --
> 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



[PHP] php in free() error

2005-02-10 Thread Gerard Samuel
Im playing around with iterators, and Im getting this error ->
php in free(): warning: chunk is already free
Im running php 5.0.3 on FreeBSD 5.3.
Any ideas what may be wrong?
Thanks

$array = array(0 => array('world'));
class RecursiveArrayIterator extends ArrayIterator implements 
RecursiveIterator
{
   function hasChildren()
   {
   return (is_array($this->current()));
   }

   function getChildren()
   {
   return new self($this->current());
   }
}
$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($array));
foreach($it as $key => $val)
{
   var_dump($key, $val);
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP Development IDE's/Editors

2005-02-10 Thread Lancer Emotion 16
I use Zend. 

The next time you can use the search on the php web page.


On Thu, 10 Feb 2005 09:58:01 +0200, Kaspars Bankovskis <[EMAIL PROTECTED]> 
wrote:
> notepad forever. but if you prefer syntax highlighting there is a
> freeware soft called notepad2.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
lancer emotion 16

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



[PHP] export mysql to csv prob

2005-02-10 Thread Redmond Militante
hi

i have a script that exports the result of a mysql query to a csv file suitable 
for downloading

the code looks like
$result = mysql_query("select * from user,mjp1,mjp2,mjp3,mjp4");
while($row = mysql_fetch_array($result)) { 
 $csv_output .= "$row[userid] $row[firstname] $row[lastname]\n" }
 
 header("Content-type: application/vnd.ms-excel");
 header("Content-disposition: csv" . date("Y-m-d") . ".xls");
 print $csv_output;

this works fine, except that when i expand the line
$csv_output .="$row[userid] $row[firstname] $row[lastname] $row[anotherfield] 
$row[anotherfield] ...\n"}
-to include an increasing number of fields, it tends to bog down the speed at 
which the $csv_output file can be printed.  when i have this line output 30+ 
fields for each row, wait time for output file generation is almost 4-5 minutes.

is this the most efficient way to do this?  i'd like to be able to generate the 
file as quickly as possible.

thanks
redmond

-- 
Redmond Militante
Software Engineer / Medill School of Journalism
FreeBSD 5.2.1-RELEASE-p10 #0: Wed Sep 29 17:17:49 CDT 2004 i386
 4:45PM  up  4:01, 3 users, load averages: 0.00, 0.00, 0.00


pgpnlgKpLqpCQ.pgp
Description: PGP signature


Re: [PHP] pdf properties

2005-02-10 Thread Jason Motes
snip
Maybe if you send it 5 more times, someone will answer you.
/snip
Be kind, i tried sending this yesterday  and my post would not show up 
and they were not bounced back to me.  Then i figured out what i did 
wrong and they all went through.

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


[PHP] cancel <420A7D1C.30805@imotes.com>

2005-02-10 Thread php
This message was cancelled from within Mozilla.

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



[PHP] cancel <420A7D1C.30805@imotes.com>

2005-02-10 Thread php
This message was cancelled from within Mozilla.

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



Re: [PHP] fireing function with onChange

2005-02-10 Thread Ed Curtis


On Thu, 10 Feb 2005, Richard Lynch wrote:

> Ed Curtis wrote:
> > On Thu, 10 Feb 2005, Richard Lynch wrote:
> >>
> >> In honor of our recent Super Bowl, here is a slow-motion instant replay:
> >>
> >> Bob: "Well, it's a great day so far for PHP today, isn't it Jim?"
> >> Jim: "You've got that right, Bob!  Now let's check out this play."
> >> Bob: "Watch as the user surfs right to that web page!"
> >> Jim: "Yeah, smooth!"
> >> Bob: "Then, Apache detects the .php in the URL and hands off the action
> >> to
> >> PHP!"
> >> Jim: "PHP has been really strong today, hasn't it?"
> >> Bob: "Sure has, Jim!"
> >> Jim: "Then, PHP builds up some HTML and JavaScript and sends it out!"
> >> Bob: "Yeah, and then PHP says 'Job Done.'"
> >> Jim: "You've got that right, Bob! PHP is outta the game for now,
> >> resting."
> >> Bob: "Now watch carefully as the user interacts with the browser."
> >> Jim: "Pay particular attention as they change items in the filelist
> >> box."
> >> Bob: "Oh! What a fumble!!!"
> >> Jim: "Yeah, it's definitely much too late to be handing off to PHP!"
> >> Bob: "Sure is, Jim. PHP has been out of the game now for awhile!"
> >>
> >> Copyright Richard Lynch and the NFL.
> >> Unauthorized re-broadcast is a violation of Federal Law.
> >
> >  Your comments are quite funny but wouldn't it have been alot easier to
> > say that you can't call a PHP function within a generated HTML element?
> > You can however use the onChange event to call another PHP script that
> > will perform the function. Not nearly as many keystrokes :)
>
> The other 237 times I've answered this question, the reader doesn't
> understand *WHY* they can't do that unless it's broken down into a
> slow-motion instant replay of server-side versus client-side.
>
> And if they don't understand *THAT*, they are going to have troubles down
> the road with Cookies, HTTP Authentication, scraping from SSL sites,
> sessions, and probably a couple other PHP topics.
>
> I'd rather get them thinking about this now than answer a dozen more
> questions all stemming from a fundamental lack of understanding of the
> interaction of browser, server, and PHP.  YMMV
>
> I know *I* didn't get this until somebody was kind enough to build a
> diagram of what happens in an HTTP exchange.  It's in the archives (about
> 6 years back, mind you...)
>
> So I typed Jim, Bob and "" a lot, and a couple extra lines for fun.
> [shrug]  I type fast anyway. :-)
>

 Sorry I started this. I didn't mean for it to become another "kid caught
using PHP" thread.

Ed

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



RE: [PHP] pdf properties

2005-02-10 Thread Brandon Thompson
No.

> -Original Message-
> From: Jason Motes [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, February 09, 2005 4:14 PM
> To: php-general
> Subject: [PHP] pdf properties
> 
> Hello,
> 
> Is there anyway to retrieve the properties from a pdf file using php?
> 
> When you right click on a pdf file in windows you can see the 
> title of the file and you can change this property there also.
> 
> I wrote a php page that lists all files in a certain 
> directory.  I want to be able show the actual title of the 
> document instead of just the file name.
> 
> I have searched the manual and google, everything that comes 
> up refers to generating pdfs on the fly, not working with an 
> already made pdf.
> 
> 
> Thanks in Advance,
> 
> Jason Motes
> 
> -- 
> 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



Re: [PHP] pdf properties

2005-02-10 Thread Marek Kilimajer
Jason Motes wrote:
Hello,
Is there anyway to retrieve the properties from a pdf file using php?
When you right click on a pdf file in windows you can see the title of 
the file and you can change this property there also.

I wrote a php page that lists all files in a certain directory.  I want 
to be able show the actual title of the document instead of just the 
file name.

I have searched the manual and google, everything that comes up refers 
to generating pdfs on the fly, not working with an already made pdf.
Try if `pdfinfo` is installed on your system. It's a command line 
executable.

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


Re: [PHP] pdf properties

2005-02-10 Thread John Nichel
Jason Motes wrote:
Hello,
Is there anyway to retrieve the properties from a pdf file using php?
When you right click on a pdf file in windows you can see the title of 
the file and you can change this property there also.

I wrote a php page that lists all files in a certain directory.  I want 
to be able show the actual title of the document instead of just the 
file name.

I have searched the manual and google, everything that comes up refers 
to generating pdfs on the fly, not working with an already made pdf.
Maybe if you send it 5 more times, someone will answer you.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] pdf properties

2005-02-10 Thread Jason Motes
Hello,
Is there anyway to retrieve the properties from a pdf file using php?
When you right click on a pdf file in windows you can see the title of 
the file and you can change this property there also.

I wrote a php page that lists all files in a certain directory.  I want 
to be able show the actual title of the document instead of just the 
file name.

I have searched the manual and google, everything that comes up refers 
to generating pdfs on the fly, not working with an already made pdf.

Thanks in Advance,
Jason Motes
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] pdf properties

2005-02-10 Thread Richard Lynch
> Is there anyway to retrieve the properties from a pdf file using php?
>
> When you right click on a pdf file in windows you can see the title of
> the file and you can change this property there also.
>
> I wrote a php page that lists all files in a certain directory.  I want
> to be able show the actual title of the document instead of just the
> file name.
>
> I have searched the manual and google, everything that comes up refers
> to generating pdfs on the fly, not working with an already made pdf.

Take a PDF where you know the title.

Then do this:

", implode("", file("/path/to/your.pdf")), ";?>

Now search for that title in your browser (control-F).

Figure out what PDF markers (like HTML tags, only not) are surrounding the
title.

Write PHP code to find those tags and extract the title from between them.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] cancel <20050209205250.83625.qmail@lists.php.net>

2005-02-10 Thread php
This message was cancelled from within Mozilla.

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



[PHP] pdf properties

2005-02-10 Thread Jason Motes
Hello,
Is there anyway to retrieve the properties from a pdf file using php?
When you right click on a pdf file in windows you can see the title of 
the file and you can change this property there also.

I wrote a php page that lists all files in a certain directory.  I want 
to be able show the actual title of the document instead of just the 
file name.

I have searched the manual and google, everything that comes up refers 
to generating pdfs on the fly, not working with a already made pdf.

Thanks in Adance,
Jason Motes
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] avoiding user using back button-need to re-route

2005-02-10 Thread Richard Lynch
Angelo Zanetti wrote:
> I have a site, the user goes through a few pages inputting info and also
> making various selections. On the last page they are shown a success
> page. however if they go back by clicking the back button. they can re

We kinda just went through this two days ago, which is why folks are
probably ignoring you... :-)

Check the archives linked from:
http://www.php.net/mailing-lists.php

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Secure system calls -- how

2005-02-10 Thread Richard Lynch
> Quite true. However, warnings about "don't do this or that", "an
> attacker may use this" and so on are numerous, but advice on what to do
> about it is rarer. And this thing with system calls is a good example:
> I can find many warnings about not doing it, but not a single piece of
> advice about how to do it when it's actually necessary.

I suspect that people who looked into doing this fall into two categories:

Those who heeded the experts who told them "Don't do that" and didn't do it.

Thoee who ignored the experts, went ahead and did it, and cobbled together
enough band-aid security measures to be "Okay" with it, but not something
they want to publish what they did, because then it would be too easy to
attack them.

Actually, there's probably a third category:  Those who don't even really
own their own machines any more because they got root-ed. :-v

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] fireing function with onChange

2005-02-10 Thread Richard Lynch
Ed Curtis wrote:
> On Thu, 10 Feb 2005, Richard Lynch wrote:
>>
>> In honor of our recent Super Bowl, here is a slow-motion instant replay:
>>
>> Bob: "Well, it's a great day so far for PHP today, isn't it Jim?"
>> Jim: "You've got that right, Bob!  Now let's check out this play."
>> Bob: "Watch as the user surfs right to that web page!"
>> Jim: "Yeah, smooth!"
>> Bob: "Then, Apache detects the .php in the URL and hands off the action
>> to
>> PHP!"
>> Jim: "PHP has been really strong today, hasn't it?"
>> Bob: "Sure has, Jim!"
>> Jim: "Then, PHP builds up some HTML and JavaScript and sends it out!"
>> Bob: "Yeah, and then PHP says 'Job Done.'"
>> Jim: "You've got that right, Bob! PHP is outta the game for now,
>> resting."
>> Bob: "Now watch carefully as the user interacts with the browser."
>> Jim: "Pay particular attention as they change items in the filelist
>> box."
>> Bob: "Oh! What a fumble!!!"
>> Jim: "Yeah, it's definitely much too late to be handing off to PHP!"
>> Bob: "Sure is, Jim. PHP has been out of the game now for awhile!"
>>
>> Copyright Richard Lynch and the NFL.
>> Unauthorized re-broadcast is a violation of Federal Law.
>
>  Your comments are quite funny but wouldn't it have been alot easier to
> say that you can't call a PHP function within a generated HTML element?
> You can however use the onChange event to call another PHP script that
> will perform the function. Not nearly as many keystrokes :)

The other 237 times I've answered this question, the reader doesn't
understand *WHY* they can't do that unless it's broken down into a
slow-motion instant replay of server-side versus client-side.

And if they don't understand *THAT*, they are going to have troubles down
the road with Cookies, HTTP Authentication, scraping from SSL sites,
sessions, and probably a couple other PHP topics.

I'd rather get them thinking about this now than answer a dozen more
questions all stemming from a fundamental lack of understanding of the
interaction of browser, server, and PHP.  YMMV

I know *I* didn't get this until somebody was kind enough to build a
diagram of what happens in an HTTP exchange.  It's in the archives (about
6 years back, mind you...)

So I typed Jim, Bob and "" a lot, and a couple extra lines for fun.
[shrug]  I type fast anyway. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] pdf properties

2005-02-10 Thread Jason Motes
Hello,
Is there anyway to retrieve the properties from a pdf file using php?
When you right click on a pdf file in windows you can see the title of 
the file and you can change this property there also.

I wrote a php page that lists all files in a certain directory.  I want 
to be able show the actual title of the document instead of just the 
file name.

I have searched the manual and google, everything that comes up refers 
to generating pdfs on the fly, not working with an already made pdf.

Thanks in Advance,
Jason Motes
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] avoiding user using back button-need to re-route

2005-02-10 Thread Alex Hogan
[snip]
is there a way to "route" from my second last step to my last one with a
php page between them that will intercept any back press and also will
"redirect" when the process goes from the second last step to the last
step. If the user clicks back from the last page it must then determine
that he is going back and redirect to an error page or a login page.
[/snip]

On the processing page you could put something like;
if($_SERVER['HTTP_REFERER'] != 'myFormPage.php'){
header("Location: YouGotHereWrong.php");
}


alex hogan

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



Re: [PHP] Foreach problem.

2005-02-10 Thread Richard Lynch
Mirco Blitz wrote:
> HI,
> I am really confused.
> I have an array, that looks like this:
>
> print_r($elementsarr) = Array ( [0] => knr [1] => subject [2] => title [3]
> => kat [4] => pages [5] => access [6] => dofile [7] => MAX_FILE_SIZE [8]
> =>
> pdf [9] => dolink [10] => link [11] => erstam [12] => endless [13] => from
> [14] => until [15] => openbem [16] => history [17] => closedbem [18] =>
> [19]
> => b [20] => br [21] => bw [22] => bay [23] => h [24] => hb [25] => hh
> [26]
> => mv [27] => n [28] => nw [29] => rp [30] => s [31] => sa [32] => sh [33]
> => sn [34] => t [35] => bund )
>
> Now i try to work with this array in a foreach.
>
> foreach($elementsarr as $key=>$tmp);
> {
>  echo "$key=>$tmp";
> }
>
> Now the result of that is:
>
> 35=>bund
>
> Ist not the first time i work with foreach. But it is the first time it
> just
> returns the last value.
>
> Do you have an idea why?

Perhaps you need to use http://php.net/reset

You see, when you do foreach or each or any of those, there is an
"internal" setting in the array that is altered to keep track of where you
are.  Kind of like a big "You are here" arrow inside the guts of the
array.

If you've gone through the whole thing already, you have to reset the
internal point back to the beginning.

"Be Kind, Rewind!"

TIP:
Put a 'reset' before anything that loops the array.  That way, if you add
something before it that loops through, it can't cause the side-effect of
a bug in your other code.  Just a good habit to form.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] avoiding user using back button-need to re-route

2005-02-10 Thread Angelo Zanetti
Hi all.

I have a site, the user goes through a few pages inputting info and also
making various selections. On the last page they are shown a success
page. however if they go back by clicking the back button. they can re
process the last step which is undersireable. I can't really use
javascript  to detect the back button because Im using smarty and php
and it cant detect the back button press. 

is there a way to "route" from my second last step to my last one with a
php page between them that will intercept any back press and also will
"redirect" when the process goes from the second last step to the last
step. If the user clicks back from the last page it must then determine
that he is going back and redirect to an error page or a login page.

any suggestions? Ive been stuck on this for a while and think that maybe
I could use a sesssion variable and once I get to the last page it
expires and if the user clicks back then that "routing page" will see
that the session isnt registered anymore and redirect to an error page.

thanks for any suggestions or help. in advance.

Angelo

Angelo Zanetti
Z Logic
[c] +27 72 441 3355
[t] +27 21 464 1363
[f] +27 21 464 1371
www.zlogic.co.za

Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Peninsula University of 
Technology or the sender of this e-mail be liable to any party for
any direct, indirect, special or other consequential damages for any
use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



[PHP] pdf properties

2005-02-10 Thread Jason Motes
Hello,
Is there anyway to retrieve the properties from a pdf file using php?
When you right click on a pdf file in windows you can see the title of 
the file and you can change this property there also.

I wrote a php page that lists all files in a certain directory.  I want 
to be able show the actual title of the document instead of just the 
file name.

I have searched the manual and google, everything that comes up refers 
to generating pdfs on the fly, not working with an already made pdf.

Thanks in Advance,
Jason Motes
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: stream_set_timeout() stream_get_meta_data() etc...

2005-02-10 Thread Skippy
On Wed, 09 Feb 2005 13:28:47 -0500 Al <[EMAIL PROTECTED]> wrote:
> Here is the code I ended up with, I left some test stuff included so
> anyone who may need it has a good start.

Oh, and another thing: if anybody's going to implement this using sockets
instead of fopen(), make sure to send the header "Connection: close" in the
request to the remote server. These days most servers implement HTTP 1.1,
which activates persistent connections by default ie. you'll never get EOF
and you'll always time out. I'm not sure how fopen() overcomes this, it
either has other means of detecting that the request was answered or it
uses "Connection: close" too.

-- 
Skippy - Romanian Web Developers - http://ROWD.ORG

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



Re: [PHP] $GLOBALS, any probolems?

2005-02-10 Thread Richard Lynch
Bruno B B Magalhães wrote:
> is there any problems using $GLOBALS superglobal to carry all my global
> classes instances?
>
> For example:
> $GLOBALS['myclass'] = new myclass();

This is exactly the same as:
$myclass = new myclass();
as far as I've ever been able to tell, except that $GLOBALS is a
super-global, so it will "work" inside a function as well as outside.

For a brief period, it seemed like people were hot on using that instead
of 'global' in a function, so they didn't have to understand scoping.  Or
maybe it was the guys tired of trying to explain scoping to newbies who
were hot on it. :-^

Seems to me, you'd be better off understanding scoping rules and using
'global' so if you ever want to use another language, you'll have the good
programming habits, knowledge and skills you'll need.

But that's just my personal opinion.  Somebody gonna post and disagree
with me, almost for sure. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Re: [users@httpd] Favorite Linux Distribution

2005-02-10 Thread Richard Lynch
Greg Donald wrote:
> On Thu, 10 Feb 2005 01:01:18 +0200, Dotan Cohen <[EMAIL PROTECTED]>
> wrote:
>> I very much disagree. I am writing this on my Fedora Core 3 box and am
>> very happy with it's 'bloat'. As a new convert form windows I am kinda
>> used to everything being there at my fingertips. And in Fedora,
>> everything is, except mp3 support which I added easily with synaptic
>> (the apt gui). I know that I will outgrow this distro, and follow this
>> thread because I am looking for in which direction to grow. But I am
>> very glad that I found Fedora because SUSE, slack, and a few others
>> were way too over my head to get started. I almost gave up.
>
> You realize Fedora is RedHat's test distro, right?  It's where they
> test new stuff for their commercial offerings.  In other words Fedora
> is forever in 'testing'.  There will never be a final 'stable'
> release.  You'll have to buy a copy of RedHat for that.  As "a new
> convert form windows" I thought you might want to know.

Fedora is about 1000 X as stable as Windows.

Believe it or not, I don't *want* to be a Linux guy, or a SysAdmin nor
track versions of 100 software packages nor subscribe to a half-dozen
security forums, nor ...

I just want to USE my computer to do what I wanted to do with it.

I don't fix my own car either.

So I use Fedora and let the experts handle the software updates.

I've tried other systems, and, yes, it was nice to have a lean mean
computing machine and to have complete control and all that -- It also was
incredibly expensive on my time, which is my most limited resource, right
ahead of the almighty dollar.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] fireing function with onChange

2005-02-10 Thread Jason Barnett
Richard Lynch wrote:
...
In honor of our recent Super Bowl, here is a slow-motion instant replay:
Bob: "Well, it's a great day so far for PHP today, isn't it Jim?"
Jim: "You've got that right, Bob!  Now let's check out this play."
Bob: "Watch as the user surfs right to that web page!"
Jim: "Yeah, smooth!"
Bob: "Then, Apache detects the .php in the URL and hands off the action to
PHP!"
Jim: "PHP has been really strong today, hasn't it?"
Bob: "Sure has, Jim!"
Jim: "Then, PHP builds up some HTML and JavaScript and sends it out!"
Bob: "Yeah, and then PHP says 'Job Done.'"
Jim: "You've got that right, Bob! PHP is outta the game for now, resting."
Bob: "Now watch carefully as the user interacts with the browser."
Jim: "Pay particular attention as they change items in the filelist box."
Bob: "Oh! What a fumble!!!"
Jim: "Yeah, it's definitely much too late to be handing off to PHP!"
Bob: "Sure is, Jim. PHP has been out of the game now for awhile!"
Copyright Richard Lynch and the NFL.
Unauthorized re-broadcast is a violation of Federal Law.
:-)
LMAO!
Bob: "Now let's go to Kate on the sidelines to get PHP's reaction.  Kate?"
Kate: "Thanks Bob.  I'm here with Quarterback PHP to find out exactly
what happened.   PHP, what was Coach OP thinking when he tried to get
you to run that Javascript?"
PHP: "Well Kate I wouldn't exactly call it a trick play, unless you mean
OP didn't get what he wanted.  Here I had just finished passing this
great HTML and Javascript to Browser and thought everything was great.
But then all of a sudden Browser makes this Filelist Box move.  Too bad
I was already on the sidelines or I would have helped."
Kate: "PHP what exactly was going through your mind when you saw what
fumble?"
PHP: "That's just it Kate, I didn't even see it.  It's like Browser was
trying to pass some Javascript back to me, but I was already sitting on
the sidelines drinking some Gatorade with Randy Moss.  Man, what a
fumble that must have been."
Kate: "And there you have it folks... PHP didn't even see what happened.
 I guess this is why PHP and Randy Moss aren't going to the Super Bowl
any time soon.  Back to you Bob."
Copyright Jason Barnett and the NFL.
Unauthorized re-broadcast is a violation of Federal Law.
:-)
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


Re: [PHP] Magic Quotes Removal code - almost there

2005-02-10 Thread Jason Wong
On Thursday 10 February 2005 23:36, Ben Edwards (lists) wrote:

> The cleaning works but magic_quotes_runtime is false even if magic
> codes are on, any ideas?

There are at least two magic_quotes_* settings, make sure you are 
referring to the correct one(s).

-- 
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
--
New Year Resolution: Ignore top posted posts

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



Re: [PHP] fireing function with onChange

2005-02-10 Thread Ed Curtis


On Thu, 10 Feb 2005, Richard Lynch wrote:
>
> In honor of our recent Super Bowl, here is a slow-motion instant replay:
>
> Bob: "Well, it's a great day so far for PHP today, isn't it Jim?"
> Jim: "You've got that right, Bob!  Now let's check out this play."
> Bob: "Watch as the user surfs right to that web page!"
> Jim: "Yeah, smooth!"
> Bob: "Then, Apache detects the .php in the URL and hands off the action to
> PHP!"
> Jim: "PHP has been really strong today, hasn't it?"
> Bob: "Sure has, Jim!"
> Jim: "Then, PHP builds up some HTML and JavaScript and sends it out!"
> Bob: "Yeah, and then PHP says 'Job Done.'"
> Jim: "You've got that right, Bob! PHP is outta the game for now, resting."
> Bob: "Now watch carefully as the user interacts with the browser."
> Jim: "Pay particular attention as they change items in the filelist box."
> Bob: "Oh! What a fumble!!!"
> Jim: "Yeah, it's definitely much too late to be handing off to PHP!"
> Bob: "Sure is, Jim. PHP has been out of the game now for awhile!"
>
> Copyright Richard Lynch and the NFL.
> Unauthorized re-broadcast is a violation of Federal Law.

 Your comments are quite funny but wouldn't it have been alot easier to
say that you can't call a PHP function within a generated HTML element?
You can however use the onChange event to call another PHP script that
will perform the function. Not nearly as many keystrokes :)

Ed

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



Re: [PHP] Secure system calls -- how

2005-02-10 Thread Jason Wong
On Thursday 10 February 2005 11:58, Niels wrote:
> Richard Lynch wrote:
> > Perhaps the reason there is no article or tutorial is that it would
> > be a book, not an article or tutorial :-)
> >
> > There are so MANY affected/related software system pieces that you
> > can't do it justice in an article or tutorial, I suspect.
>
> Quite true. However, warnings about "don't do this or that", "an
> attacker may use this" and so on are numerous, but advice on what to do
> about it is rarer. And this thing with system calls is a good example:
> I can find many warnings about not doing it, but not a single piece of
> advice about how to do it when it's actually necessary.

To put it simply you would have to check *extremely* carefully the user 
input to ensure that it is not malicious, and that it is what it should 
be. I believe your original problem was about writing procmail files. So 
in that particular instance, in the extreme case you may have to write a 
complete procmail parser in php to ensure that what the user is entering 
is at least (i) a genuine procmail compliant file, and possibly (ii) 
isn't going to harm your system in anyway. You're not going to find many 
books or articles that will tell you how to write a complete procmail 
parser, that's why they're hard to find, and ditto for whatever else you 
want your sudo to be doing.

-- 
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
--
New Year Resolution: Ignore top posted posts

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



Re: [PHP] Magic Quotes

2005-02-10 Thread Richard Lynch
Ben Edwards (lists) wrote:
> Am I correct in thinking Magic Quotes automatically adds quotes to all
> posted variables, therefore if you are displaying post variables on a
> form you have to remove the quotes.  They are only needed if you are
> actually inserting/updating into the database.   Whether magic quotes
> are on or not you do not actually have to do anything to data fetched
> from the database. If magic quoted are not on you have to add slashes
> before you add to the database.

To be pedantic, I'll add to this thread and point out that Magic Quotes
also affects GET data.

Oooh, and COOKIES too, almost for sure, though I never put anything in a
Cookie that needs quotes, so I'm not 100% sure on that.

Magic Quotes was part of the original PHP, I think, or at least real early
on, back when the Internet had a lot less vandals.

I daresay validation in those days was more about being nice to the user
and having Good Data than self-defense.

[Sigh.]

When I was your age... :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] Magic Quotes Removal code - almost there

2005-02-10 Thread Ben Edwards (lists)
The following code is passed $_POST to clean magic quotes code out ;_

function remove_magic_quotes( &$array ) {
foreach( $array as $index => $value ) {
if ( is_array( $array[$index] ) ) {
remove_magic_quotes( $array[$index] );
} else {
if ( magic_quotes_runtime() ){
echo "removing slashes $value";
$array[$index] = stripslashes( $value );
}
}
}
}

The cleaning works but magic_quotes_runtime is false even if magic codes
are on, any ideas?

Ben
-- 
Ben Edwards - Poole, UK, England
If you have a problem sending me email use this link
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)



signature.asc
Description: This is a digitally signed message part


Re: [PHP] fireing function with onChange

2005-02-10 Thread John Nichel
Aaron Todd wrote:
I have a loop that is putting the filenames of files in a certain directory 
into a listbox.  I am then using the onChange event of the listbox to fire a 
function.  In this script the onchange event sends the function the path an 
filename of the chosen file from the list.  I have tested what I am sending 
with a javascript alert and it looks ok.  The funstion is supposed to open 
the file and then make a new file(im working with jpegs using GD).

Unfortunately it isnt working the way I would want it to.  Can soneone check 
this code and see if there is anything wrong.  In the browser it doesnt do 
anything.  I had hoped for at least an error code.

Hope someone can help...Thanks

So you're trying to call a custom php function with JavaScript?
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] fireing function with onChange

2005-02-10 Thread Richard Lynch
Aaron Todd wrote:
> I have a loop that is putting the filenames of files in a certain
> directory
> into a listbox.  I am then using the onChange event of the listbox to fire
> a
> function.  In this script the onchange event sends the function the path
> an
> filename of the chosen file from the list.  I have tested what I am
> sending
> with a javascript alert and it looks ok.  The funstion is supposed to open
> the file and then make a new file(im working with jpegs using GD).
>
> Unfortunately it isnt working the way I would want it to.  Can soneone
> check
> this code and see if there is anything wrong.  In the browser it doesnt do
> anything.  I had hoped for at least an error code.
>
> Hope someone can help...Thanks
>
>function createimage($picpath){
> $im = imagecreatefromjpeg($picpath);
> imagejpeg($im,"images/temp.jpg");
>   }
>   $path = "images";
>   $dir_handle = @opendir($path) or die("Unable to open $path");
>   echo " onchange=createimage('$path/'+this.options[this.selectedIndex].value)>\n";
>   while ($file = readdir($dir_handle))
> {
>   if($file!="." && $file!=".."){
> echo "$file\n";
>   }
> }
>   echo "\n";
>   echo "";
> ?>

In honor of our recent Super Bowl, here is a slow-motion instant replay:

Bob: "Well, it's a great day so far for PHP today, isn't it Jim?"
Jim: "You've got that right, Bob!  Now let's check out this play."
Bob: "Watch as the user surfs right to that web page!"
Jim: "Yeah, smooth!"
Bob: "Then, Apache detects the .php in the URL and hands off the action to
PHP!"
Jim: "PHP has been really strong today, hasn't it?"
Bob: "Sure has, Jim!"
Jim: "Then, PHP builds up some HTML and JavaScript and sends it out!"
Bob: "Yeah, and then PHP says 'Job Done.'"
Jim: "You've got that right, Bob! PHP is outta the game for now, resting."
Bob: "Now watch carefully as the user interacts with the browser."
Jim: "Pay particular attention as they change items in the filelist box."
Bob: "Oh! What a fumble!!!"
Jim: "Yeah, it's definitely much too late to be handing off to PHP!"
Bob: "Sure is, Jim. PHP has been out of the game now for awhile!"

Copyright Richard Lynch and the NFL.
Unauthorized re-broadcast is a violation of Federal Law.

:-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Parsing pdf file

2005-02-10 Thread John Nichel
Abiodun Akala wrote:
Hi,
Please UNSUBSCRIBE me from the php mailing list.
I have no interest whatsoever in the bulkmail.
Please read.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] RE: Student Suspended

2005-02-10 Thread Jack Scott
Its sad too see so many programmers with so much time on their hands.
Stop wasting this valuable resource on something which came from a 
parody site in the first place!
post your idiotic commentary somewhere else

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


[PHP] fireing function with onChange

2005-02-10 Thread Aaron Todd
I have a loop that is putting the filenames of files in a certain directory 
into a listbox.  I am then using the onChange event of the listbox to fire a 
function.  In this script the onchange event sends the function the path an 
filename of the chosen file from the list.  I have tested what I am sending 
with a javascript alert and it looks ok.  The funstion is supposed to open 
the file and then make a new file(im working with jpegs using GD).

Unfortunately it isnt working the way I would want it to.  Can soneone check 
this code and see if there is anything wrong.  In the browser it doesnt do 
anything.  I had hoped for at least an error code.

Hope someone can help...Thanks

\n";
  while ($file = readdir($dir_handle))
{
  if($file!="." && $file!=".."){
echo "$file\n";
  }
}
  echo "\n";
  echo "";
?> 

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



Re: [PHP] Magic Quotes

2005-02-10 Thread Jochem Maas
Ben Edwards (lists) wrote:
On Thu, 2005-02-10 at 13:45 +0100, Jochem Maas wrote:
Ben Edwards (lists) wrote:
PS phpsc.net seems to be down, or is the domain wrong?

er yes, oops. as Jeffery pointed out it should have been
phpsec.org. had a brainfreeze sorry.

OK, trying to do a function to remove magic quotes from the post
variable.  Something like:-
function remove_magic_quotes( &$array ) {
foreach( $array as $index => $value ) {
if ( is_array( $array[$index] ) ) {
remove_magic_quotes( $array[$index] );
} else {
if ( magic_quotes_runtime() ){
$array[$index] = stripslashes( $value );
there is a missing closing brace here. also the test for 
magic_quotes_runtime()
is better of outside the loop... no point in recursing if 
magic_quotes_runtime() returns false.
also you might want to use a return val instead of pass-by-reference.
also adding this to a .htaccess file in the root dir of your app might be 
easier:
php_value magic_quotes_runtime 0

}
}
}
But not quite there.  Any ideas?
Ben

Ben
On Thu, 2005-02-10 at 13:28 +0100, Jochem Maas wrote:

Ben Edwards (lists) wrote:

Am I correct in thinking Magic Quotes automatically adds quotes to all
posted variables, therefore if you are displaying post variables on a
form you have to remove the quotes.  They are only needed if you are
actually inserting/updating into the database.   Whether magic quotes
are on or not you do not actually have to do anything to data fetched

from the database. If magic quoted are not on you have to add slashes

before you add to the database.
you get the gist of it bare in mind _many_ people including actual php
developers avoid magic_quotes like the plague cos its a PITA.
basically your input to the DB should be properly escaped (there are special
functions for this also, depending on your DB, I use alot of firebird and its 
capable
of parameterized queries - making it impossible to do SQL injection if you use
the parameterized markup).
AND anything you output to the browser should be sanitized properly as well...
goto phpsc.net and read everything there - its a good/solid introduction to
writing secure php code (e.g. how to combat XSS etc). phpsc.net is headed by 
Chris
Shiflett - a veritable goldmine of php related knowledge do yourself a 
favor...
read his stuff :-) any questions that arise from reading that are welcome here 
:-)

There is also another function you need pass stuff through if you are
going to use it in an , what is that
function?
htmlentities()

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


RE: [PHP] Parsing pdf file

2005-02-10 Thread Abiodun Akala
Hi,
Please UNSUBSCRIBE me from the php mailing list.
I have no interest whatsoever in the bulkmail.
 
Thanks,
Biodun

Mikey <[EMAIL PROTECTED]> wrote:

> Hi,
> Sorry i don't really find something useful there.

That is cos pdflib is for making pdfs and not parsing them. AFAIK you are
on your own with parsing a pdf, or you may have to result to third party
libraries.

HTH,

Mikey

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



-
Do you Yahoo!?
 Yahoo! Search presents - Jib Jab's 'Second Term'

Re: [PHP] Student Suspended Over PHP use.[Incredibly OT]

2005-02-10 Thread John Nichel
Jay Blanchard wrote:

Are you familiar with the concept 'joke'? 

As for the rest of the things you say in this post.I hope that you
have a flame retardent suit because many will take issue with your
judgemental stand. You have demonstrated a fundamental lack of
understanding where America is concerned. My recommendation to you would
be STFU unless you need PHP help on this list.
It was *extremely* hard for me to bite my tongue about the rest of his 
comments. ;)

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: AW: [PHP] Student Suspended Over PHP use.[Incredibly OT]

2005-02-10 Thread Miles Thompson


Let's end this -- NOW please.
Way off topic to start with, and it's gone from a posting of an old joke, 
through political criticism, to petty bickering.

Please end this thread, now.
Please don't reply to this, whether you agree or disagree - let's just end it.
Cheers - Miles
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: AW: [PHP] Student Suspended Over PHP use.

2005-02-10 Thread John Nichel
Mirco Blitz wrote:
To all the cool Americans, ignore my following words.
To all the others. You are just dumb asses. 
There are many occasions where you show it really open.
You elect a dumb President, that lies to you in one way.
You let your Kids get kriminalized.
Your belive in God is as paranoid as the muslimes are and you blame em for
that.
And many more.

That is a real cool story that really shows whats up in your country. And
you call yourself democratic ?
Isn't it time for a change?
Of course it's time for a change.  It's time to change your sense of 
humor.  The article was, and is, a JOKE!!!  It's not real.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: AW: AW: [PHP] Student Suspended Over PHP use.[Incredibly OT]

2005-02-10 Thread John Nichel
Mirco Blitz wrote:
Oh please hack down on me. 

I also hear a lot of crap aout us germans every day an I dont get pissed of
that as well.
You really take yourself to serious.
I don't take you at all.  Let's hope there's not some problem that 
you're trying to solve that I have experience in.  Welcome to /dev/null.

Auf Wiedersehen Herr.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: AW: [PHP] Student Suspended Over PHP use.[Incredibly OT]

2005-02-10 Thread Mike Johnson
From: Mirco Blitz [mailto:[EMAIL PROTECTED] 

> Oh please hack down on me. 
> 
> I also hear a lot of crap aout us germans every day an I dont 
> get pissed of that as well.
> 
> You really take yourself to serious.

Seriously, what do you hear about Germans on this list? I read this list
daily and, while I may skip some messages, I've never seen anything
about any group like what you posted earlier.

Do tell, I'm curious.


-- 
Mike Johnson Smarter Living, Inc.
Web Developerwww.smartertravel.com
[EMAIL PROTECTED]   (617) 886-5539

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



Re: AW: AW: [PHP] Student Suspended Over PHP use.[Incredibly OT]

2005-02-10 Thread Richard Davey
Hello Mirco,

Thursday, February 10, 2005, 2:38:15 PM, you wrote:

MB> I also hear a lot of crap aout us germans every day an I dont get
MB> pissed of that as well.

MB> You really take yourself to serious.

Considering this is a technical mailing list dedicated to PHP and not
one about world politics frivolity for trolls, yes I guess I do.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

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



[PHP] ENOUGH!! RE: AW: [PHP] Student Suspended Over PHP use.

2005-02-10 Thread tg-php
This thread, as relates to PHP, is pointless.  If people have issues with what 
someone else said, please take it up with them privately and/or notify the list 
admins if you think it was inappropriate enough to warrant administrative 
action.

The joke was cute but all in all, not that funny.  It didn't really require 
this much extra attention and the flaming definitely wasn't appropriate for the 
list.  There's no reason that "STFU" should ever be used on this mailing list.

Let's return to some civil discourse...  now..  can anyone tell me what a good 
PHP IDE would be?   hah..  sorry, had to break the seriousness a little.  
Everyone knows  rulez!!!

Before you post to the list, ask yourself two questions:  What do I hope to 
accomplish with this post and is this the appropriate way to go about it?

-TG

___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



RE: AW: [PHP] Student Suspended Over PHP use.[Incredibly OT]

2005-02-10 Thread Jay Blanchard
[snip]
Oh please hack down on me. 

I also hear a lot of crap aout us germans every day an I dont get pissed
of
that as well.

You really take yourself to serious.
[/snip]

I told you soreally you should just STFU now or you might find your
PHP questions will go unanswered. If you had said somewhereanywhere
in your post that you were joking people might not be so harsh. After
all, if you want to look at stuff ..Germany has a lot of stuff to look
at with a critical eye.

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



AW: AW: [PHP] Student Suspended Over PHP use.[Incredibly OT]

2005-02-10 Thread Mirco Blitz
Oh please hack down on me. 

I also hear a lot of crap aout us germans every day an I dont get pissed of
that as well.

You really take yourself to serious.


-Ursprüngliche Nachricht-
Von: Richard Davey [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 10. Februar 2005 15:23
An: php-general@lists.php.net
Betreff: Re: AW: [PHP] Student Suspended Over PHP use.[Incredibly OT]

Hello Mirco,

Thursday, February 10, 2005, 2:09:21 PM, you wrote:

MB> BTW. What is STFU?

Something you probably should have done before insulting the majority of
list members.

Best regards,

Richard Davey
--
 http://www.launchcode.co.uk - PHP Development Services  "I am not young
enough to know everything." - Oscar Wilde

--
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



Re: AW: [PHP] Student Suspended Over PHP use.[Incredibly OT]

2005-02-10 Thread Richard Davey
Hello Mirco,

Thursday, February 10, 2005, 2:09:21 PM, you wrote:

MB> BTW. What is STFU?

Something you probably should have done before insulting the majority
of list members.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

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



RE: [PHP] Student Suspended Over PHP use.[Incredibly OT]

2005-02-10 Thread Alex Hogan

[snip]
BTW. What is STFU?
[/snip]

Ooo.., let me do this one...
This is one I can answer. ;-)

STFU (Shut the F*%# up!)





alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential 
and 
intended solely for the use of the individual or entity to whom it is 
addressed. The 
views stated herein do not necessarily represent the view of the company. If 
you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, 
or 
otherwise use it or any part of it in any form whatsoever. If you have received 
this 
e-mail in error please e-mail the sender. 
*

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



AW: [PHP] Student Suspended Over PHP use.[Incredibly OT]

2005-02-10 Thread Mirco Blitz
You are really taking me to serious. 
Ok might be that my english is not good enough to let that sound ironic.

BTW. What is STFU?

Greetings
Mirco

-Ursprüngliche Nachricht-
Von: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 10. Februar 2005 15:06
An: Mirco Blitz; php-general@lists.php.net
Betreff: RE: [PHP] Student Suspended Over PHP use.[Incredibly OT]

[snip]
To all the cool Americans, ignore my following words.

To all the others. You are just dumb asses. 
There are many occasions where you show it really open.
You elect a dumb President, that lies to you in one way.
You let your Kids get kriminalized.
Your belive in God is as paranoid as the muslimes are and you blame em for
that.
And many more.

That is a real cool story that really shows whats up in your country.
And
you call yourself democratic ?
Isn't it time for a change?
[/snip]

Are you familiar with the concept 'joke'? 

As for the rest of the things you say in this post.I hope that you have
a flame retardent suit because many will take issue with your judgemental
stand. You have demonstrated a fundamental lack of understanding where
America is concerned. My recommendation to you would be STFU unless you need
PHP help on this list.

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



RE: [PHP] Student Suspended Over PHP use.[Incredibly OT]

2005-02-10 Thread Jay Blanchard
[snip]
To all the cool Americans, ignore my following words.

To all the others. You are just dumb asses. 
There are many occasions where you show it really open.
You elect a dumb President, that lies to you in one way.
You let your Kids get kriminalized.
Your belive in God is as paranoid as the muslimes are and you blame em
for
that.
And many more.

That is a real cool story that really shows whats up in your country.
And
you call yourself democratic ?
Isn't it time for a change?
[/snip]

Are you familiar with the concept 'joke'? 

As for the rest of the things you say in this post.I hope that you
have a flame retardent suit because many will take issue with your
judgemental stand. You have demonstrated a fundamental lack of
understanding where America is concerned. My recommendation to you would
be STFU unless you need PHP help on this list.

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



AW: [PHP] Student Suspended Over PHP use.

2005-02-10 Thread Mirco Blitz
To all the cool Americans, ignore my following words.

To all the others. You are just dumb asses. 
There are many occasions where you show it really open.
You elect a dumb President, that lies to you in one way.
You let your Kids get kriminalized.
Your belive in God is as paranoid as the muslimes are and you blame em for
that.
And many more.

That is a real cool story that really shows whats up in your country. And
you call yourself democratic ?
Isn't it time for a change?

Greetings
Mirco Blitz

PS: I am a real addict to PHP. Ist really one of the best "drugs" I use
daily. Just like Linux.

-Ursprüngliche Nachricht-
Von: Bosky, Dave [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 9. Februar 2005 14:53
An: php-general@lists.php.net
Betreff: [PHP] Student Suspended Over PHP use.

I just ran across this interesting article from awhile back. Pretty funny

http://bbspot.com/News/2000/6/php_suspend.html
 

Topeka, KS - High school sophomore Brett Tyson was suspended today after
teachers learned he may be using PHP.

"A teacher overheard him say that he was using PHP, and as part of our
Zero-Tolerance policy against drug use, he was immediately suspended. No
questions asked," said Principal Clyde Thurlow.   "We're not quite sure what
PHP is, but we suspect it may be a derivative of PCP, or maybe a new
designer drug like GHB."  

php_logoParents are frightened by the discovery of this new menace in their
children's school, and are demanding the school do something.  "We heard
that he found out about PHP at school on the internet.  There may even be a
PHP web ring operating on school grounds," said irate parent Carol Blessing.
"School is supposed to be teaching our kids how to read and write.  Not
about dangerous drugs like PHP."

In response to parental demands the school has reconfigured its internet
WatchDog software to block access to all internet sites mentioning PHP.
Officials say this should prevent any other students from falling prey like
Brett Tyson did.  They have also stepped up locker searches and brought in
drug sniffing dogs.

Interviews with students suggested that PHP use is wide spread around the
school, but is particularly concentrated in the geeky nerd population.  When
contacted by BBspot.com, Brett Tyson said, "I don't know what the hell is
going on dude, but this suspension gives me more time for fraggin'.  Yee
haw!"

PHP is a hypertext preprocessor, which sounds very dangerous.  It is
believed that many users started by using Perl and moved on to the more
powerful PHP.  For more information on how to recognize if your child may be
using PHP please visit http://www.php.net  . 

 

 

 



HTC Disclaimer:  The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of this
message is not the intended recipient, or an employee or agent responsible
for delivering this message to the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error, please notify us immediately by replying to the
message and deleting it from your computer.  Thank you.

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



AW: [PHP] Refresh Problem

2005-02-10 Thread Mirco Blitz
 After first authentification of the user i prefere session. I can be sure
that this is the user who autht himself to me, caus the session is unique.

-Ursprüngliche Nachricht-
Von: Jose Angel Sanchez (Jone) [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 9. Februar 2005 14:49
An: php-general@lists.php.net
Betreff: [PHP] Refresh Problem

Hi 

First of all: I'm sorry for writing errors - I don't speak English too much
(spanish)

I'm building an application which works that way:

I use url parameters to set zone (document location), actions and params.

I've badly make security part so only registered people ($_session['USER']
<- which is set after check Login/pass form) can access different zones but
my problem is on refreshing page that contains action

i.e.
http://www.mypage.com?index.php&zone=contact&action=newcontact&name=geor
ge

only registered/valid users can make this zone code runs

my pseudocode basicly works this way:

function contactzone (no params)

get URL parameters (like $action=$_get['action']



switch ($action)

case 'new'
$html.= show form (on submit set action to
'newcontact'
break;
case 'newcontact'
Insert on database
On success -> $html
Default
Show simple $html
}


return $html


My problem is on refresh or back events on navigator; the action will
execute again.

How do I prevent that? Session variables? Check a single table storing used
hashes sent by form (generated with md5 or any) on all forms containing
actions event for all tables? What do you think?

Sorry again and thx for reading and helping :D

j0n3 


--
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



Re: [PHP] Student Suspended Over PHP use.

2005-02-10 Thread Steve Buehler
Shouldn't have taken your Cat to school with a bag of catnip.  That was 
asking for trouble. :)

Steve
At 08:44 PM 2/9/2005, Dotan Cohen wrote:
Maybe it's not People Hate Perl after all...
Pot, Heroin, Pussy?!?
I think I got suspended for at leat two of those on campus grounds at
some point or another.
Dotan
On Thu, 10 Feb 2005 01:31:43 +1100 (EST), [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> PHP is bad Mkay.
>
> > I just ran across this interesting article from awhile back. Pretty
> > funny
> >
> > http://bbspot.com/News/2000/6/php_suspend.html
> > 
> >
> > Topeka, KS - High school sophomore Brett Tyson was suspended today
> > after teachers learned he may be using PHP.
> >
> > "A teacher overheard him say that he was using PHP, and as part of our
> > Zero-Tolerance policy against drug use, he was immediately suspended.
> > No questions asked," said Principal Clyde Thurlow.   "We're not quite
> > sure what PHP is, but we suspect it may be a derivative of PCP, or
> > maybe a new designer drug like GHB."
> >
> > php_logoParents are frightened by the discovery of this new menace in
> > their children's school, and are demanding the school do something.
> > "We heard that he found out about PHP at school on the internet.  There
> > may even be a PHP web ring operating on school grounds," said irate
> > parent Carol Blessing. "School is supposed to be teaching our kids how
> > to read and write.  Not about dangerous drugs like PHP."
> >
> > In response to parental demands the school has reconfigured its
> > internet WatchDog software to block access to all internet sites
> > mentioning PHP. Officials say this should prevent any other students
> > from falling prey like Brett Tyson did.  They have also stepped up
> > locker searches and brought in drug sniffing dogs.
> >
> > Interviews with students suggested that PHP use is wide spread around
> > the school, but is particularly concentrated in the geeky nerd
> > population.  When contacted by BBspot.com, Brett Tyson said, "I don't
> > know what the hell is going on dude, but this suspension gives me more
> > time for fraggin'.  Yee haw!"
> >
> > PHP is a hypertext preprocessor, which sounds very dangerous.  It is
> > believed that many users started by using Perl and moved on to the more
> > powerful PHP.  For more information on how to recognize if your child
> > may be using PHP please visit http://www.php.net  .
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > HTC Disclaimer:  The information contained in this message may be
> > privileged and confidential and protected from disclosure. If the
> > reader of this message is not the intended recipient, or an employee or
> > agent responsible for delivering this message to the intended
> > recipient, you are hereby notified that any dissemination, distribution
> > or copying of this communication is strictly prohibited.  If you have
> > received this communication in error, please notify us immediately by
> > replying to the message and deleting it from your computer.  Thank you.
>
> --
> 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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Magic Quotes

2005-02-10 Thread Ben Edwards (lists)
On Thu, 2005-02-10 at 13:45 +0100, Jochem Maas wrote:
> Ben Edwards (lists) wrote:
> > PS phpsc.net seems to be down, or is the domain wrong?

> 
> er yes, oops. as Jeffery pointed out it should have been
> phpsec.org. had a brainfreeze sorry.


OK, trying to do a function to remove magic quotes from the post
variable.  Something like:-

function remove_magic_quotes( &$array ) {
foreach( $array as $index => $value ) {
if ( is_array( $array[$index] ) ) {
remove_magic_quotes( $array[$index] );
} else {
if ( magic_quotes_runtime() ){
$array[$index] = stripslashes( $value );
}
}
}

But not quite there.  Any ideas?

Ben

> > Ben
> > 
> > On Thu, 2005-02-10 at 13:28 +0100, Jochem Maas wrote:
> > 
> >>Ben Edwards (lists) wrote:
> >>
> >>>Am I correct in thinking Magic Quotes automatically adds quotes to all
> >>>posted variables, therefore if you are displaying post variables on a
> >>>form you have to remove the quotes.  They are only needed if you are
> >>>actually inserting/updating into the database.   Whether magic quotes
> >>>are on or not you do not actually have to do anything to data fetched
> >>>from the database. If magic quoted are not on you have to add slashes
> >>>before you add to the database.
> >>
> >>you get the gist of it bare in mind _many_ people including actual php
> >>developers avoid magic_quotes like the plague cos its a PITA.
> >>
> >>basically your input to the DB should be properly escaped (there are special
> >>functions for this also, depending on your DB, I use alot of firebird and 
> >>its capable
> >>of parameterized queries - making it impossible to do SQL injection if you 
> >>use
> >>the parameterized markup).
> >>
> >>AND anything you output to the browser should be sanitized properly as 
> >>well...
> >>goto phpsc.net and read everything there - its a good/solid introduction to
> >>writing secure php code (e.g. how to combat XSS etc). phpsc.net is headed 
> >>by Chris
> >>Shiflett - a veritable goldmine of php related knowledge do yourself a 
> >>favor...
> >>read his stuff :-) any questions that arise from reading that are welcome 
> >>here :-)
> >>
> >>
> >>>There is also another function you need pass stuff through if you are
> >>>going to use it in an , what is that
> >>>function?
> >>
> >>htmlentities()
> >>
> >>
> >>>Ben
-- 
Ben Edwards - Poole, UK, England
If you have a problem sending me email use this link
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Re: Weighted Lists

2005-02-10 Thread W Luke
On Wed, 09 Feb 2005 10:56:51 -0800 (PST), Matthew Weier O'Phinney
<[EMAIL PROTECTED]> wrote:
> * W Luke <[EMAIL PROTECTED]>:
> > I've been fascinated by Flickr's, del.icio.us and other sites' usage
> > of these Weighted Lists.  It's simple but effective and I really want
> > to use it for a project I'm doing.
> >
> > So I had a look at Nick Olejniczak's plugin for Wordpress (available
> > here: www.nicholasjon.com) but am struggling to understand the logic
> > behind it.
> >
> > What I need is to dump all words (taken from the DB) from just one
> > column into an array.  Filter out common words
> > (the,a,it,at,you,me,he,she etc), then calculate most frequent words to
> > provide the weighted list.  Has anyone attempted this?
> 
> Funny you should mention this -- I'm working on something like this
> right now for work.
> 
> Basically, you need to:
> 
> * define a list of common words to skip
> * define weighting (I weight items in a title and in text differently,
>   for instance -- usually you weight by which field you're using); store
>   weighting in an associative array
> * define a weights array (associative array of word => score)
> * separate all text from the column into words (build a words array)
> * loop over the words array
>   * skip if the word is a common word
>   * increment word element in weights array by the weight
> 
> The sticky issues are: what is a word (you'll need to build a regexp for
> that), and how will you weight words (usually by field). Once you have
> all this, you populate a database table for use as a reverse lookup.

Thanks Matthew - a similar logic to what I'm using, although mine (so
far) is a little clunky.  I might ping you later on today if that's
ok, to talk a bit more and share notes.

Regards,
-- 
Will   The Corridor of Uncertainty   http://www.cricket.mailliw.com/
 - Sanity is a madness put to good use -

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



[PHP] Re: errors not reported

2005-02-10 Thread Sdav
u may try to use ini_set.
prepend it to the file and see what happens:
ini_set('display_errors', 1);
ini_set('error_reporting',E_ALL);
may not solve the problem but is a good start to see where u are.
ini_set got a  good documentation about error displaying on the website,
what it does is overwrite .ini values on realtime.
and it is on
http://ar2.php.net/manual/en/ref.errorfunc.php#ini.display-errors
Sdav


"D_c" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hiya -

My parse errors have disappeared from my development environment. Now
whenever php cannot run a page, it just stops with a blank page in the
browser and no clues.
Running the same code on another server will give a "fatal error class
not found" etc type output to the browser.

Can someone help me with what other places error reporting (esp parse
errors) is configured?
What i did:

check phpinfo()
find which php.ini is being used
edited that to set all error settings I could find to on.
call error_reporting(E_ALL) in my scripts.

but all to no avail! Gak!

Are there any other apache settings or other system variables to check?

/dc
___
   David "DC" Collier
mobile business creator |
   [EMAIL PROTECTED]
   skype: d3ntaku
   http://www.pikkle.com
   +81 (0)90-7414-6107

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



[PHP] looking for an app that does categories/lists...

2005-02-10 Thread bruce
hi...

i need a quick/simple app/script the will allow me to create a master
directory/list, and then create subcategories of the master categories, as
well as the child categories...

i'd also like to be able to move nodes/branches of the tree around as
needed.

i'm basically looking at setting up an app that's going to have an admin
create the required categories/classifications, and then i'm going to allow
users to be able to specify what categories/sub-categories they belong to.

does anyone have any pointer to an app/script that could do the
directory/categories portion of what i just described...

i've looked through google/freshmeat/sourceforge/etc.. as well as some of
the scripting sites without much luck...

thanks

bruce
[EMAIL PROTECTED]

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



Re: [PHP] Magic Quotes

2005-02-10 Thread Ben Edwards (lists)
On Thu, 2005-02-10 at 13:28 +0100, Jochem Maas wrote:
> Ben Edwards (lists) wrote:
> > Am I correct in thinking Magic Quotes automatically adds quotes to all
> > posted variables, therefore if you are displaying post variables on a
> > form you have to remove the quotes.  They are only needed if you are
> > actually inserting/updating into the database.   Whether magic quotes
> > are on or not you do not actually have to do anything to data fetched
> > from the database. If magic quoted are not on you have to add slashes
> > before you add to the database.
> 
> you get the gist of it bare in mind _many_ people including actual php
> developers avoid magic_quotes like the plague cos its a PITA.

Yes, it seems like they were invented by the Powers of Darkness ;).  

I think I am going to put stuff in my common code that is run on at the 
beginning of every page to remove magic quotes from $_REQUEST, and run all 
data being put into the database through addslashes first.

I can see it is only any to trivial pages where you are taking user input 
and putting it stright into the database with out validation or re-displaying 
it. There for it is useless.

Regards,
Ben


> basically your input to the DB should be properly escaped (there are special
> functions for this also, depending on your DB, I use alot of firebird and its 
> capable
> of parameterized queries - making it impossible to do SQL injection if you use
> the parameterized markup).
> 
> AND anything you output to the browser should be sanitized properly as well...
> goto phpsc.net and read everything there - its a good/solid introduction to
> writing secure php code (e.g. how to combat XSS etc). phpsc.net is headed by 
> Chris
> Shiflett - a veritable goldmine of php related knowledge do yourself a 
> favor...
> read his stuff :-) any questions that arise from reading that are welcome 
> here :-)
> 
> > 
> > There is also another function you need pass stuff through if you are
> > going to use it in an , what is that
> > function?
> 
> htmlentities()
> 
> > 
> > Ben
-- 
Ben Edwards - Poole, UK, England
If you have a problem sending me email use this link
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Magic Quotes

2005-02-10 Thread Jeffery Fernandez
Jochem Maas wrote:
Ben Edwards (lists) wrote:
Am I correct in thinking Magic Quotes automatically adds quotes to all
posted variables, therefore if you are displaying post variables on a
form you have to remove the quotes.  They are only needed if you are
actually inserting/updating into the database.   Whether magic quotes
are on or not you do not actually have to do anything to data fetched
from the database. If magic quoted are not on you have to add slashes
before you add to the database.

you get the gist of it bare in mind _many_ people including actual 
php
developers avoid magic_quotes like the plague cos its a PITA.

basically your input to the DB should be properly escaped (there are 
special
functions for this also, depending on your DB, I use alot of firebird 
and its capable
of parameterized queries - making it impossible to do SQL injection if 
you use
the parameterized markup).

AND anything you output to the browser should be sanitized properly as 
well...
goto phpsc.net and read everything there - its a good/solid 
introduction to
writing secure php code (e.g. how to combat XSS etc). phpsc.net is 
headed by Chris
Shiflett - a veritable goldmine of php related knowledge do 
yourself a favor...
read his stuff :-) any questions that arise from reading that are 
welcome here :-)

There is also another function you need pass stuff through if you are
going to use it in an , what is that
function?

htmlentities()
Ben

http://phpsec.org/ it should be ;-)
cheers,
Jeffery
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Refresh Problem

2005-02-10 Thread Jose Angel Sanchez \(Jone\)
Hi 

First of all: I'm sorry for writing errors - I don't speak English too
much (spanish)

I'm building an application which works that way:

I use url parameters to set zone (document location), actions and
params.

I've badly make security part so only registered people
($_session['USER'] <- which is set after check Login/pass form) can
access different zones but my problem is on refreshing page that
contains action

i.e.
http://www.mypage.com?index.php&zone=contact&action=newcontact&name=geor
ge

only registered/valid users can make this zone code runs

my pseudocode basicly works this way:

function contactzone (no params)

get URL parameters (like $action=$_get['action']



switch ($action)

case 'new'
$html.= show form (on submit set action to
'newcontact'
break;
case 'newcontact'
Insert on database
On success -> $html
Default
Show simple $html
}


return $html


My problem is on refresh or back events on navigator; the action will
execute again.

How do I prevent that? Session variables? Check a single table storing
used hashes sent by form (generated with md5 or any) on all forms
containing actions event for all tables? What do you think?

Sorry again and thx for reading and helping :D

j0n3 


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



Re: [PHP] Magic Quotes

2005-02-10 Thread Jochem Maas
Ben Edwards (lists) wrote:
Am I correct in thinking Magic Quotes automatically adds quotes to all
posted variables, therefore if you are displaying post variables on a
form you have to remove the quotes.  They are only needed if you are
actually inserting/updating into the database.   Whether magic quotes
are on or not you do not actually have to do anything to data fetched
from the database. If magic quoted are not on you have to add slashes
before you add to the database.
you get the gist of it bare in mind _many_ people including actual php
developers avoid magic_quotes like the plague cos its a PITA.
basically your input to the DB should be properly escaped (there are special
functions for this also, depending on your DB, I use alot of firebird and its 
capable
of parameterized queries - making it impossible to do SQL injection if you use
the parameterized markup).
AND anything you output to the browser should be sanitized properly as well...
goto phpsc.net and read everything there - its a good/solid introduction to
writing secure php code (e.g. how to combat XSS etc). phpsc.net is headed by 
Chris
Shiflett - a veritable goldmine of php related knowledge do yourself a 
favor...
read his stuff :-) any questions that arise from reading that are welcome here 
:-)
There is also another function you need pass stuff through if you are
going to use it in an , what is that
function?
htmlentities()
Ben
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Magic Quotes

2005-02-10 Thread Ben Edwards (lists)
Am I correct in thinking Magic Quotes automatically adds quotes to all
posted variables, therefore if you are displaying post variables on a
form you have to remove the quotes.  They are only needed if you are
actually inserting/updating into the database.   Whether magic quotes
are on or not you do not actually have to do anything to data fetched
from the database. If magic quoted are not on you have to add slashes
before you add to the database.

There is also another function you need pass stuff through if you are
going to use it in an , what is that
function?

Ben
-- 
Ben Edwards - Poole, UK, England
If you have a problem sending me email use this link
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)



signature.asc
Description: This is a digitally signed message part


AW: [PHP] PHP Development IDE's/Editors

2005-02-10 Thread Mirco Blitz
Hi,
Cause as I stared to programm html with Dreamweaver, I stayed with it.
Good syntax Hignlighting and no Program switching between Coding and
designing.

It fits all my needs.

Greetings
Mirco Blitz 

-Ursprüngliche Nachricht-
Von: Darren Linsley [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 10. Februar 2005 04:56
An: php-general@lists.php.net
Betreff: [PHP] PHP Development IDE's/Editors

I will apologise for this questions now, but everyone has to start
somewhere.

I am just starting out with PHP and wanted to know what development
environments/editors that you guys are using for your PHP development.  (On
Windows)

I know that you can use good ol Visual Notepad, but i was wondering if there
was anything better out there.

Thanks. 

--
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



[PHP] imagettftext color problem

2005-02-10 Thread Anni Hienola
Hello,

I want to display TTF text in a png image. I use the following type of
code:

$font="luxisr";
$font_size=16;
$img=imagecreate($width, $height);
$bg=imagecolorallocate($img, 255, 255, 255);
$font_color=imageallocatecolor($img, 0, 0, 0);

imagettftext($img, $font_size, 0, $x, $y, $font_color, $font, $image_name);
imagepng($img, $file);
imagedestroy($img);

The font itself looks okay but the color stays awful yellow no matter what
I do. I saw someone suggesting the usage of imagecolorresolve(), but it
didn't help in this case. When browsing the web, I saw a comment about
this bug being already in the version 4.3.5, but only when
imagecreatetruecolor() was used. Now I'm using imagecreate() with the same
results. Any hints?

My box is Fedora Core 3, PHP 4.3.10, apache 2, browser Firefox.

Anni H.

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



Re: [PHP] Fatal Error Handling

2005-02-10 Thread James Taylor

-bash-2.05b$ php test.php
Content-type: text/html
X-Powered-By: PHP/4.3.10
Memory Limit: 32K
Memory Used: 13432
Error (1024) in /www/l-i-e.com/web/test.php:12 - Test
-bash-2.05b$
Note a complete lack of "Made it" nor an error message trapped by my error
handler when the RAM runs out. :-(
This is the symptom I had when I recoded t osomething very similar.
Looks like the Memory limit is hard-coded and won't trigger an error
handler nor will it give you any chance to catch it.
Yes, This might be a mis-discription of error, that this error really is 
php-fatal not just script-fatal.


With error handling as normal, can it handle a fatal error? My issue is
not it would not report a fatal error, it does not continue with the
script.

I think maybe not -- but maybe only specific errors exhibit this feature.
Memory limit and Time limit could be "weird" enough to need it.
You could try some other fatal errors to see.
Some errors do seem to be caught correctly such as Parse Error - 
(especially with Eval) which highlights my theory of fatal being either 
script-fatal or program-fatal. if its the PHP application that has died, 
then it would explain why the memory limit and some others might not 
execute correctly. I did not try time, but suspect that would be 
script-fatal. Both these limits are designed to protect your computer 
from crashing becuase of bad programmers (/me looks guilty), and it 
would be daft to allow a programer to continue with code once either of 
these have been breached.

The last issue I am worried about is scope - if I have run out of
memory, then what can I do - I seem to have issues running commands
which go over this limit during the command (irrelevant of their end
memory usage). Supposing I had enough memory to run the set_ini function
and increase my memory limit, then I would be able to execute any
command to roll back (transaction wise) the program execution so far,
and email/notify/whatever. This is irellevant if a "success" orientated
monitoring method is implemented.

I think you would be well-served to figure out where the RAM is going, and
making sure it's what it should be at various junctures.
yes, I seem to have a memory leak, which has been explained to me by a 
collegue as a possibility that I am including a new object line inside 
the loop (being used to Java's garbidge collector (and my manual calling 
of it)) that would get recreated each loop, without much impact on 
memory, and that removing the new call to outside the loop, and placing 
a "refresh" or "renew" function into my object would save me memory.

This is a little concern as this is difficult to find in the code - the 
only "large" (proportional to avail-mem) objects that Im using are in 
loops of ten to twenty seconds (due to database calls).

Maybe you're trying to patch symptoms instead of debugging the true problem.
Just a thought.
Of course, an efficient elegant working program is always to be desired, 
 but the nature of this problem is potentially a PEBCAK - I can not 
always limit the input ranges suitably (due to number of combinations of 
different variables), perhaps I should write a calculate function which 
takes the same arguments as the real function, and guesses to its length 
of time to run and its memory usage. That way I can make a descision as 
to whether to run it or not (of course it would take me a while to get 
the memory profile accurate, but would be nice to see). This isnt as 
easy as just saying if $x < 10 and $y < 10 or max $x must be inversly 
proportional to $y (so as $y increases the max $x can be must decrease) 
as it would involve actual data in the database and knowing how 
different data affects the speed / memory. But thats my problem and very 
specific to whats going on, so feel free to ignore...

You could also maybe file this as a bug, after searching the bugs database
to see if it's a known issue, or even a "feature"
I dont think it is a bug I think it makes sense in its repeats, but I 
think I'll add a comment to the page on the php manual with my findings, 
and link to this discussion.

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