Re: [PHP] Anyone getting bounces from

2005-12-08 Thread David Robley
Max Belushkin wrote:

> John Nichel wrote:
>> Jay Blanchard wrote:
>>> [EMAIL PROTECTED] ?
>>>
>>> I am getting failure notices out the wazoo for some very old messages
>>> to the
>>> general list.
> 
> I am too.

 Ask me! Ask me!

No, I'm not getting them


Cheers
-- 
David Robley

A clean desk is a sign of a cluttered desk drawer.

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



Re: [PHP] What software do you use for writing PHP?

2005-12-08 Thread David Robley
John Nichel wrote:

> Miles Thompson wrote:
>> At 11:45 AM 12/7/2005, Jay Blanchard wrote:
>> 
>>> [snip]
>>> > Two words  punch cards. 'Nuff said.
>>> >
>>>
>>> Come on now Jay, we know you're old and all, but everyone knows that you
>>> cannot edit php with punch cards.  Hanging chads will cause too many
>>> fatal errors.  ;)
>>> [/snip]
>>>
>>>
>>> ROFLMMFAO
>> 
>> 
>> Why these clumsy interfaces?
>> 
>> Just plug the Firewire in your ear!
> 
> n00b
> 
> ;)
> 

Punch cards? Looxury. Toggle switches on the front of the computer



Cheers
-- 
David Robley

Circular Definition: see Definition, Circular.

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



RE: [PHP] What software do you use for writing PHP?

2005-12-08 Thread David Robley
Jim Moseby wrote:

>> 
>> Curt Zirzow wrote:
>> > On Tue, Dec 06, 2005 at 06:36:33PM +0100, M. Sokolewicz wrote:
>> > 
>> >>Jason Petersen wrote:
>> >>
>> >>>On 12/6/05, Jeff McKeon <[EMAIL PROTECTED]> wrote:
>> >>>
>> >>>
>> Hey all,
>> 
>> Forever now I've been using Frontpage for all my web work
>> including php.
>> I'm sure there's better software out there that is more suited to
>> writing and editing PHP pages.  What do you all use?
>> 
>> >>>
>> >>>
>> >>>Vim is my editor of preference.  If I have to use Windows,
>> I usually go
>> >>>with
>> >>>Homesite (because I already have a licensed copy) or
>> Textpad (because it's
>> >>>better than Notepad).
>> >>>
>> >>>IDEs?  Who needs 'em ;)
>> >>>
>> >>>Best,
>> >>>Jason
>> >>>
>> >>
>> >>same here :)
>> >>Vim on UNIX machines, and Textpad on Windows
>> > 
>> > 
>> > man you guys are wimps.. gvim on windows... :)
>> 
>> Pt'Edit' in DOS.  ;)
>> 
> 
> (Pt * 2)  'edlin' in DOS.  :P

(Pt * 3) SPF on IBM mainframe


Cheers
-- 
David Robley

You have two choices for dinner: Take it or Leave it.

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



Re: [PHP] What software do you use for writing PHP?

2005-12-08 Thread David Robley
John Nichel wrote:

> Jay Blanchard wrote:
>> [snip]
>> 
>man you guys are wimps.. gvim on windows... :)
>  

Pt'Edit' in DOS.  ;)


>>>
>>>(Pt * 2)  'edlin' in DOS.  :)
>> 
>> 
>> Infinitely recursive pfft A pencil and a piece of paper and
>> ringing people to describe the cool web site you've just drawn,
>> [/snip]
>> 
>> Two words  punch cards. 'Nuff said.
>> 
> 
> Come on now Jay, we know you're old and all, but everyone knows that you
> cannot edit php with punch cards.  Hanging chads will cause too many
> fatal errors.  ;)
> 

Suitable underware will prevent hanging... oh wait, he said _chads_


Cheers
-- 
David Robley

If little else, the brain is an educational toy.

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



Re: [PHP] Class Constant PHP 5

2005-12-08 Thread Jochem Maas

Jay,

gonna have to correct you on this lot (sorry ;-)

Jay Blanchard wrote:

[snip]
is there a way to dynamically define a class constant during runtime  
in PHP 5?


for example I would like to achieve the result of something like:

class Example {
const FOO = bar();
}

However this would obviously give a parse error.

I know it is possible with variables but I would like it to be a  
constant.

[/snip]

Well, first of all the syntax you describe above does not define a constant
at all, you would need to use define()


the syntax is fine (apart from the function call which is illegal where it is),
it defines a class constant. e.g.



which is legal.



The second thing is good old basic OOP theory, you should declare a private
static variable


... with a public static getter method (so that value can be reached from 
outside
the class, just like a class constant can)



http://us3.php.net/private
http://us3.php.net/manual/en/language.oop5.static.php


I agree that this is the sane/correct way to do what the OP wants.
there is one alternative (but it comes with big neon warning signs):

http://php.net/manual/en/function.runkit-constant-redefine.php

runkit is very very clever - lots of rope to hang yourself - use at
your own risk :-)



Of course you could define a global constant and then pass it into your
object when instantiating it, but that is a bad idea generally.

Thirdly, you could never use a function to derive your constant value...it
would then be an oxymoron. If the value generated by the function bar()
changes, FOO is a variable. Constants are for simple values. For instance,
we can all agree that pi is 3.14159 (to 5 decimal places, so defining a
constant pi makes sense;

define("PI", 3.14159);

If we do not know what the outcome of a function will be it makes the value
of the outcome a variable, always. It would be foolish (and would fail
anyhow) to do something like this;

define("RANDOM", rand(5,12));


it doesn't fail and is not imho foolish by definition ... the value of the 
constant,
although changing stays the same for the duration of the request,

IIRC Rasmus himself once mentioned that it can be useful to be able to set
a constant to a 'dynamic' value like this - nuff said really :-)





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



Re: [PHP] broken code....

2005-12-08 Thread Jochem Maas

Eternity Records Webmaster wrote:

I have this code that doesnt print the db results like they should... it


'like it should' means what exactly?


uses pear::db package for the database. Was wondering if anybody can figure
out how come it doesnt work...


what does not work?



getMessage()); }
$results->query('select * from eternityrecords.journal');
if (PEAR::isError($results)) {
die($db->getMessage()); }
//test the results out..
?>

fetchInto($journal, DB_FETCHMODE_ASSOC)){
?>


  
  
  



disconnect();
?>



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



Re: [PHP] Non-trivial task of converting text to HTML

2005-12-08 Thread Jochem Maas

Roman Ivanov wrote:

Task:
Create a script that converts text into HTML with paragraphs.

Problem:
Input text could use the book notation, as well as the web notation, 
plus it can contain HTML.


==
This is a title

   This is a Book paragraph.
   This is another book paragraph.
This is yet another book paragraph, but it's not indented with spaces, 
because user wrote it in OpenOffice.

==

==
This is a web paragraph.

This is another web paragraph.


what is a book paragraph, what is a web paragraph? (exactly)

have you looked at the Tidy extension? in short it kicks ass
at cleaning up junk HTML - possibly a good start.



   This is yet another web paragraph, which is indented with spaces for 
some unknown reason.

==

Output text should be correctly formatted without using lots of br's and 
 's. Doing so manually is not a problem, I would just use  for 
web paragraphs, and  for book paragraphs. However, 
formatting such text with a scrip is very difficult. Does anyone knows a 
good exaple of such script?




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



Re: [PHP] What software do you use for writing PHP?

2005-12-08 Thread Zack Bloom
I wish I had the punch card version.  I have to rewire my php box everytime
I want to change something.

On 12/8/05, David Robley <[EMAIL PROTECTED]> wrote:
>
> John Nichel wrote:
>
> > Miles Thompson wrote:
> >> At 11:45 AM 12/7/2005, Jay Blanchard wrote:
> >>
> >>> [snip]
> >>> > Two words  punch cards. 'Nuff said.
> >>> >
> >>>
> >>> Come on now Jay, we know you're old and all, but everyone knows that
> you
> >>> cannot edit php with punch cards.  Hanging chads will cause too many
> >>> fatal errors.  ;)
> >>> [/snip]
> >>>
> >>>
> >>> ROFLMMFAO
> >>
> >>
> >> Why these clumsy interfaces?
> >>
> >> Just plug the Firewire in your ear!
> >
> > n00b
> >
> > ;)
> >
>
> Punch cards? Looxury. Toggle switches on the front of the computer
>
>
>
> Cheers
> --
> David Robley
>
> Circular Definition: see Definition, Circular.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> Jim Moseby wrote:
>
> >>
> >> Curt Zirzow wrote:
> >> > On Tue, Dec 06, 2005 at 06:36:33PM +0100, M. Sokolewicz wrote:
> >> >
> >> >>Jason Petersen wrote:
> >> >>
> >> >>>On 12/6/05, Jeff McKeon <[EMAIL PROTECTED]> wrote:
> >> >>>
> >> >>>
> >> Hey all,
> >> 
> >> Forever now I've been using Frontpage for all my web work
> >> including php.
> >> I'm sure there's better software out there that is more suited to
> >> writing and editing PHP pages.  What do you all use?
> >> 
> >> >>>
> >> >>>
> >> >>>Vim is my editor of preference.  If I have to use Windows,
> >> I usually go
> >> >>>with
> >> >>>Homesite (because I already have a licensed copy) or
> >> Textpad (because it's
> >> >>>better than Notepad).
> >> >>>
> >> >>>IDEs?  Who needs 'em ;)
> >> >>>
> >> >>>Best,
> >> >>>Jason
> >> >>>
> >> >>
> >> >>same here :)
> >> >>Vim on UNIX machines, and Textpad on Windows
> >> >
> >> >
> >> > man you guys are wimps.. gvim on windows... :)
> >>
> >> Pt'Edit' in DOS.  ;)
> >>
> >
> > (Pt * 2)  'edlin' in DOS.  :P
>
> (Pt * 3) SPF on IBM mainframe
>
>
> Cheers
> --
> David Robley
>
> You have two choices for dinner: Take it or Leave it.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] PHP Warning: imagettftext() expects parameter 2 to be double

2005-12-08 Thread Jochem Maas

Jeffrey Sambells wrote:
You've got 83px in you XML file for the fontsize. the 'px' is messing  
it up change it to just 83 in the XML file or cast the value to (float)  
which will extract the 83 and remove the px:


well spotted Jeffery; James didn't I say to var_dump() the vars you
create inside the loop?? print_r() and var_dump() are your friends!





foreach ($xml->textblock as $text) {

$fontsize=(float)$text->fontsize;

$fontangle=(float)$text->fontangle;
$fontxpos=(int)$text->fontxpos;
$fontypos=(int)$text->fontypos;
$text=$text->text;


i.e.

var_dump($fontsize, $fontangle, $fontxpos, $fontypos, $text);

   
 
imagettftext($image['png'],$fontsize,$fontangle,$fontxpos,$fontypos,$fon 
t['color'],$font['type'],"$text",array());


one other thing, there is no point in writing:

"$text"

the quotes have no use (assuming $text is a string), in
fact its a [very small] waste of processing power.


}



- Jeff

On 7-Dec-05, at 7:06 AM, James wrote:


Hi,

 Thank you for getting back to me, your the first.

 The array works fine – I have tested it using var_dump().

 Attached are the two files – xml.test – this holds the array of the  
text blocks which is being parsed by image.php.


 Line 38 is the problem, if you comment around the foreach() 
statement  and un-comment the commented lines you should see it 
working fine, its  when its within the foreach statement when it errors.


 Regards,

 James


 Jochem Maas Wrote:


James wrote:
 > Hi there,
 >
 > I have been using the GD functions from PHP5.0 on Mac OS X.
 >
 > I have a simple script that creates a PNG image with text on the  
image using

 > fonts using FreeType 2.
 >
 > I am trying to use the imagettftext() function within a foreach  
loop – but I

 > get the following error:
 >
 > PHP Warning:  imagettftext() expects parameter 2 to be double

 what does paramter 2 contain in each case? var_dump(), print_r(),  
echo ?!?


 >
 > The code is as follows:
 >
 > $font['type']="./fonts/font.ttf”;
 >
 > 
 >  
$font['color']=imageColorAllocate($card['png'],$font['hexcolor']['r'], 
$font[

 > 'hexcolor']['g'],$font['hexcolor']['b']);
 >
 > imageFill($card['png'],0,0,$card['color']);
 >
 > foreach ($xml->textblock as $text) {
 > $fontsize=$text->fontsize;$fontangle=$text->fontangle;
 > $fontxpos=$text->fontxpos;$fontypos=$text->fontypos;
 > $text=$text->text;

 try var_dump($text); or print_r($text); to see what you have
 (if its an XML node object - dump $fontsize, $fontxpos instead!!!)

 >  
imagettftext($image['png'],$fontsize,$fontangle,$fontxpos,$fontypos,$f 
ont['c

 > olor'],$font['type'],$text);}
 >
 > It works fine if I add just one line outside of the loop – but as  
soon as

 > its within the loop it errors.
 >
 > Cheers,
 >
 > James
 >



 --
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] Multiple callback_outputs for ob_start

2005-12-08 Thread Jochem Maas

Chris Shiflett wrote:

Mathijs wrote:


How can i add more callback_outputs to ob_start?

I want to have both: ob_start('switchContent');
and: ob_start('ob_gzhandler');



I don't think you can, but you could have a single function that calls 
both, then specify that function in ob_start().


I think you can by simply stacking multiple output buffers on top
of each other:

ob_start('switchContent'); // first buffer, for first callback
ob_start('ob_gzhandler');  // second buffer, for second callback

take care to define the handlers in the 'right' order
(the order that they are run in may be important to your output/code)

// rest of code.

I implemented a class once that stacks a list of callbacks
which could then all be run by its callback handler, psuedo-code:

class CB
{
private static $cbs = array();

public static function addCB($cb)
{
if (is_callable($cb)) {
self::$cbs[] = $cb;
}
}

public static function run($data)
{
foreach (self::$cbs as $cb) {
$data = call_user_func($cb, $data);
}

return $data;
}
}

ob_start( array('CB','run') );



Chris



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



[PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread Paul Hickey
Can someone help me overcome this recurring problem? I am using the
Joomla content management system and I keep coming across the following
errors.  

Fatal error: Call to undefined function mysql_real_escape_string()
in /usr/local/apache2/htdocs/common.php on line 24

Fatal error: Call to undefined function mysql_real_escape_string()
in /usr/local/apache2/htdocs/class.inputfilter.php on line 344

I notice in my Dynamic Extensions section of php.ini there are no
extensions called for; if that helps. Joomla works fine, but when adding
components or modules the problems start. One component author made a
test for the mysql_real_escape_string and I think avoided using it then
the component worked. I think that's probably not the best solution. 

Fedora Core 3

Apache 2.0.55

PHP 5.0.5 (compiled with mysqli vice mysql)
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-ftp'
'--enable-inline-optimization' '--enable-magic-quotes' '--enable-
mbstring' '--enable-track-vars' '--enable-trans-sid' '--enable-
wddx=shared' '--enable-xml' '--with-dom' '--with-gd' '--with-gettext'
'--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-regex=system'
'--with-xml' '--with-zlib-dir=/usr/lib'

MySQL 4.1.15


TIA,


Paul Hickey
Christian Patriot 
Palm Bay Fl

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



[PHP] Mime-type handling

2005-12-08 Thread Manuel Vacelet
Hi all,

I'm facing a bad behaviour of 'file' command used by fileinfo PECL module
(recommanded for mime-type checking):
* Some Microsoft Excel documents are detected as Microsoft Word documents
* Some HTML files are just text/plain
* ...

I tested on multiple machines (with different version of file) and I
sometimes obtain a diffrent behaviour but never the one expected :/ I also
looked for the latest version of file but it seems that the file used to
detect the mime-type is out of date...

My questions are:
* If you already encounter this problem, how did you solve it ?
* Where can I find an up-to-date version of magic number list usable with
file for mime type checking ?

Thanks,
Regards,
Manuel


Re: [PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread David Grant
Try using mysqli, instead of mysql.

Have you tried Joomla! support channels?

Paul Hickey wrote:
> Can someone help me overcome this recurring problem? I am using the
> Joomla content management system and I keep coming across the following
> errors.  
> 
> Fatal error: Call to undefined function mysql_real_escape_string()
> in /usr/local/apache2/htdocs/common.php on line 24
> 
> Fatal error: Call to undefined function mysql_real_escape_string()
> in /usr/local/apache2/htdocs/class.inputfilter.php on line 344
> 
> I notice in my Dynamic Extensions section of php.ini there are no
> extensions called for; if that helps. Joomla works fine, but when adding
> components or modules the problems start. One component author made a
> test for the mysql_real_escape_string and I think avoided using it then
> the component worked. I think that's probably not the best solution. 
> 
> Fedora Core 3
> 
> Apache 2.0.55
> 
> PHP 5.0.5 (compiled with mysqli vice mysql)
> './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-ftp'
> '--enable-inline-optimization' '--enable-magic-quotes' '--enable-
> mbstring' '--enable-track-vars' '--enable-trans-sid' '--enable-
> wddx=shared' '--enable-xml' '--with-dom' '--with-gd' '--with-gettext'
> '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-regex=system'
> '--with-xml' '--with-zlib-dir=/usr/lib'
> 
> MySQL 4.1.15
> 
> 
> TIA,
> 
> 
> Paul Hickey
> Christian Patriot 
> Palm Bay Fl
> 


-- 
David Grant
http://www.grant.org.uk/

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



Re: [PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread Paul Hickey
I have PHP compiled with mysqli.

The standard answer from the Joomla forums is that I need to have
"mysql" vice "mysqli". I was looking for a more global solution than
having to modify the code for every component, module, mambot I want to
use.

I don't understand why I'm getting "undefined function" errors. 

PHP.ini has no reference to mysqli. I don't know if changing this would
enable the functions specific to PHP > 4.x.

Paul Hickey
Christian Patriot 
Palm Bay Fl

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



Re: [PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread David Grant
Is there no way to specify the database functions in Joomla?

You're getting undefined function because you haven't compiled it with
mysql, but mysqli instead, which means the functions you need are
prefixed with mysqli instead of mysql.

Paul Hickey wrote:
> I have PHP compiled with mysqli.
> 
> The standard answer from the Joomla forums is that I need to have
> "mysql" vice "mysqli". I was looking for a more global solution than
> having to modify the code for every component, module, mambot I want to
> use.
> 
> I don't understand why I'm getting "undefined function" errors. 
> 
> PHP.ini has no reference to mysqli. I don't know if changing this would
> enable the functions specific to PHP > 4.x.
> 
> Paul Hickey
> Christian Patriot 
> Palm Bay Fl
> 


-- 
David Grant
http://www.grant.org.uk/

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



Re: [PHP] Re: Preventing Cross Site Scripting Vulnerbilities

2005-12-08 Thread Marco Kaiser
Hi,


IMO, the best way to avoid XSS is to filter _output_.
>
> My script:
> http://nengine.korsengineering.com/files/src/misc/HtmlFilter.phps
>

uhm,

1st. filter input
2nd escape output


--
Marco Kaiser


RE: [PHP] Class Constant PHP 5

2005-12-08 Thread Jay Blanchard
[snip]
it doesn't fail and is not imho foolish by definition ... the value of the
constant,
although changing stays the same for the duration of the request,

IIRC Rasmus himself once mentioned that it can be useful to be able to set
a constant to a 'dynamic' value like this - nuff said really :-)
[/snip]

Thanks for the education there Jochem, I'd forgotten about const mostly
because I am in the habit of declaring private static variables and using
get and set methods for this kind of thing because I do a lot of C++ work
too and the theory holds up in both languages. And it is correct in the fact
that a class constant cannot contain a function (as I hadn't clearly stated
earlier) as the OP had requested, the syntax would fail. 

I guess that I am old school enough (I see John Nichel's hands racing to the
keyboard now!) that expect a constant to be just that. The concept of a
changing constant is what we would normally call a variable. I suppose that
a holy war could ensue over this. In the end a class constant is constant
and its visibility is public. 

For the OP I found the following manual page;

http://us2.php.net/manual/en/language.oop5.constants.php

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



Re: [PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread John Nichel

Paul Hickey wrote:

Can someone help me overcome this recurring problem? I am using the
Joomla content management system and I keep coming across the following
errors.  


Fatal error: Call to undefined function mysql_real_escape_string()
in /usr/local/apache2/htdocs/common.php on line 24

Fatal error: Call to undefined function mysql_real_escape_string()
in /usr/local/apache2/htdocs/class.inputfilter.php on line 344

I notice in my Dynamic Extensions section of php.ini there are no
extensions called for; if that helps. Joomla works fine, but when adding
components or modules the problems start. One component author made a
test for the mysql_real_escape_string and I think avoided using it then
the component worked. I think that's probably not the best solution. 


Fedora Core 3

Apache 2.0.55

PHP 5.0.5 (compiled with mysqli vice mysql)
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-ftp'
'--enable-inline-optimization' '--enable-magic-quotes' '--enable-
mbstring' '--enable-track-vars' '--enable-trans-sid' '--enable-
wddx=shared' '--enable-xml' '--with-dom' '--with-gd' '--with-gettext'
'--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-regex=system'
'--with-xml' '--with-zlib-dir=/usr/lib'

MySQL 4.1.15


I'm pretty sure this was answered yesterday...oh yeah, it was.  ;)

http://marc.theaimsgroup.com/?l=php-general&m=113397347124908&w=2

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread John Nichel

Paul Hickey wrote:

I have PHP compiled with mysqli.

The standard answer from the Joomla forums is that I need to have
"mysql" vice "mysqli". I was looking for a more global solution than
having to modify the code for every component, module, mambot I want to
use.

I don't understand why I'm getting "undefined function" errors. 


PHP.ini has no reference to mysqli. I don't know if changing this would
enable the functions specific to PHP > 4.x.


In your configuration line (how php was configured then compiled), you 
have...


--with-mysqli=/usr/local/mysql/bin/mysql_config

That is why you are getting undefined function errors.  Your version of 
php is using mysqli, not mysql.  You have two options: a) Recompile php 
or b) Change all mysql_* functions to their counterparts in mysqli_*



--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread David Grant
Hi John,

John Nichel wrote:
> Paul Hickey wrote:
>> I don't understand why I'm getting "undefined function" errors.
>> PHP.ini has no reference to mysqli. I don't know if changing this would
>> enable the functions specific to PHP > 4.x.
> 
> In your configuration line (how php was configured then compiled), you
> have...
> 
> --with-mysqli=/usr/local/mysql/bin/mysql_config
> 
> That is why you are getting undefined function errors.  Your version of
> php is using mysqli, not mysql.  You have two options: a) Recompile php
> or b) Change all mysql_* functions to their counterparts in mysqli_*


Hmm, that's how I *should* have put it. :)

Cheers,

David
-- 
David Grant
http://www.grant.org.uk/

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



RE: [PHP] Preventing Cross Site Scripting Vulnerbilities

2005-12-08 Thread Ford, Mike
> -Original Message-
> From: Jason Gerfen [mailto:[EMAIL PROTECTED] 
> Sent: 07 December 2005 19:34
> To: comex
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Preventing Cross Site Scripting Vulnerbilities

> function chk_input( $string ) {
>  if( eregi( "^[0-9a-z_ -]$", $string ) ) {
>   return 0;
>  } else {
>   return 1;
>  }
> }
> 
> if( chk_input( $string ) == 0 ) {
>  echo "valid";
> } else {
>  echo "invalid";
> }

Urgh! Nothing like making the simple things complicated! ;)

The above is effectively the same as (the more readable and more
efficient):

   function chk_input( $string ) {
 return eregi( "^[0-9a-z_ -]$", $string );
   }
 
   if (chk_input( $string )) {
 echo "valid";
   else {
 echo "invalid";
   }

And, personally, I'd use preg in there rather than ereg, as it's more
efficient, more up-to-date, and more supported.
Cheers!

Mike
 


Mike Ford, Electronic Information Services Adviser, Learning Support
Services,
JG125, The Library, James Graham Building, Headingley Campus, Beckett
Park,
LEEDS, LS6 3QS, United Kingdom
Tel: +44 113 283 2600 extn 4730Fax: +44 113 283 3211


To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

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



[PHP] PEAR Validate email question

2005-12-08 Thread Eric Butera
Hello,

I'm using the PEAR Validate::email method to validate email addresses on our
contact forms since the spam bots have gotten so bad.  I am using the
"check_domain" flag which calls the php function "checkdnsrr."  This form
processor is used on several sites now and all is going well except one
problem.  It seems this "checkdnsrr" function randomly returns false on
valid email addresses.  I built a little debug feature into the processor to
let me know when the script fails and any error messages it has generated
along the way to try and stay ahead of the spammers.

I've been getting randomly occurring failure notices.  Most of the time it
works, sometimes it doesn't.  Every failure is a valid DNS and email
address.  If I try running the email address against Validate::email later
it works.  I was hoping somebody can shine some light on why checkdnsrr
would work sometimes and why it wouldn't work others.  Any help or advice
would be greatly appreciated.

Thanks in advance!


Re: [PHP] PEAR Validate email question

2005-12-08 Thread David Grant
Validate::email appears to check for a MX or A record.  I'm a bit rusty
on my RFCs, but isn't is possible the mail host could be specified using
a CNAME?

Cheers,

David

Eric Butera wrote:
> Hello,
> 
> I'm using the PEAR Validate::email method to validate email addresses on our
> contact forms since the spam bots have gotten so bad.  I am using the
> "check_domain" flag which calls the php function "checkdnsrr."  This form
> processor is used on several sites now and all is going well except one
> problem.  It seems this "checkdnsrr" function randomly returns false on
> valid email addresses.  I built a little debug feature into the processor to
> let me know when the script fails and any error messages it has generated
> along the way to try and stay ahead of the spammers.
> 
> I've been getting randomly occurring failure notices.  Most of the time it
> works, sometimes it doesn't.  Every failure is a valid DNS and email
> address.  If I try running the email address against Validate::email later
> it works.  I was hoping somebody can shine some light on why checkdnsrr
> would work sometimes and why it wouldn't work others.  Any help or advice
> would be greatly appreciated.
> 
> Thanks in advance!
> 


-- 
David Grant
http://www.grant.org.uk/

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



Re: [PHP] Non-trivial task of converting text to HTML

2005-12-08 Thread Eric Gorr

Quoting Roman Ivanov <[EMAIL PROTECTED]>:


Eric Gorr wrote:

Quoting Roman Ivanov <[EMAIL PROTECTED]>:

Output text should be correctly formatted without using lots of 
br's and  's. Doing so manually is not a problem, I would just 
use  for web paragraphs, and  for book 
paragraphs. However, formatting such text with a scrip is very 
difficult. Does anyone knows a good exaple of such script?



How do you intend to distinguish between a web paragraph and a book 
paragraph?


Good question. I don't know. If I would know, than writing scipt 
would be simple. It would be interesting to hear how other developers 
deal with such kind of things.



How can you even accomplish this manually?


By reading the text. *smiley*


Based on the samples you provides, it is unclear how you can 
distinguish between

the two based on reading the text without an understanding of what the text is
saying.

If you are seeking an algorithm that can accurately determine what the text is
saying and make a decision on how to proceed, I am afraid you won't find
anything.

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



Re: [PHP] Non-trivial task of converting text to HTML

2005-12-08 Thread David Grant
Hi Roman,

Check out this: http://www.michelf.com/projects/php-markdown/

Would this help you?

Cheers,

David

Roman Ivanov wrote:
> Task:
> Create a script that converts text into HTML with paragraphs.
> 
> Problem:
> Input text could use the book notation, as well as the web notation,
> plus it can contain HTML.
> 
> ==
> This is a title
> 
>This is a Book paragraph.
>This is another book paragraph.
> This is yet another book paragraph, but it's not indented with spaces,
> because user wrote it in OpenOffice.
> ==
> 
> ==
> This is a web paragraph.
> 
> This is another web paragraph.
> 
>This is yet another web paragraph, which is indented with spaces for
> some unknown reason.
> ==
> 
> Output text should be correctly formatted without using lots of br's and
>  's. Doing so manually is not a problem, I would just use  for
> web paragraphs, and  for book paragraphs. However,
> formatting such text with a scrip is very difficult. Does anyone knows a
> good exaple of such script?
> 


-- 
David Grant
http://www.grant.org.uk/

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



Re: [PHP] references, circular references, oop, and garbage collection in PHP5

2005-12-08 Thread Alan Pinstein

/* comments inline */

On Dec 8, 2005, at 2:34 AM, Curt Zirzow wrote:


On Wed, Dec 07, 2005 at 09:30:36PM -0500, Alan Pinstein wrote:


On Dec 7, 2005, at 12:36 AM, Curt Zirzow wrote:


I'm not sure how you mean a weak reference, and well a refcount is
rather meaning less in php userland.


So, this gets interesting. I don't know if you're familiar with the
circular-reference problem. But if you have two instances that have
references to each other, even once you remove all references to the
objects, they will not be GC'd since they have a mutual deadlock on
each other:

$a = new MyObj;
$b = new MyObj;
$a->setB($b);// does $this->b = $b;
$b->setA($a);// does $this->a = $a;

$a = NULL;
$b = NULL;

The actual instances pointed to by $a and $b WILL NOT GET FREED HERE
as you would *wish*. However this is expected behavior.


I would have to disagree with the 'as you would *wish*' part.

if I pass something to a function/method via copy (vs reference) i
would hardly expect code outside the function/method to affect
their existance.


I'll ask you to reconsider :) Let me explain...

After both $a and $b are set to null, your script NO LONGER HAS ANY  
REFERENCES TO $a OR $b! The objects are now "orphaned" as far as you  
are concerned. So if you cannot access the objects, why would you  
still want them to take up memory?


This is why I say "as you would *wish*. The fact that the objects are  
not freed here is a memory leak. Now, the party responsible for the  
memory leak is the coder, NOT PHP. PHP is doing the "right" thing  
because according to its internal GC both $a and $b still have a  
refcount of 1.


So, it is up to the developer to make sure that they code in such a  
way that the objects do not have a refcount deadlock in such a  
situation. This is the point of my entire thread; I want to confirm  
the correct way to do this in PHP.


Apple's Cocoa documentation has a good explanation of this. Read the  
sections "Retaining Objects", "Retain Cycles", and "Weak References"  
that begin here. It's just a few paragraphs. Cocoa's memory  
management and garbage collection is very similar in concept to  
PHP's, except that you must EXPLICITLY control reference counts.


[ watch for wrapped link ]
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/ 
Concepts/ObjectOwnership.html#//apple_ref/doc/uid/2043-1000698



Only by changing MyObj to store "weak references", that is references
to the objects that are NOT reference-counted, can you get the GC to
free the instances.

function setB(&$B) { $this->b = &$a; }
function setA(&$B) { $this->a = &$b; }

Now, the instances will be freed when the $a and $b are null'd out.


I think you meant to type:

  function setB(&$a) { $this->b = &$a; }
  function setA(&$b) { $this->a = &$b; }


Oops yes.


And consider the definition written as:

  function setB(&$a) { $this->b = $a; }
  function setA(&$b) { $this->a = $b; }

does the $a = null; and $b = null; outside the class cause the
objects to get null'd inside the class as well?


Well, this is different from what I wrote; you took away the &  
operator on $a and $b in the assignment. This then causes the  
refcounts to be bumped, so in the code as YOU'VE re-written it, in  
fact nulling the objects outside the class DOES NOT cause them to be  
released.


However, let's talk about the version I wrote:


  function setB(&$a) { $this->b = &$a; }
  function setA(&$b) { $this->a = &$b; }


In this case, nulling out the $a and $b that were passed in DOES in  
fact release these linked objects. But that's OK, because you don't  
have a way to access these objects anymore anyway, as described above.


Now, this example is just for explanatory purposes; typically you do  
not have two objects that mutually store weak references to each  
other. Typical, one side of the two-way link typically is the "owner"  
and has a "refcounted" reference to the other object, while the other  
side of the link has the weak reference to the other object. Normally  
the parent object retains, and the child object has a weak reference.



So, while I now feel more confident of how references act with
respect to objects (which is, they act the same as they do for any
variable), I still am not sure what "$this->this" is and why it
worked so magically.


You lost me on your $this->this statement.


Well, in reality, with a parent-child situation, you have

$a->addChildObject($b);

class A
{
   function addChildObject($b)
   {
  $this->children[] = $b;// refcount+1
  $b->setParent($this);
   }
}
class B
{
   function setParent(&$b)
   {
   $this->parent = &$b;
   }
}

However, I tried this, and it doesn't work. The $b->setParent($this)  
line still bumps the refcount. After experimenting, I realize that if  
I do $b->setParent($this->this) then it works as expected.


But what the heck is $this->this?

And this is my question, why does this work? Can I count on it? Why

[PHP] Re: array carrying from one php page to another

2005-12-08 Thread Sandy Keathley


> I have an array $journal that I want to carry from a page (where it was
> created) to another page (a popup that shows the variables contents). Is
> this automatically available? or do I have to do something special to php??

One way:
$serArray = serialize($array);



At other end:

$array = unserialize($_POST['serArray']);

==

OR

session_start();
.
.
.
$_SESSION['array'] = serialize($array);


At other end:

$array = unserialize($_SESSION['array']);

If you change or repopulate the array, use the same session name, or, to be 
safe,

$_SESSION['array'] = null;

before repopulating the session.

Make sure session_start() is on every page that needs access to the session 
variable, including the popup.


SK




WebDesigns Internet Consulting
E-commerce Solutions
Application Development

Sandy Keathley
Zend Certified Engineer
[EMAIL PROTECTED]
972-569-8464

http://www.KeathleyWebs.com/


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



RE: [PHP] broken code....

2005-12-08 Thread Mark Steudel
What happens when you print out journal?:

print_r( $journal );

Are your keys the exact case as your table fields?

ID vs id or Date vs date




-Original Message-
From: Eternity Records Webmaster [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 07, 2005 11:31 PM
To: php-general@lists.php.net
Subject: [PHP] broken code

I have this code that doesnt print the db results like they should... it
uses pear::db package for the database. Was wondering if anybody can figure
out how come it doesnt work...

getMessage()); }
$results->query('select * from eternityrecords.journal'); if
(PEAR::isError($results)) { die($db->getMessage()); } //test the results
out..
?>

fetchInto($journal, DB_FETCHMODE_ASSOC)){ ?>  
disconnect(); ?>

--
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] set quota to disable ...

2005-12-08 Thread Marc G. Fournier


Has something changed in recent versions of cyrus imapd?  I'm trying to 
code up a PHP interface, or, rather, fix one ... according to the php man 
age, I should be able to do:


imap_set_quota($mbox, 'user.'.$user, -1);

to disable it ... but if I do, it doesn't do anything ... and I can't pass 
it "none", since the function above only accepts an int value ... did 
doing:


sq user.scrappy -1

used to work from cyradm, and get changed at some point to only accept 
'none'?  and the php interface just hasn't caught up yet ... ?


thanks ...


Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664

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



Re: [PHP] broken code....

2005-12-08 Thread Ben Blay
> $results->query('select * from eternityrecords.journal');

Should this not be:
$results = $db->query('select * from eternityrecords.journal');

See:
http://pear.php.net/manual/en/package.database.db.db-result.fetchinto.php

Ben

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



Re: [PHP] Preventing Cross Site Scripting Vulnerbilities

2005-12-08 Thread Michael B Allen
On Wed, 07 Dec 2005 14:33:07 -0500
Chris Shiflett <[EMAIL PROTECTED]> wrote:

> Michael B Allen wrote:
> > Can someone recommend a general method for avoiding / eliminating XSS
> > vulnerbilities with PHP?
> 
> Yeah, escape output. It's really that simple.

Well after looking at this for a while I agree that makes the most
sense. It's a little unnerving to let scripts find their way into the
database but with in combination with strong validation that can be
minimized and in many cases eliminated.

Mike

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



Re: [PHP] Mime-type handling

2005-12-08 Thread Zack Bloom
mime types are very unreliable and should never be used for file type
authentication (they can also be faked by users).  Instead you could try
using the extension of the file or an identifying statement in the file.

On 12/8/05, Manuel Vacelet <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I'm facing a bad behaviour of 'file' command used by fileinfo PECL module
> (recommanded for mime-type checking):
> * Some Microsoft Excel documents are detected as Microsoft Word documents
> * Some HTML files are just text/plain
> * ...
>
> I tested on multiple machines (with different version of file) and I
> sometimes obtain a diffrent behaviour but never the one expected :/ I also
> looked for the latest version of file but it seems that the file used to
> detect the mime-type is out of date...
>
> My questions are:
> * If you already encounter this problem, how did you solve it ?
> * Where can I find an up-to-date version of magic number list usable with
> file for mime type checking ?
>
> Thanks,
> Regards,
> Manuel
>
>


Re: [PHP] configuring the CLI version of PHP

2005-12-08 Thread jonathan
so the web server is running 5.0.4 and the cli version is running  
4.3.11.  Is there an easy way for me to switch the cli version to the  
web version without a recomplie?


-jonathan
On Dec 6, 2005, at 1:10 AM, Marco Kaiser wrote:


Hi Jonathan,

/usr/bin/php

/usr/include/php
/usr/lib/php

How would I know which version in which?



"which php" should tell where your phpcli binary are.
php -v should tell you which php version you are running.


--
Marco Kaiser


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



RE: [PHP] broken code....

2005-12-08 Thread Mark Steudel
Good catch:

So I normally do 

$results =& $db->query ( "SELECT * FROM table" );

What is the difference between using the & and not using the &.

-Original Message-
From: Ben Blay [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 08, 2005 10:27 AM
To: php-general@lists.php.net
Subject: Re: [PHP] broken code

> $results->query('select * from eternityrecords.journal');

Should this not be:
$results = $db->query('select * from eternityrecords.journal');

See:
http://pear.php.net/manual/en/package.database.db.db-result.fetchinto.php

Ben

--
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] QUERY_STRING Variables and POST

2005-12-08 Thread Michael B Allen
I'm using the POST method but I would also like to access QUERY_STRING
parameters. Is there a convienient global array for these? If not,
what is the definitive method for accessing them?

Thanks,
Mike

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



[PHP] Re: QUERY_STRING Variables and POST

2005-12-08 Thread Roman Ivanov

Michael B Allen wrote:

I'm using the POST method but I would also like to access QUERY_STRING
parameters. Is there a convienient global array for these? If not,
what is the definitive method for accessing them?


$_GET
$_REQUEST
+
read manual

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



Re: [PHP] Re: QUERY_STRING Variables and POST

2005-12-08 Thread Michael B Allen
On Thu, 08 Dec 2005 17:56:14 -0500
Roman Ivanov <[EMAIL PROTECTED]> wrote:

> Michael B Allen wrote:
> > I'm using the POST method but I would also like to access QUERY_STRING
> > parameters. Is there a convienient global array for these? If not,
> > what is the definitive method for accessing them?
> 
> $_GET
> $_REQUEST
> +
> read manual

Using the POST method and a URL like:

  http://server.com/foo.php?name=value

I get:

  $_SERVER['QUERY_STRING']  // empty string
  $_GET['name'] // not defined
  $_SERVER['PHP_SELF']  // no ?name=value
  $_REQUEST['QUERY_STRING'] // empty string

Any ideas?

Thanks,
Mike

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



[PHP] href difference between OS's.

2005-12-08 Thread Marlin Unruh
I have written a PHP script that creates dynamic links to CAD files on a 
local machine. The anchors/links work on two W2K pro machines, but does 
nothing on a XP pro machine where I really need the script to reside. I 
am stumped if it is an Apache setting, IE setting, or what. I'm getting 
desperate to get this going and get on with life (real work).


On the w2k machines while the pointer is over the link, the browser 
status bar shows "file:///actual_path_to_file". On the XP machine the 
status bar shows "Shortcut to file:///absolute_path_to_file(local)".


I have never got the links to work with Firefox (preferred browser) on 
the w2k machines, but I'm sure it security issues. Probably the thing 
with the XP machine.


--

Regards,
 Marlin Unruh
 Sunco Systems Inc.
 (308) 326-4400

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



Re: [PHP] Re: QUERY_STRING Variables and POST

2005-12-08 Thread Zack Bloom
use $_REQUEST['name'] to get value

On 12/8/05, Michael B Allen <[EMAIL PROTECTED]> wrote:
>
> On Thu, 08 Dec 2005 17:56:14 -0500
> Roman Ivanov <[EMAIL PROTECTED]> wrote:
>
> > Michael B Allen wrote:
> > > I'm using the POST method but I would also like to access QUERY_STRING
> > > parameters. Is there a convienient global array for these? If not,
> > > what is the definitive method for accessing them?
> >
> > $_GET
> > $_REQUEST
> > +
> > read manual
>
> Using the POST method and a URL like:
>
> http://server.com/foo.php?name=value
>
> I get:
>
> $_SERVER['QUERY_STRING']  // empty string
> $_GET['name'] // not defined
> $_SERVER['PHP_SELF']  // no ?name=value
> $_REQUEST['QUERY_STRING'] // empty string
>
> Any ideas?
>
> Thanks,
> Mike
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] QUERY_STRING Variables and POST

2005-12-08 Thread Chris Shiflett

Michael B Allen wrote:

I'm using the POST method but I would also like to access
QUERY_STRING parameters. Is there a convienient global array
for these?


Yeah, $_GET. I know it seems a bit confusing, since the request method 
is POST, not GET, but it's a reference to how data is passed when the 
GET method is indicated in a form's method attribute.


Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

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



Re: [PHP] QUERY_STRING Variables and POST

2005-12-08 Thread Michael Hulse

On Dec 8, 2005, at 2:46 PM, Michael B Allen wrote:

I'm using the POST method but I would also like to access QUERY_STRING
parameters. Is there a convienient global array for these? If not,
what is the definitive method for accessing them?


Not sure if this script will help, but you can point your form to it 
and get back some useful info:


 0) {
echo 'Post '.count($_REQUEST)."Variables\n";
while (list ($key, $val) = each ($_REQUEST)) {
$$key = $val;
if(is_array($$key)) {
			for($a=0;$a\"".$val[$a]."\"\n";

} else { print "$key = \"$val\"\n"; }
}
}
?>

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



Re: [PHP] Re: QUERY_STRING Variables and POST

2005-12-08 Thread Michael B Allen
Solved. My mistake. I was visiting the form with a URL that had
QUERY_STRING parameters but when I submit the form the QUERY_STRING is
not propagated.

In my particular case I replaced the form tag with the following PHP:

";
?>

Also, regarding my original question, I think parse_str is what I want.

Thanks,
Mike

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



[PHP] Curl Content-Encoding header?

2005-12-08 Thread Kenneth Andresen

Hello all,

I have been trying to get the Content-Encoding header from Curl, but 
have yet to manage.


Using curl from command line I have no problems simply using:
curl --compress page_to_get -o local_page_copy -D dumpheader.txt

The data gets compressed and uncompressed also in PHP, I am just looking 
for a way to capture whether the compression was used or not, and in 
case it was used, what Content-Encoding was used.


I would be happy for a tip to simply get the full response header too ;)

In advance thanks!

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



Re: [PHP] What software do you use for writing PHP?

2005-12-08 Thread Zack Bloom
Notepad++ is inherently better then notepad (and textpad) and free.





I wish I had the punch card version.  I have to rewire my php box everytime
I want to change something.


 On 12/8/05, David Robley <[EMAIL PROTECTED]> wrote:

> John Nichel wrote:
>
> > Miles Thompson wrote:
> >> At 11:45 AM 12/7/2005, Jay Blanchard wrote:
> >>
> >>> [snip]
> >>> > Two words  punch cards. 'Nuff said.
> >>> >
> >>>
> >>> Come on now Jay, we know you're old and all, but everyone knows that
> you
> >>> cannot edit php with punch cards.  Hanging chads will cause too many
> >>> fatal errors.  ;)
> >>> [/snip]
> >>>
> >>>
> >>> ROFLMMFAO
> >>
> >>
> >> Why these clumsy interfaces?
> >>
> >> Just plug the Firewire in your ear!
> >
> > n00b
> >
> > ;)
> >
>
> Punch cards? Looxury. Toggle switches on the front of the computer
>
>
>
> Cheers
> --
> David Robley
>
> Circular Definition: see Definition, Circular.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> Jim Moseby wrote:
>
> >>
> >> Curt Zirzow wrote:
> >> > On Tue, Dec 06, 2005 at 06:36:33PM +0100, M. Sokolewicz wrote:
> >> >
> >> >>Jason Petersen wrote:
> >> >>
> >> >>>On 12/6/05, Jeff McKeon <[EMAIL PROTECTED]> wrote:
> >> >>>
> >> >>>
> >> Hey all,
> >> 
> >> Forever now I've been using Frontpage for all my web work
> >> including php.
> >> I'm sure there's better software out there that is more suited to
> >> writing and editing PHP pages.  What do you all use?
> >> 
> >> >>>
> >> >>>
> >> >>>Vim is my editor of preference.  If I have to use Windows,
> >> I usually go
> >> >>>with
> >> >>>Homesite (because I already have a licensed copy) or
> >> Textpad (because it's
> >> >>>better than Notepad).
> >> >>>
> >> >>>IDEs?  Who needs 'em ;)
> >> >>>
> >> >>>Best,
> >> >>>Jason
> >> >>>
> >> >>
> >> >>same here :)
> >> >>Vim on UNIX machines, and Textpad on Windows
> >> >
> >> >
> >> > man you guys are wimps.. gvim on windows... :)
> >>
> >> Pt'Edit' in DOS.  ;)
> >>
> >
> > (Pt * 2)  'edlin' in DOS.  :P
>
> (Pt * 3) SPF on IBM mainframe
>
>
> Cheers
> --
> David Robley
>
> You have two choices for dinner: Take it or Leave it.
>
> --
> PHP General Mailing List (http://www.php.net/ )
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] What software do you use for writing PHP?

2005-12-08 Thread shining
Eclipse+PHPEclipse

2005/12/9, Zack Bloom <[EMAIL PROTECTED]>:
>
> Notepad++ is inherently better then notepad (and textpad) and free.
>
>
>
>
>
> I wish I had the punch card version.  I have to rewire my php box
> everytime
> I want to change something.
>
>
> On 12/8/05, David Robley <[EMAIL PROTECTED]> wrote:
>
> > John Nichel wrote:
> >
> > > Miles Thompson wrote:
> > >> At 11:45 AM 12/7/2005, Jay Blanchard wrote:
> > >>
> > >>> [snip]
> > >>> > Two words  punch cards. 'Nuff said.
> > >>> >
> > >>>
> > >>> Come on now Jay, we know you're old and all, but everyone knows that
> > you
> > >>> cannot edit php with punch cards.  Hanging chads will cause too many
> > >>> fatal errors.  ;)
> > >>> [/snip]
> > >>>
> > >>>
> > >>> ROFLMMFAO
> > >>
> > >>
> > >> Why these clumsy interfaces?
> > >>
> > >> Just plug the Firewire in your ear!
> > >
> > > n00b
> > >
> > > ;)
> > >
> >
> > Punch cards? Looxury. Toggle switches on the front of the computer
> >
> >
> >
> > Cheers
> > --
> > David Robley
> >
> > Circular Definition: see Definition, Circular.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > Jim Moseby wrote:
> >
> > >>
> > >> Curt Zirzow wrote:
> > >> > On Tue, Dec 06, 2005 at 06:36:33PM +0100, M. Sokolewicz wrote:
> > >> >
> > >> >>Jason Petersen wrote:
> > >> >>
> > >> >>>On 12/6/05, Jeff McKeon <[EMAIL PROTECTED]> wrote:
> > >> >>>
> > >> >>>
> > >> Hey all,
> > >> 
> > >> Forever now I've been using Frontpage for all my web work
> > >> including php.
> > >> I'm sure there's better software out there that is more suited to
> > >> writing and editing PHP pages.  What do you all use?
> > >> 
> > >> >>>
> > >> >>>
> > >> >>>Vim is my editor of preference.  If I have to use Windows,
> > >> I usually go
> > >> >>>with
> > >> >>>Homesite (because I already have a licensed copy) or
> > >> Textpad (because it's
> > >> >>>better than Notepad).
> > >> >>>
> > >> >>>IDEs?  Who needs 'em ;)
> > >> >>>
> > >> >>>Best,
> > >> >>>Jason
> > >> >>>
> > >> >>
> > >> >>same here :)
> > >> >>Vim on UNIX machines, and Textpad on Windows
> > >> >
> > >> >
> > >> > man you guys are wimps.. gvim on windows... :)
> > >>
> > >> Pt'Edit' in DOS.  ;)
> > >>
> > >
> > > (Pt * 2)  'edlin' in DOS.  :P
> >
> > (Pt * 3) SPF on IBM mainframe
> >
> >
> > Cheers
> > --
> > David Robley
> >
> > You have two choices for dinner: Take it or Leave it.
> >
> > --
> > PHP General Mailing List (http://www.php.net/ )
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>


Re: [PHP] Call to undefined function mysql_real_escape_string()]

2005-12-08 Thread Curt Zirzow
On Thu, Dec 08, 2005 at 08:32:56AM -0500, Paul Hickey wrote:
> I have PHP compiled with mysqli.
> 
> The standard answer from the Joomla forums is that I need to have
> "mysql" vice "mysqli". I was looking for a more global solution than
> having to modify the code for every component, module, mambot I want to
> use.

Well there is a rather global solution, but will require some work.
You would have to create a wrapper for all mysql* calls to use
mysqli, so for example:




I've been meaning to write something like this for the
Pear::PHP_Compat tool, it could help upgrading all your scripts to
mysqli interface, not to mention upgrading to php5.1


Curt.
-- 
cat .signature: No such file or directory

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



[PHP] pear/Horde_Block can optionally use PHP extension "gettext" ...

2005-12-08 Thread Marc G. Fournier


'k, I searched google, and the only thing I could find was a response from 
someone telling someone else who asked to search the archives, the answer 
is there ...


well, I searched both the php-general and pear-general archives, and I'm 
not finding any threads that talk about this :(


gettext is installed ... php is php5 ... how do I get it to recognize, and 
therefore silence, these warnings ... ? :(


Still searching, but if someone can point me to even the thread itself 
that is being eluded to, that would be great :(


Thanks ...


Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664

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



[PHP] paid help wanted for session management

2005-12-08 Thread sunaram patir
hi guys,
anyone will like to help me out from some problem in dealing with
sessions in internet explorer for some $10-$30? please send me private
mail. no reply to this mailing list please. and sorry guys for sending
this mail on the list. i couldn't help myself! i am damn frustrated!
 regards,
sunaram

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



Re: [PHP] Mime-type handling

2005-12-08 Thread Curt Zirzow
On Thu, Dec 08, 2005 at 02:41:43PM -0500, Zack Bloom wrote:
> mime types are very unreliable and should never be used for file type
> authentication (they can also be faked by users).  Instead you could try
> using the extension of the file or an identifying statement in the file.

He isn't using the mime-type, the fileinfo module detects the
content type based on a magic file that defines, as you said, a
paticular statment in the file and returns the mime-type associated
with the magic.

Assuming you ment the mime/type sent via a file upload, trying to
detect the file type by the extension is just as unreliable.

Even identifying contents of the file is not as reliable as one
would think; it can also be spoofed.  For example with jpeg, there
are several tools out there that will take a file, wrap  a jpeg
image around the file  and embed the real contents inside of the
file, and if your app just detects the magic contents, it will pass
the test.

The only way to ensure a file is what it really is to open and
resave it with a trusted application. Using the jpeg example you
would need to do something like:

  djpeg $file | cjpeg > testfile.jpg

Well, with jpeg, the files will always be differnt but a fuzzy match
based on filesize closeness and/or similar bit distribution.


> On 12/8/05, Manuel Vacelet <[EMAIL PROTECTED]> wrote:
> >
> > Hi all,
> >
> > I'm facing a bad behaviour of 'file' command used by fileinfo PECL module
> > (recommanded for mime-type checking):
> > * Some Microsoft Excel documents are detected as Microsoft Word documents
> > * Some HTML files are just text/plain
> > * ...
> >

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] Mime-type handling

2005-12-08 Thread Curt Zirzow
On Thu, Dec 08, 2005 at 12:31:52PM +0100, Manuel Vacelet wrote:
> Hi all,
> 
> I'm facing a bad behaviour of 'file' command used by fileinfo PECL module
> (recommanded for mime-type checking):
> * Some Microsoft Excel documents are detected as Microsoft Word documents
> * Some HTML files are just text/plain
> * ...
> 
> I tested on multiple machines (with different version of file) and I
> sometimes obtain a diffrent behaviour but never the one expected :/ I also
> looked for the latest version of file but it seems that the file used to
> detect the mime-type is out of date...

I'm not familiar to how fileinfo detects the contents, is the file
it is using a file like:

  /usr/share/misc/magic

> ...
> * Where can I find an up-to-date version of magic number list usable with
> file for mime type checking ?

If the above is true, a updated version should be availble for the
OS you are using.

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] Does the extension php_printer.dll work with php version 5.1.1 on a XP System

2005-12-08 Thread Curt Zirzow
On Wed, Dec 07, 2005 at 04:27:49PM -0800, james crooks wrote:
> I trying to get php_printer.dll extension to work on a xp system . I
> downloaded correct version of php_printer.dll to match php version 5.1.1 .
> The extension_dir is set correctly , because other extensions load and work
> perfectly.

You can't rely that because other extensions work that you are
actually puting the file in the correct place. create a page with:
  phpinfo();

and check the directories that php is expecting things in.

Curt.
-- 
cat .signature: No such file or directory

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