[PHP] URL-funtion - returnvalue into variable...?

2005-01-12 Thread Wiberg
Hi there!

I'm a total newbie at connecting to diffrent servers, and b2b and such stuff
, so I guess this is a simple question for you guys...

Another company wants me to access their productinfo thorugh URL, something
like this:
https://www.anothercompany.com/returnValueOfProductID=1043

If I access this site, the value of product that has ID 1043 will be
returned.
How do I get this returnvalue into a variable?

/G
@varupiraten.se



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 2005-01-10

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



Re: [PHP] libphp4.so not created on upgrade

2005-01-12 Thread Rasmus Lerdorf
heath boutwell wrote:
--- Rasmus Lerdorf [EMAIL PROTECTED] wrote:
Well, what is created?  Do you get a .libs/libphp4 file with no 
extension?  If so, you can either just rename that to .libs/libphp4.so 
or run libtoolize --force and re-run ./configure

-Rasmus

Still no libphp4.so created by make install.
Here is results from libtoolize --force
Using `AC_PROG_RANLIB' is rendered obsolete by `AM_PROG_LIBTOOL'
You should add the contents of `/usr/share/aclocal/libtool.m4' to `aclocal.m4'.
Here are the files created by make install:
Installing PHP SAPI module:   cgi
Installing PHP CGI into: /usr/bin/
Installing shared extensions: /usr/lib/php4/extensions/no-debug-non-zts-20020429/
Installing PEAR environment:  /usr/lib/php4/php/
[PEAR] Archive_Tar- already installed: 1.2
[PEAR] Console_Getopt - already installed: 1.2
[PEAR] PEAR   - already installed: 1.3.2
Wrote PEAR system config file at: /usr/etc/pear.conf
You may want to add: /usr/lib/php4/php to your php.ini include_path
[PEAR] DB - already installed: 1.6.8
[PEAR] HTTP   - already installed: 1.3.3
[PEAR] Mail   - already installed: 1.1.4
[PEAR] Net_SMTP   - already installed: 1.2.6
[PEAR] Net_Socket - already installed: 1.0.2
[PEAR] XML_Parser - already installed: 1.2.1
[PEAR] XML_RPC- already installed: 1.1.0
Installing build environment: /usr/lib/php/build/
Installing header files:  /usr/include/php/
Installing helper programs:   /usr/bin/
  program: phpize
  program: php-config
  program: phpextdist
  
  
I get no errors in the make/make test/make install stages.  Why isn't libphp4.so created?  It also
seems bizarre that I am the only person that has encountered this.
Because you built the CGI version as it says.  You need to use the 
--with-apxs configure switch to build the Apache SAPI.

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


Re: [PHP] URL-funtion - returnvalue into variable...?

2005-01-12 Thread Zouari Fourat
u can try fopen


On Wed, 12 Jan 2005 09:40:26 +0100, Wiberg [EMAIL PROTECTED] wrote:
 Hi there!
 
 I'm a total newbie at connecting to diffrent servers, and b2b and such stuff
 , so I guess this is a simple question for you guys...
 
 Another company wants me to access their productinfo thorugh URL, something
 like this:
 https://www.anothercompany.com/returnValueOfProductID=1043
 
 If I access this site, the value of product that has ID 1043 will be
 returned.
 How do I get this returnvalue into a variable?
 
 /G
 @varupiraten.se
 
 --
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 2005-01-10
 
 --
 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] Get name of extending class with static method call

2005-01-12 Thread Torsten Roehr
 I'm not sure if this will work, but hey, you could give it a try.

 class Car
 {
public static $className = __CLASS__;

public static function drive ()
{
  return self::$className;
}
 }

 class Porsche extends Car
 {
public static $className = __CLASS__;
 }

 Porche::drive(); // Should return Porche

Hi Daniel,

thanks for the idea but it causes an error:
Fatal error: Cannot redeclare property static public Car::$className in
class Porsche

If I ommit the definition of $className in Car I get this error:
Fatal error: Access to undeclared static property: Car::$className

If I ommit the definition of $className in Porsche the return value is 'Car'
not 'Porsche'. Arrrgh!

Will keep on trying.

Best regards, Torsten

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



[PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Torsten Roehr
Jason Barnett [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 The only other solution that comes to mind is a little messy but it lets
 you get away with no object.  Instead of calling the method statically
 you can use call_user_func_array() with the child class name as a
 parameter.  Then change the parent method to accept the child class name
 as a parameter.

 ?php

 function call_static_child() {
$drive_args = func_get_args();
/** assume that first parameter is child of class Car */
return call_user_func_array(array($drive_args[0], 'drive'),
$drive_args);
 }

 ?

Hi Jason,

thanks for taking a look but there *must* be a way to achieve this without
passing any parameters around. Otherwise I could just do:

Porsche::drive('Porsche');

Best regards, Torsten

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



Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Torsten Roehr
 Torsten, I also found the following link to be helpful.  Check out the
 user notes from michael at digitalgnosis dot removethis dot com (he did
 something similar to what I have already suggested, i.e. call_user_func)

 http://www.php.net/manual/en/language.oop5.static.php

Hi Jason,

thanks for the link. It helped me to find out that this does work:

class Car {
function drive() {
echo 'pre';print_r(debug_backtrace());
}
}

class Porsche extends Car {
function drive() {
parent::drive();
}
}

By tunnelling the call through Porsche's own drive() method
debug_backtrace() will contain two traces, one of them with the correct
class name.

I tried using reflection but reflecting car by using __CLASS__ doesn't
give any information about the classes that extend it. So this doesn't work
either.

Rory's proposed way of reading in the file contents and preg_matching the
method name works, but it's very, very ugly, indeed! ;)

Isn't it somewhat ridiculous that there is no *easy* way in PHP5 to achieve
what I consider to be a pretty straightforward requirement?:

Get name of the class that invoked a static call of an inherited method

I would like to thank all of those that cared about my problem and tried to
find a solution by providing a wide variety of ideas. Thank you very much!!!


Do you think it would be wise to ask for help on php-dev?


Best regards, Torsten

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



[PHP] Offline working

2005-01-12 Thread Lester Caine
Because of the problems working with the email version of the php lists, 
I'm forced to use the newgroup interface.
Up until recently I could happily get up in the morning and 'Download 
Now' in Mozilla so I can scan messages quickly locally.
Since xmas the 'Download Now' simply gets the first message and then 
times out. It's working fine on Eclipse and Borland so it's not my end, 
but now the only way to get the messages is one at a time.

Is this something that has been changed at www.php.net? Can anything be 
done about it? Why should offline working be such a problem?

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] php dot net auto complete search engine

2005-01-12 Thread Zouari Fourat
Hello
last days i've seen on php dot net site that the search engine has
impleted a new autocomplete option that was disabled soon.
anyone know why did they disable it ? is there any disadvantage with that ?
i'm interested in the autocomplete option with inputs, i used it with
pear : HTML_QuickForm but wasnt enough good like what i saw on php.net
and what u can see on http://www.google.com/webhp?complete=1
anyone know how to do that ? wich technologie is used over it ?

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



[PHP] Data Enryption

2005-01-12 Thread Shaun
Hi,

I have site that allows users to upload private information to our server. 
We would like to encrypt the data for security reasons and only allow 
certain users to be able to un-encrypt the data and view it. I have looked 
at the PHP encryption functions and they appear to be one way algorithms - I 
am guessing this is the whole point of encrption ;)

Does anyone have any suggestions regarding this?

Many thanks

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



Re: [PHP] php dot net auto complete search engine

2005-01-12 Thread Jochem Maas
Zouari Fourat wrote:
Hello
last days i've seen on php dot net site that the search engine has
impleted a new autocomplete option that was disabled soon.
anyone know why did they disable it ? is there any disadvantage with that ?
AFAIK it was a major resource hit.
The complete source of the php.net site is available; and you can view 
the CVS history via a web iterface:

http://cvs.php.net/phpweb/
I would suggest searching that for the code.

i'm interested in the autocomplete option with inputs, i used it with
pear : HTML_QuickForm but wasnt enough good like what i saw on php.net
and what u can see on http://www.google.com/webhp?complete=1
anyone know how to do that ? wich technologie is used over it ?
javascript.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Data Enryption

2005-01-12 Thread Dirk Kredler
Am Mittwoch, 12. Januar 2005 11:13 schrieb Shaun:
 Hi,

 I have site that allows users to upload private information to our server.
 We would like to encrypt the data for security reasons and only allow
 certain users to be able to un-encrypt the data and view it. I have looked
 at the PHP encryption functions and they appear to be one way algorithms -
 I am guessing this is the whole point of encrption ;)

 Does anyone have any suggestions regarding this?

 Many thanks

hey :)

you should use the mcrypt_* functions. Look at the manual pages,
you will find there many examples.

Here are some functions i use for encryption of private data, 
may they help you:

/**
  * mcrypt iv generieren
  */
  if(!isset($_SESSION['MCRYPT_IV'])) {

$_SESSION['MCRYPT_IV']=  
mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CBC), 
MCRYPT_DEV_URANDOM);

  } 
  
  /**
   * Encryption
   * 
   * @param String input - unencrypted string
   * @return String encrypted string
   */
  function encrypt($input) {

$encrypted= mcrypt_encrypt(MCRYPT_BLOWFISH, SECRET, $input, 
MCRYPT_MODE_CBC, $_SESSION['MCRYPT_IV']);
$encoded= base64_encode($encrypted);

return
  $encoded;
  }
  
  /**
   * Decryption
   *
   * @param String input - encrypted string
   * @return String - decrypted string
   */
  function decrypt($input) {

$decoded= base64_decode($input);
$decrypted= mcrypt_decrypt(MCRYPT_BLOWFISH, SECRET, $decoded, 
MCRYPT_MODE_CBC, $_SESSION['MCRYPT_IV']); 

return
  rtrim($decrypted);
  }

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



Re[2]: [PHP] php dot net auto complete search engine

2005-01-12 Thread Richard Davey
Hello Jochem,

Wednesday, January 12, 2005, 10:22:26 AM, you wrote:

 last days i've seen on php dot net site that the search engine has
 impleted a new autocomplete option that was disabled soon.
 anyone know why did they disable it ? is there any disadvantage with that ?

JM AFAIK it was a major resource hit.

Yeah that and it redirected Firefox users to blank pages even if they
didn't use it (glad to see it removed for now).

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] php dot net auto complete search engine

2005-01-12 Thread Zouari Fourat
if it was js, where's the code ? i didnt find it in the source of
google.com and i havent notated any frame/iframe


On Wed, 12 Jan 2005 11:22:26 +0100, Jochem Maas [EMAIL PROTECTED] wrote:
 Zouari Fourat wrote:
  Hello
  last days i've seen on php dot net site that the search engine has
  impleted a new autocomplete option that was disabled soon.
  anyone know why did they disable it ? is there any disadvantage with that ?
 
 AFAIK it was a major resource hit.
 The complete source of the php.net site is available; and you can view
 the CVS history via a web iterface:
 
 http://cvs.php.net/phpweb/
 
 I would suggest searching that for the code.
 
 
  i'm interested in the autocomplete option with inputs, i used it with
  pear : HTML_QuickForm but wasnt enough good like what i saw on php.net
  and what u can see on http://www.google.com/webhp?complete=1
  anyone know how to do that ? wich technologie is used over it ?
 
 
 javascript.
 


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



Re: [PHP] Error loading extension dlls in WindosXP for PHP4.3.10

2005-01-12 Thread James Lobley
 Well Richard, I could able to solve it by copying all
 dlls into Windows\System32 directory. But still not
 sure why I need to copy all dlls into system32
 directory though I have mentioned in php.ini file that
 extension_directory=c:\PHP4\extensions.
 
 regards,
 Ranjan
 
Hi Ranjan,

You might find this page useful:
http://uk.php.net/install.windows.extensions

I found I needed to add the path C:\PHP\dlls to the XP System variable
'Path' as a lot of extensions have dependencies on dlls found in this
directory.
(in XP: Control Panel / System / Advanced / Environment Variables)
Don't forget to seperate what you add in from the existing paths with a ;

Best Wishes,

James

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



RE: [PHP] weird upload problem

2005-01-12 Thread Ford, Mike
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



 -Original Message-
 From: Sebastian [mailto:[EMAIL PROTECTED] 
 Sent: 12 January 2005 01:59
 

 form action=/ enctype=multipart/form-data method=post
 1: input type=file name=image[]br /
 2: input type=file name=image[]br /
 3: input type=file name=image[]br /
 4: input type=file name=image[]br /
 5: input type=file name=image[]br /
 6: input type=file name=image[]br /
 input name=submit type=submit value=submit
 /form
 
 
 if (isset($_FILES['image']))
 {
  $number = 0;
 for ($i = 0; $i  count($_FILES['image']); $i++)

  foreach ($FILES['image'] as $i=$imagefile)

Solves both problems.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services, JG125, James
Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS,
LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

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



Re[2]: [PHP] php dot net auto complete search engine

2005-01-12 Thread Richard Davey
Hello Zouari,

Wednesday, January 12, 2005, 10:55:45 AM, you wrote:

ZF if it was js, where's the code ? i didnt find it in the source of
ZF google.com and i havent notated any frame/iframe

It's JS (what else could it be?!) - more info here:
http://uk2.php.net/search.php

For Google it's on their Suggest lab site:

http://www.google.com/webhp?complete=1hl=en

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] php dot net auto complete search engine

2005-01-12 Thread Jochem Maas
Zouari Fourat wrote:
if it was js, where's the code ? i didnt find it in the source of
google.com and i havent notated any frame/iframe
your not looking very hard:
first off you need to look in the source of the actual page which you 
pointed the list to (thanks for that btw, I had not seen this new beta 
widget of googles before!).

somewhere in the source is the following:
SCRIPT src=/ac.js/SCRIPT
SCRIPTInstallAC(document.f,document.f.q,document.f.btnG,search,en);/SCRIPT
I haven't checked it - but I'm willing to bet that ac.js contains the 
relevant magic

AFAIKS they have 2 other scripts on that page, but they don't seem to be 
directly involved:
script
!--
function sf(){document.f.q.focus();}
// --
/script

and
script!--
function qs(el) {if (window.RegExp  window.encodeURIComponent) {var 
qe=encodeURIComponent(document.f.q.value);if (el.href.indexOf(q=)!=-1) 
{el.href=el.href.replace(new RegExp(q=[^$]*),q=+qe);} else 
{el.href+=q=+qe;}}return 1;}
// --
/script

have fun working out exactly what they do :-)
On Wed, 12 Jan 2005 11:22:26 +0100, Jochem Maas [EMAIL PROTECTED] wrote:
Zouari Fourat wrote:
Hello
last days i've seen on php dot net site that the search engine has
impleted a new autocomplete option that was disabled soon.
anyone know why did they disable it ? is there any disadvantage with that ?
AFAIK it was a major resource hit.
The complete source of the php.net site is available; and you can view
the CVS history via a web iterface:
http://cvs.php.net/phpweb/
I would suggest searching that for the code.

i'm interested in the autocomplete option with inputs, i used it with
pear : HTML_QuickForm but wasnt enough good like what i saw on php.net
and what u can see on http://www.google.com/webhp?complete=1
anyone know how to do that ? wich technologie is used over it ?
javascript.


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


Re: [PHP] php dot net auto complete search engine

2005-01-12 Thread Jochem Maas
Richard Davey wrote:
...
It's JS (what else could it be?!) - more info here:
what else? spontaneous self-realising tele-kinetic voodoo. :-D
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] array walk and class member functions

2005-01-12 Thread Tom
Hi
I'm batting my head against a wall on this one...
I have a class that has a constructor which sets some initial 
conditions, and then a public function that does some work. I want to be 
able to call this function from an external array_walk call, but when I 
try and reference it as $myClass-myFunction in the array_walk call, I 
get an error back saying that this is an invalid function.

eg)
?php
   include ../includes/aClass.class;
   $myArray = array(item1=firstItem, item2=secondItem);
   $myClass = new aClass;
   array_walk($myArray,'$myClass-aMemberFunction');
?
As a workaround, I redifined the class so that there was a public 
function which made the array_walk call with the worker function defined 
internally as follows, but this throws another issue in that if I create 
multiple instances of the class then I get an error to say that the 
internal function is already defined ...

*Fatal error*: Cannot redeclare aFunction() (previously declared in 
/usr/local/apache2/htdocs/includes/functions.php:23) in 
*/usr/local/apache2/htdocs/includes/functions.php* on line *23*
class aClass
{
some other stuff, constructor etc
   public function aPublicFunction($anArray)
   {
  global $aRetrunString;
 
  function aFunction($value, $key)
  {
   global $aReturnString;
   $aReturnString = $aReturnString.$value; 
  }

  array_walk($anArray,'aFunction');
  return $aReturnString;
   }
}
  
Can anyone help me to get either solution to a working state?

By the way...
apache 2.0.49
php-5.0.2
Thanks very much
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Apache 2.0 and Sessions

2005-01-12 Thread Jason Barnett
Warning: session_start():
open(C:\WINDOWS\TEMP\\sess_8c53cb2382f75076c51ed4b3edece36b, O_RDWR)
Search the archives... seriously... guaranteed you will find the answer 
to this.

--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://www.php.net/manual/en/index.php
php-general archives: http://marc.theaimsgroup.com/?l=php-generalw=2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Generic question : migrating from java based RPC server to PHP

2005-01-12 Thread Ranjan K. Baisak
This might be a very generic question.
I am in a process of migrating my java based RPC
server to PHP. Luckily with the help of the list I
could able to make sure that all rpc and xml related
function are getting excuted in Apache server. I am
using Apache2 in WInXP.
But still not sure from where I should start my
changes.
Any link or tutorial or case study regarding PHP's
SOAP and RPC service would help a lot.

regards,
Ranjan



__ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 

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



Re: [PHP] array walk and class member functions

2005-01-12 Thread Jochem Maas
Tom wrote:
Hi
I'm batting my head against a wall on this one...
I have a class that has a constructor which sets some initial 
conditions, and then a public function that does some work. I want to be 
able to call this function from an external array_walk call, but when I 
try and reference it as $myClass-myFunction in the array_walk call, I 
get an error back saying that this is an invalid function.

eg)
?php
   include ../includes/aClass.class;
   $myArray = array(item1=firstItem, item2=secondItem);
   $myClass = new aClass;
   array_walk($myArray,'$myClass-aMemberFunction');
try changing this line to:
array_walk($myArray, array($myClass,'aMemberFunction'));
or if you prefer to take the route of your second attempt read on...
?
As a workaround, I redifined the class so that there was a public 
function which made the array_walk call with the worker function defined 
internally as follows, but this throws another issue in that if I create 
multiple instances of the class then I get an error to say that the 
internal function is already defined ...
which is correct, you are trying to create this function multiple times.

*Fatal error*: Cannot redeclare aFunction() (previously declared in 
/usr/local/apache2/htdocs/includes/functions.php:23) in 
*/usr/local/apache2/htdocs/includes/functions.php* on line *23*

class aClass
{
some other stuff, constructor etc
   public function aPublicFunction($anArray)
   {
  global $aRetrunString;
   function aFunction($value, $key)
  {
   global $aReturnString;
   $aReturnString = $aReturnString.$value;   }
  array_walk($anArray,'aFunction');
  return $aReturnString;
   }
wrap the function def. like so:
if (!function_exists('aFunction')) {
function aFunction($value, $key)
{
global $aReturnString;  
$aReturnString = $aReturnString.$value;
}
}
OR define the function outside of the class e.g.
function aFunction($value, $key)
{
global $aReturnString;  
$aReturnString = $aReturnString.$value;
}
BTW: using a global in the way you do in this function is a bad idea.
array_walk() is defined as follows:
bool array_walk ( array array, callback funcname [, mixed userdata])
check out the manual for info on the last arg:
http://nl2.php.net/array_walk
}
  Can anyone help me to get either solution to a working state?
By the way...
apache 2.0.49
php-5.0.2
Thanks very much
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Jason Barnett
By tunnelling the call through Porsche's own drive() method
debug_backtrace() will contain two traces, one of them with the correct
class name.
I tried using reflection but reflecting car by using __CLASS__ doesn't
give any information about the classes that extend it. So this doesn't work
either.
Right... the root issue here seems to be that everything is relying on 
the __CLASS__ macro, but this macro behaves differently than what you 
expected (a la debug_backtrace in PHP4)

Rory's proposed way of reading in the file contents and preg_matching the
method name works, but it's very, very ugly, indeed! ;)
Isn't it somewhat ridiculous that there is no *easy* way in PHP5 to achieve
what I consider to be a pretty straightforward requirement?:
Get name of the class that invoked a static call of an inherited method
Indeed!  I was actually quite surprised that this wasn't the way 
__CLASS__ resolved... I had to code it to believe it (and I didn't even 
do that until after you told us __CLASS__ didn't work!)

I would like to thank all of those that cared about my problem and tried to
find a solution by providing a wide variety of ideas. Thank you very much!!!
Do you think it would be wise to ask for help on php-dev?
Perhaps the way to go about this would be to make a feature request on 
bugs.php.net?  It does seem like something that should be a part of the 
language.

--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://www.php.net/manual/en/index.php
php-general archives: http://marc.theaimsgroup.com/?l=php-generalw=2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] BEGINNERS READ THIS MAIL!!! was: Re: [PHP] Re: Apache 2.0 and Sessions

2005-01-12 Thread Jochem Maas
Dear Beginners,
Jason Barnett has a couple links in his sig that every beginner should 
read for their benefit as well as ours(mine ;-):

Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://www.php.net/manual/en/index.php
php-general archives: http://marc.theaimsgroup.com/?l=php-generalw=2
(nice one Jason!)
Jason Barnett wrote:
Warning: session_start():
open(C:\WINDOWS\TEMP\\sess_8c53cb2382f75076c51ed4b3edece36b, O_RDWR)

Search the archives... seriously... guaranteed you will find the answer 
to this.
always a good idea to search the archives, not always easy but if you do 
and mention that when you end up posting a question (because you can't 
find an answer or still don't get it) you will probably get a tad more 
respect and that increases the chances of a useful reply!

happy coding!

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


Re: [PHP] Generic question : migrating from java based RPC server to PHP

2005-01-12 Thread Jochem Maas
Ranjan K. Baisak wrote:
This might be a very generic question.
generic questions suck - noone here is psychic! :-)
(in reference to a Comment made by Martin Norland on 
php-db@lists.php.net - which still cracks me up everytime I think about 
it: http://www.phpbuilder.com/lists/php-db/2004122/0073.php)

I am in a process of migrating my java based RPC
server to PHP. Luckily with the help of the list I
could able to make sure that all rpc and xml related
function are getting excuted in Apache server. I am
using Apache2 in WInXP.
But still not sure from where I should start my
changes.
Any link or tutorial or case study regarding PHP's
SOAP and RPC service would help a lot.
8 pages on PHP+SOAP:
http://www.devshed.com/c/a/Zend/PHP-SOAP-Extension/
which I found by typing 3 words into google:
PHP
RPC
SOAP
I'll even save you the typing:
http://www.google.nl/search?q=PHP+RPC+SOAP
regards,
Ranjan
		
__ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 

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


[PHP] Re: array walk and class member functions

2005-01-12 Thread Jason Barnett
Tom wrote:
Hi
I'm batting my head against a wall on this one...
I have a class that has a constructor which sets some initial 
conditions, and then a public function that does some work. I want to be 
able to call this function from an external array_walk call, but when I 
try and reference it as $myClass-myFunction in the array_walk call, I 
get an error back saying that this is an invalid function.

Allow Monty Python to help you.
?php
class aClass {
  function aMemberFunction($value, $key, $stuff) {
print_r($key: $value.  $stuff!\n);
  }
}
$myArray = array(item1=firstItem, item2=secondItem);
$myClass = new aClass;
$stuff = Your father was a hamster, and your mother smelled of 
Elderberries!;
array_walk($myArray, array($myClass, 'aMemberFunction'), $stuff);

?
--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://www.php.net/manual/en/index.php
php-general archives: http://marc.theaimsgroup.com/?l=php-generalw=2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Generic question : migrating from java based RPC server to PHP

2005-01-12 Thread Jason Barnett
Ranjan K. Baisak wrote:
This might be a very generic question.
I am in a process of migrating my java based RPC
server to PHP. Luckily with the help of the list I
could able to make sure that all rpc and xml related
function are getting excuted in Apache server. I am
using Apache2 in WInXP.
But still not sure from where I should start my
changes.
Any link or tutorial or case study regarding PHP's
SOAP and RPC service would help a lot.
This might be better asked on the php-soap list?  In any case zend.com 
website is probably a good place to start searching.

--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://www.php.net/manual/en/index.php
php-general archives: http://marc.theaimsgroup.com/?l=php-generalw=2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] array walk and class member functions

2005-01-12 Thread Jochem Maas
Jochem Maas wrote:
Tom wrote:
snip
Sorry Tom, I hit the send button too early!
I mean to add some context to the code below so you would (hopefully)
understand what I mean:
OR define the function outside of the class e.g.
function aFunction($value, $key)
{
global $aReturnString;   
$aReturnString = $aReturnString.$value;
}

...was meant to be:
function aFunction($value, $key)
{
global $aReturnString;
$aReturnString = $aReturnString.$value;
}
class aClass
{
some other stuff, constructor etc
   public function aPublicFunction($anArray)
   {
  global $aRetrunString;
   function aFunction($value, $key)
  {
   global $aReturnString;
   $aReturnString = $aReturnString.$value;   }
  array_walk($anArray,'aFunction');
  return $aReturnString;
   }
   // rest of the class definition goes here...

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


[PHP] php style guides

2005-01-12 Thread Tim Burgan
Hi everyone,
What 'rules' do you follow about styling/formatting your PHP code? Do 
you follow a guide that is available online?

I generally have my own preference for formatting like
if ( condition )
{
   statements;
}
for all conditional statements and loops, as opposed to
if (condition) {
   statements;
}
But what I'm really wanting to get everyones thoughts about is in regard 
to combining PHP with HTML.

I used to do:
?php
  echo blah;
  ?h1test/h1?php
  echo blah;
?
but just tried
?php
  echo 'blah';
  echo 'h1test/h1';
  echo 'blah';
?
which I find it's much easier to read to code.
What do other people do and for what reason? What are the 
advantages/disadvantages to doing it certain ways?

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


Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Jochem Maas
Jason Barnett wrote:

Indeed!  I was actually quite surprised that this wasn't the way 
__CLASS__ resolved... I had to code it to believe it (and I didn't even 
do that until after you told us __CLASS__ didn't work!)

I would like to thank all of those that cared about my problem and 
tried to
find a solution by providing a wide variety of ideas. Thank you very 
much!!!

Do you think it would be wise to ask for help on php-dev?

I'll put money on that they say won't do it and then tell you to read 
the archives of php-internals as to why.

I originally hit this problem when I started to write a PHP5 based 
framework at the end of 2003. during the time since then I have 
watched/read quite a few threads on this subject.

I strongly suggest you brew a big pot of coffee and sit down for a few 
(lots??) hours to read thru what has been discussed on php-internals, 
you might start with:

Perhaps the way to go about this would be to make a feature request on 
bugs.php.net?  It does seem like something that should be a part of the 
language.


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


Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Jochem Maas
darn, send button again!! (sent too early)
Jochem Maas wrote:
Jason Barnett wrote:

Indeed!  I was actually quite surprised that this wasn't the way 
__CLASS__ resolved... I had to code it to believe it (and I didn't 
even do that until after you told us __CLASS__ didn't work!)

I would like to thank all of those that cared about my problem and 
tried to
find a solution by providing a wide variety of ideas. Thank you very 
much!!!

Do you think it would be wise to ask for help on php-dev?

I'll put money on that they say won't do it and then tell you to read 
the archives of php-internals as to why.

I originally hit this problem when I started to write a PHP5 based 
framework at the end of 2003. during the time since then I have 
watched/read quite a few threads on this subject.
my solution used call_user_func_array(), its relatively slow and a 
ing nightmare in terms of complexity.

I strongly suggest you brew a big pot of coffee and sit down for a few 
(lots??) hours to read thru what has been discussed on php-internals, 
you might start with:
http://www.zend.com/lists/php-dev/200307/msg00242.html
basically, AFAIKR, the final answer was something along the lines of - 
'your misusing the static class concept' (don't hold me to that tho!)


Perhaps the way to go about this would be to make a feature request 
on bugs.php.net?  It does seem like something that should be a part of 
the language.



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


Re: [PHP] array walk and class member functions

2005-01-12 Thread Jochem Maas
Tom wrote:
 Thanks very much for the help - both methods work fine. I'd had a look
 at the array_walk manual, but didn't realise that the second param would
 accept an array - that's really cool
indeed that page does not make it very clear,
it's the generic call_back syntax, which can be used practically 
everywhere a callback function is expected, the array you pass can be in 
the form of:

array($object, 'methodname')
or
array('classname', 'methodname')
the second version allows you to use static class methods.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] use of curly braces with string interpolation.

2005-01-12 Thread Jochem Maas
hi guys,
[[
I original posted this to php-internals because I figured that 
php-general would not know the answer _ it had to do with intended use 
of functionality (I couldn't find anything on the web about) and I 
figured that the guys who wrote/write php would be best equipped to 
answer. well no joy - the post was gloriously ignored, so I figured I 
give it a shot here...
]]

I always use curly braces around vars placed in double quoted strings, I 
do this for 2 reasons:

1. I believe It helps the engine because the var delimitation is 
explicit, and this means the interpolation is (should be?) faster.
2. it looks nice (easier to read!)

I have tried to test this with a simple script that does a million 
interations - but I cannot get it to return consistent results - one 
time with curlies is faster, another its slower. the (php5) script I 
used to test is included at the bottom of the email for those who are 
curious. (I haven't been able to find relevant info on either google or 
php.net - are there any other search engines? ;-)

I am interested in knowing whether my first assumption regarding speed 
of interpolation is (in theory) at all correct.

If any of the php gurus would give advice as to use of curly braces in 
interpolated strings would it be:

a, always use them (its faster/better)
b, only when absolutely necessary
c, go away troll and figure it out for yourself
(this one is tempting, n'est pas ;-)
d, something I haven't had the presence of mind to think of!
[[
choice c, is only relevant to internal btw :-)
]]
kind regards,
Jochem.
?
class Tester
{
public $testvar;
}
$t = new Tester;
$t-testvar = 'superduper';
$a = array('junk' = 'notbad!');
var_dump($t, $a);
$strs = array();
$start = mktime();
$i = 0;
do {
$c = 'simplicity' + $i;
$strs[] = {$t-testvar} yadda yadda {$a['junk']} - {$c}\n;
$i++;
} while ($i  101);
$diff = (mktime() - $start);
echo  With Curlies  - Total Time Taken ($diff): .floor($diff / 60).' 
mins  '.($diff % 60).' secs'.\n;

$strs = array();
$start = mktime();
$i = 0;
do {
$c = 'simplicity' + $i;
$strs[] = $t-testvar yadda yadda $a[junk] - $c\n;
$i++;
} while ($i  101);
$diff = (mktime() - $start);
echo  Without Curlies - Total Time Taken ($diff): .floor($diff / 60).' 
mins  '.($diff % 60).' secs'.\n;

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


[PHP] Re: php style guides

2005-01-12 Thread Matthew Weier O'Phinney
* Tim Burgan [EMAIL PROTECTED]:
 What 'rules' do you follow about styling/formatting your PHP code? Do 
 you follow a guide that is available online?

PEAR standards are fairly well-accepted:
http://pear.php.net/manual/en/standards.php

 I generally have my own preference for formatting like

 if ( condition )
 {
 statements;
 }

 for all conditional statements and loops, as opposed to

 if (condition) {
 statements;
 }

PEAR actually recommends this latter instead of the former; the only
case they make for opening braces on the following line is with class
and function/method definitions. (I personally don't understand why
these are treated differently, but I'm sure there's some discussion in
the mailing lists that treats it.)

 But what I'm really wanting to get everyones thoughts about is in regard 
 to combining PHP with HTML.

 I used to do:

 ?php
echo blah;
?h1test/h1?php
echo blah;
 ?

 but just tried

 ?php
echo 'blah';
echo 'h1test/h1';
echo 'blah';
 ?

 which I find it's much easier to read to code.

 What do other people do and for what reason? What are the 
 advantages/disadvantages to doing it certain ways?

I personally try not to put HTML into my code, and use templates:

* Placing HTML into PHP means I'm having to try and decipher two
  languages (or more, if I use CSS or Javascript) in the same file;
  making the mental switch in the same file is typically more difficult
  than having HTML/CSS/JS in different files.

* If I need to worry about HTTP headers deep into the program logic (for
  instance, to perform a redirect or set a cookie), I don't want to
  worry about whether or not any HTML has been sent to the screen.

* If I need to fix a typo in the HTML, I don't want to browse through a
  bunch of PHP to find it.

When I *do* place HTML in my PHP (it *does* happen occasionally), I
typically use heredocs so I don't have to worry about quotes and such:

$html =EOH
h1Test/h1
pThis is a test of the emergency HTML situation/p
pIt received $error_signal/p
EOH;

However, all the above is my personal coding preference; I've heard very
good arguments for other styles and for not using templates.

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

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



Re: [PHP] php style guides

2005-01-12 Thread Zouari Fourat
try http://pear.php.net/manual/en/standards.php


On Wed, 12 Jan 2005 23:34:59 +1030, Tim Burgan [EMAIL PROTECTED] wrote:
 Hi everyone,
 
 What 'rules' do you follow about styling/formatting your PHP code? Do
 you follow a guide that is available online?
 
 I generally have my own preference for formatting like
 
 if ( condition )
 {
 statements;
 }
 
 for all conditional statements and loops, as opposed to
 
 if (condition) {
 statements;
 }
 
 But what I'm really wanting to get everyones thoughts about is in regard
 to combining PHP with HTML.
 
 I used to do:
 
 ?php
echo blah;
?h1test/h1?php
echo blah;
 ?
 
 but just tried
 
 ?php
echo 'blah';
echo 'h1test/h1';
echo 'blah';
 ?
 
 which I find it's much easier to read to code.
 
 What do other people do and for what reason? What are the
 advantages/disadvantages to doing it certain ways?
 
 Thanks for your time.
 
 Tim
 
 --
 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] Re: Offline working

2005-01-12 Thread Matthew Weier O'Phinney
* Lester Caine [EMAIL PROTECTED]:
 Because of the problems working with the email version of the php lists, 
 I'm forced to use the newgroup interface.
 Up until recently I could happily get up in the morning and 'Download 
 Now' in Mozilla so I can scan messages quickly locally.
 Since xmas the 'Download Now' simply gets the first message and then 
 times out. It's working fine on Eclipse and Borland so it's not my end, 
 but now the only way to get the messages is one at a time.

 Is this something that has been changed at www.php.net? Can anything be 
 done about it? Why should offline working be such a problem?

I reported a bug during the week after christmas -- the news server was
down at the beginning of that week. Since then, it seems like the
newsserver they're using isn't tuned to the load it receives -- I often
find I lose my connection to it, or that when I initially try to
connect, I can't. Just keep hitting the download button every so often,
and you should get a full list at some point.

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

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



Re: [PHP] Generic question : migrating from java based RPC server to PHP

2005-01-12 Thread Ranjan K. Baisak

--- Jochem Maas [EMAIL PROTECTED] wrote:
 generic questions suck - noone here is psychic! :-)
Ohh what a answer!!! I don't think anybody is psychic.
 8 pages on PHP+SOAP:
 http://www.devshed.com/c/a/Zend/PHP-SOAP-Extension/
 
Thanks a lot for your updation.

regards,
Ranjan



__ 
Do you Yahoo!? 
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com 

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



Re: [PHP] array walk and class member functions

2005-01-12 Thread Jason Barnett
indeed that page does not make it very clear,
it's the generic call_back syntax, which can be used practically 
everywhere a callback function is expected, the array you pass can be in 
the form of:

array($object, 'methodname')
or
array('classname', 'methodname')
the second version allows you to use static class methods.
I never knew about this syntax until I saw it on this newsgroup quite a 
few months back.  Perhaps an update to the manual is in order? 
(Whistling and walking away...)

--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://www.php.net/manual/en/index.php
php-general archives: http://marc.theaimsgroup.com/?l=php-generalw=2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] SQL Server log file

2005-01-12 Thread Zouari Fourat
Hello
am new to ms sql server and using it for a while, i where searching
where to find sql queries log file ? some one have an idea about it ?

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



[PHP] Re: php style guides

2005-01-12 Thread Jason Barnett
Tim Burgan wrote:
Hi everyone,
What 'rules' do you follow about styling/formatting your PHP code? Do 
you follow a guide that is available online?
sacred_cow_warningPlease do not flame me here, different strokes for 
different folks!/sacred_cow_warning

If you're entirely new to coding in PHP ... and you don't have a 
codebase already existing... then you might consider using the coding 
standards as outlined by PEAR (apparently several other people agree):
http://pear.php.net/manual/en/standards.php

I generally have my own preference for formatting like
if ( condition )
{
   statements;
}
And that's fine.  The main thing is: aim for consistency of your coding 
standards.  That way when you look through an entire project it's easy 
to see what's going on.

for all conditional statements and loops, as opposed to
if (condition) {
   statements;
}
But what I'm really wanting to get everyones thoughts about is in regard 
to combining PHP with HTML.

I used to do:
?php
  echo blah;
  ?h1test/h1?php
  echo blah;
?
Personally I don't mix and match HTML with my PHP code.  I am extremely 
lazy and enjoy finding PHP code available that will do all of the 
echo'ing for HTML I want to build.  The PEAR package HTML_Quickform is a 
good example here; it solves a common problem (building an MVC form) for 
me in a way that is faster than coding it all out by hand.  That is, 
once you know how to use the package.  (There are loads of other 
packages out there as well; this is but one example.)

But if you look at your HTML as a template (which it pretty much is) for 
your front end and you view PHP as your logic back-end (which it is) 
then mixing them together is fine.  Separating presentation and logic is 
generally a good idea; this way you can easily change the way it looks 
without breaking functionality (or vice versa).  Although if/when I do 
it this way I try to make it pretty obvious what I'm trying to accomplish.

html
head?php include 'functions.php'; ?/head
body
  h1?php getHeader1(); ?/h1
  h2Hello ?php getUserName(); ?!  How are you doing this fine day?/h2
/body
/html
but just tried
?php
  echo 'blah';
  echo 'h1test/h1';
  echo 'blah';
?
which I find it's much easier to read to code.
That's always an important consideration.  :)
What do other people do and for what reason? What are the 
advantages/disadvantages to doing it certain ways?

Thanks for your time.
Tim

--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://www.php.net/manual/en/index.php
php-general archives: http://marc.theaimsgroup.com/?l=php-generalw=2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] [Fwd: [PHP-INSTALL] Install of PHP 5.0.3 Error]

2005-01-12 Thread Kelly
High Guys,
I have installed PHP 5.0.3 on an Intel box running Apache 1.3 with a
Solaris 9 x86 OS.  When I try to restart the Apache server I get this error:
Syntax error on line 249 of
/etc/apache/httpd.conf:
Cannot load /usr/apache/libexec/libphp5.so into server: ld.so.1:
/usr/apache/bin/httpd: fatal: relocation error: file
/usr/apache/libexec/libphp5.so: symbol xmlRelaxNGCleanupTypes:
referenced symbol not found
I looked up on the PHP bugs website and it says the error is not a bug
it is bogus.  It says the problem is UNIX maintenance.  It seems if you
have two 'libxml2' versions on the system you will get this error.  It
says to delete the older version and Apache will start.  I found a
version at '/usr/include/libxml2/libxml' and
'/usr/local/include/libxml2/libxml'.  I deleted the entire directory
'/usr/include/libxml2/libxml'.  I still get the same error.  I decided
OK maybe I should recompile PHP now that the other version is gone.  I
can do a './configure --with-apxs=/usr/apache/bin/apxs'.  After I do the
configure and enter 'make' it says make: not found.  So not only can I
not get past the error now I cannot even re-compile.  What am I doing
wrong.  Is there a registry like componant to Solaris I need to change
to show the old version is gone?  Any help out there for me?
Kelly
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php style guides

2005-01-12 Thread Jochem Maas
Tim Burgan wrote:
Hi everyone,
What 'rules' do you follow about styling/formatting your PHP code? Do 
you follow a guide that is available online?

I generally have my own preference for formatting like
if ( condition )
{
   statements;
}
which personally I think is ugly and a waste of space ;-)
(actually I used to do it like that but the better I got at programming 
the more I found myself trying to condense my code - mostly so that I 
could fit more of it on screen.)
currently I reserve the above CS for functions and classes.

e.g.
myCoolFunc( $arg1, $arg2 = 'default' )
{
// do something cool!
}
for all conditional statements and loops, as opposed to
if (condition) {
   statements;
}
this is my (exact) preference for block statements.
its all very personal this!
But what I'm really wanting to get everyones thoughts about is in regard 
to combining PHP with HTML.

I used to do:
?php
  echo blah;
  ?h1test/h1?php
  echo blah;
?
which very quickly gets completely unreadable when the complexity starts 
piling up.

but just tried
?php
  echo 'blah';
  echo 'h1test/h1';
  echo 'blah';
?
much easier to read, but what about:
?php
echo 'blahh1test/h1blah';
?
or (where the literal strings would normally be vars):
?php
echo 'blah','h1test/h1','blah';
?
or (the semi-colon can be dropped here):
?= 'blahh1test/h1blah'; ?
the consensus is (AFAIKT) that the less you break in and out of PHP
the more legible your code is likely to be. In the same vein it is often 
suggested to first process/gather you data and then output everything 
after your script is done doing its thing, rather than echoing as you go.

there is also the HEREDOC style of echoing output (actually its a method 
of string delimitation) e.g.:

?
echo  THE_END
yadda yadda yadda $myArr['key1'][$key2]
$jumpup, $howhigh
THE_END;
?
read more here (or google PHP+HEREDOC):
http://nl2.php.net/types.string
which I find it's much easier to read to code.
What do other people do and for what reason? What are the 
advantages/disadvantages to doing it certain ways?
I always advise that readability/maintainability is king - speed is 
hardly ever an issue  on an average php site, and when speed becomes 
critical optimizing echo statements is probably not where you want to 
start (creating objects and calling functions is way,way heavier).

so in short: do what you find to be the easiest to read back in 6 months 
time!

Thanks for your time.
Tim

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


[PHP] Re: use of curly braces with string interpolation.

2005-01-12 Thread M. Sokolewicz
Jochem Maas wrote:
hi guys,
[[
I original posted this to php-internals because I figured that 
php-general would not know the answer _ it had to do with intended use 
of functionality (I couldn't find anything on the web about) and I 
figured that the guys who wrote/write php would be best equipped to 
answer. well no joy - the post was gloriously ignored, so I figured I 
give it a shot here...
]]

I always use curly braces around vars placed in double quoted strings, I 
do this for 2 reasons:

1. I believe It helps the engine because the var delimitation is 
explicit, and this means the interpolation is (should be?) faster.
it's just as fast as not using it. The delimiter with variables is 
simply the $[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* part. Simple 
variables (scalar) are described using the above, it doesn't make it 
faster to put more around em. Adding {} around array's/objects shouldn't 
make it faster, since it's still just taking the entire thing as a 
variable until it comes acress a character that either delimits the 
whole thing, or is simply not allowed there.

2. it looks nice (easier to read!)
I think it looks ugly... but it's a simple matter of personal taste ;)
I have tried to test this with a simple script that does a million 
interations - but I cannot get it to return consistent results - one 
time with curlies is faster, another its slower. the (php5) script I 
used to test is included at the bottom of the email for those who are 
curious. (I haven't been able to find relevant info on either google or 
php.net - are there any other search engines? ;-)

I am interested in knowing whether my first assumption regarding speed 
of interpolation is (in theory) at all correct.

If any of the php gurus would give advice as to use of curly braces in 
interpolated strings would it be:

a, always use them (its faster/better)
b, only when absolutely necessary
c, go away troll and figure it out for yourself
(this one is tempting, n'est pas ;-)
d, something I haven't had the presence of mind to think of!
[[
choice c, is only relevant to internal btw :-)
]]
kind regards,
Jochem.
?
class Tester
{
public $testvar;
}
$t = new Tester;
$t-testvar = 'superduper';
$a = array('junk' = 'notbad!');
var_dump($t, $a);
$strs = array();
$start = mktime();
$i = 0;
do {
$c = 'simplicity' + $i;
$strs[] = {$t-testvar} yadda yadda {$a['junk']} - {$c}\n;
$i++;
} while ($i  101);
$diff = (mktime() - $start);
echo  With Curlies  - Total Time Taken ($diff): .floor($diff / 60).' 
mins  '.($diff % 60).' secs'.\n;

$strs = array();
$start = mktime();
$i = 0;
do {
$c = 'simplicity' + $i;
$strs[] = $t-testvar yadda yadda $a[junk] - $c\n;
$i++;
} while ($i  101);
$diff = (mktime() - $start);
echo  Without Curlies - Total Time Taken ($diff): .floor($diff / 60).' 
mins  '.($diff % 60).' secs'.\n;
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] array walk and class member functions

2005-01-12 Thread Tom
Thanks very much for the help - both methods work fine. I'd had a look 
at the array_walk manual, but didn't realise that the second param would 
accept an array - that's really cool!

I don't like the function_exists method much, as I frequently overload 
class members. Not needed now as I have the worker defined as a private 
function and can access it from the public one as
array_walk($anArray,array($this,'aFunction');

Thanks
Tom
Jochem Maas wrote:
Tom wrote:
Hi
I'm batting my head against a wall on this one...
I have a class that has a constructor which sets some initial 
conditions, and then a public function that does some work. I want to 
be able to call this function from an external array_walk call, but 
when I try and reference it as $myClass-myFunction in the array_walk 
call, I get an error back saying that this is an invalid function.

eg)
?php
   include ../includes/aClass.class;
   $myArray = array(item1=firstItem, item2=secondItem);
   $myClass = new aClass;
   array_walk($myArray,'$myClass-aMemberFunction');

try changing this line to:
array_walk($myArray, array($myClass,'aMemberFunction'));
or if you prefer to take the route of your second attempt read on...
?
As a workaround, I redifined the class so that there was a public 
function which made the array_walk call with the worker function 
defined internally as follows, but this throws another issue in that 
if I create multiple instances of the class then I get an error to 
say that the internal function is already defined ...

which is correct, you are trying to create this function multiple times.

*Fatal error*: Cannot redeclare aFunction() (previously declared in 
/usr/local/apache2/htdocs/includes/functions.php:23) in 
*/usr/local/apache2/htdocs/includes/functions.php* on line *23*

class aClass
{
some other stuff, constructor etc
   public function aPublicFunction($anArray)
   {
  global $aRetrunString;
   function aFunction($value, $key)
  {
   global $aReturnString;
   $aReturnString = $aReturnString.$value;   }
  array_walk($anArray,'aFunction');
  return $aReturnString;
   }

wrap the function def. like so:
if (!function_exists('aFunction')) {
function aFunction($value, $key)
{
global $aReturnString;   
$aReturnString = $aReturnString.$value;
}
}

OR define the function outside of the class e.g.
function aFunction($value, $key)
{
global $aReturnString;   
$aReturnString = $aReturnString.$value;
}

BTW: using a global in the way you do in this function is a bad idea.
array_walk() is defined as follows:
bool array_walk ( array array, callback funcname [, mixed userdata])
check out the manual for info on the last arg:
http://nl2.php.net/array_walk
}
  Can anyone help me to get either solution to a working state?
By the way...
apache 2.0.49
php-5.0.2
Thanks very much
Tom


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


[PHP] Re: Offline working

2005-01-12 Thread Lester Caine
Matthew Weier O'Phinney wrote:
* Lester Caine [EMAIL PROTECTED]:
Because of the problems working with the email version of the php lists, 
I'm forced to use the newgroup interface.
Up until recently I could happily get up in the morning and 'Download 
Now' in Mozilla so I can scan messages quickly locally.
Since xmas the 'Download Now' simply gets the first message and then 
times out. It's working fine on Eclipse and Borland so it's not my end, 
but now the only way to get the messages is one at a time.

Is this something that has been changed at www.php.net? Can anything be 
done about it? Why should offline working be such a problem?
I reported a bug during the week after christmas -- the news server was
down at the beginning of that week. Since then, it seems like the
newsserver they're using isn't tuned to the load it receives -- I often
find I lose my connection to it, or that when I initially try to
connect, I can't. Just keep hitting the download button every so often,
and you should get a full list at some point.
Sounds about right, but its quicker hitting every message rather than 
waiting for the timeout on 'Download Now' ;) THAT actually seems to be 
better than it was, before xmas I'd have the problems you describe every 
three or four messages - but the download all worked - eventually.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] use of curly braces with string interpolation.

2005-01-12 Thread Jay Blanchard
[snip]
a, always use them (its faster/better)
b, only when absolutely necessary
c, go away troll and figure it out for yourself
 (this one is tempting, n'est pas ;-)
d, something I haven't had the presence of mind to think of!
[/snip]

e. All of the above

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



Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Morten Rønseth
Hi,
I just tried the example code at 
http://www.zend.com/lists/php-dev/200307/msg00244.html using PHP 5.0.3

The backtrace doesn't see class b at all, all references to it have 
vanished into thin air.

I spent days trying to solve this on my own until I happened upon this 
thread - it appears that there is no clean way of retrieving the name of 
the calling class, in a classmethod defined in the superclass. I do not 
want to overload the sperclass' method.

I do not accept that this is misusing the static concept - without it, 
PHP 5 seems rather lame. How does one go about making a feature request? 
There has to be a way to get this implemented into PHP 5...

Cheers,

-Morten

Jochem Maas wrote:
darn, send button again!! (sent too early)
Jochem Maas wrote:
Jason Barnett wrote:

Indeed!  I was actually quite surprised that this wasn't the way 
__CLASS__ resolved... I had to code it to believe it (and I didn't 
even do that until after you told us __CLASS__ didn't work!)

I would like to thank all of those that cared about my problem and 
tried to
find a solution by providing a wide variety of ideas. Thank you very 
much!!!

Do you think it would be wise to ask for help on php-dev?


I'll put money on that they say won't do it and then tell you to 
read the archives of php-internals as to why.

I originally hit this problem when I started to write a PHP5 based 
framework at the end of 2003. during the time since then I have 
watched/read quite a few threads on this subject.

my solution used call_user_func_array(), its relatively slow and a 
ing nightmare in terms of complexity.

I strongly suggest you brew a big pot of coffee and sit down for a few 
(lots??) hours to read thru what has been discussed on php-internals, 
you might start with:

http://www.zend.com/lists/php-dev/200307/msg00242.html
basically, AFAIKR, the final answer was something along the lines of - 
'your misusing the static class concept' (don't hold me to that tho!)


Perhaps the way to go about this would be to make a feature request 
on bugs.php.net?  It does seem like something that should be a part 
of the language.



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


Re: [PHP] use of curly braces with string interpolation.

2005-01-12 Thread Jochem Maas
Jay Blanchard wrote:
[snip]
a, always use them (its faster/better)
b, only when absolutely necessary
c, go away troll and figure it out for yourself
 (this one is tempting, n'est pas ;-)
d, something I haven't had the presence of mind to think of!
[/snip]
e. All of the above
WTF? :-) - I assume you are making a joke here.
a,  b, are mutually exclusive
c, was reserved for people with considerably more _demonstrable_ 
experience/knowledge of PHP than myself (which discludes about 90% of 
all people who actually mail to this list ;-)
and if d, then some kind of explaination could be assumed to be pertinent.

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


Re: [PHP] array walk and class member functions

2005-01-12 Thread Jochem Maas
Jason Barnett wrote:
indeed that page does not make it very clear,
it's the generic call_back syntax, which can be used practically 
everywhere a callback function is expected, the array you pass can be 
in the form of:

array($object, 'methodname')
or
array('classname', 'methodname')
the second version allows you to use static class methods.

I never knew about this syntax until I saw it on this newsgroup quite a 
few months back.  Perhaps an update to the manual is in order? 
(Whistling and walking away...)

perhaps not:
http://www.php.net/manual/en/language.pseudo-types.php#language.types.callback
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] SQL Server log file

2005-01-12 Thread John Nichel
Zouari Fourat wrote:
Hello
am new to ms sql server and using it for a while, i where searching
where to find sql queries log file ? some one have an idea about it ?
There's a php question in there somewhere, right?
--
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] Data Enryption

2005-01-12 Thread Greg Donald
On Wed, 12 Jan 2005 10:13:08 -, Shaun [EMAIL PROTECTED] wrote:
 I have site that allows users to upload private information to our server.
 We would like to encrypt the data for security reasons and only allow
 certain users to be able to un-encrypt the data and view it. I have looked
 at the PHP encryption functions and they appear to be one way algorithms - I
 am guessing this is the whole point of encrption ;)
 
 Does anyone have any suggestions regarding this?

function encrypt( $string )
{
$key = '[EMAIL PROTECTED]';

$result = '';

for( $i = 1; $i = strlen( $string ); $i++ )
{
$char = substr( $string, $i - 1, 1 );

$keychar = substr( $key, ( $i % strlen( $key ) ) - 1, 1 );

$char = chr( ord( $char ) + ord( $keychar ) );

$result .= $char;
}

return $result;
}

function decrypt( $string )
{
$key = '[EMAIL PROTECTED]';

$result = '';

for( $i = 1; $i = strlen( $string ); $i++ )
{
$char = substr( $string, $i - 1, 1 );

$keychar = substr( $key, ( $i % strlen( $key ) ) - 1, 1 );

$char = chr( ord( $char ) - ord( $keychar ) );

$result .= $char;
}

return $result;
}


-- 
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] SQL Server log file

2005-01-12 Thread Jay Blanchard
[snip]
am new to ms sql server and using it for a while, i where searching
where to find sql queries log file ? some one have an idea about it ?
[/snip]

A MS SQL list might.

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



Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Torsten Roehr
Morten Rønseth [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 I just tried the example code at
 http://www.zend.com/lists/php-dev/200307/msg00244.html using PHP 5.0.3

 The backtrace doesn't see class b at all, all references to it have
 vanished into thin air.

 I spent days trying to solve this on my own until I happened upon this
 thread - it appears that there is no clean way of retrieving the name of
 the calling class, in a classmethod defined in the superclass. I do not
 want to overload the sperclass' method.

 I do not accept that this is misusing the static concept - without it,
 PHP 5 seems rather lame. How does one go about making a feature request?
 There has to be a way to get this implemented into PHP 5...

 Cheers,
 -Morten

Hi guys,

I guess it's time to risk asking on php-dev ;) I will try my luck. Let's see
what the gurus say!

Regards, Torsten

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



Re: [PHP] Data Enryption

2005-01-12 Thread Jason Barnett

function encrypt( $string )
{
$key = '[EMAIL PROTECTED]';
No offense intended to you sir... but why do you use a static key in 
this way instead of using mcrypt?  Please forgive my naivete regarding 
encryption.


$result = '';

for( $i = 1; $i = strlen( $string ); $i++ )
{
$char = substr( $string, $i - 1, 1 );
$keychar = substr( $key, ( $i % strlen( $key ) ) - 1, 1 );
$char = chr( ord( $char ) + ord( $keychar ) );
$result .= $char;
}

return $result;
}
function decrypt( $string )
{
$key = '[EMAIL PROTECTED]';
Similar question here.  I know you would need the key for decryption, 
but again why not use mcrypt?  Has it not been hammered out enough to 
your liking?


$result = '';

for( $i = 1; $i = strlen( $string ); $i++ )
{
$char = substr( $string, $i - 1, 1 );
$keychar = substr( $key, ( $i % strlen( $key ) ) - 1, 1 );
$char = chr( ord( $char ) - ord( $keychar ) );
$result .= $char;
}

return $result;
}


--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://www.php.net/manual/en/index.php
php-general archives: http://marc.theaimsgroup.com/?l=php-generalw=2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php dot net auto complete search engine

2005-01-12 Thread Bret Hughes
On Wed, 2005-01-12 at 05:38, Jochem Maas wrote:
 Richard Davey wrote:
 ...
  It's JS (what else could it be?!) - more info here:
 
 what else? spontaneous self-realising tele-kinetic voodoo. :-D

We used to call that MTAM (Mental Telepathy Access Method)  

Bret

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



Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread M. Sokolewicz
Torsten Roehr wrote:
Morten Rønseth [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,
I just tried the example code at
http://www.zend.com/lists/php-dev/200307/msg00244.html using PHP 5.0.3
The backtrace doesn't see class b at all, all references to it have
vanished into thin air.
I spent days trying to solve this on my own until I happened upon this
thread - it appears that there is no clean way of retrieving the name of
the calling class, in a classmethod defined in the superclass. I do not
want to overload the sperclass' method.
I do not accept that this is misusing the static concept - without it,
PHP 5 seems rather lame. How does one go about making a feature request?
There has to be a way to get this implemented into PHP 5...
Cheers,
-Morten

Hi guys,
I guess it's time to risk asking on php-dev ;) I will try my luck. Let's see
what the gurus say!
Regards, Torsten
why do you think they'd respond with something else than ask at 
php.generals ?

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


Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Mehdi Achour
Because it's a change, that should be reverted, or documented.
didou
M. Sokolewicz wrote:
Torsten Roehr wrote:
Morten Rønseth [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,
I just tried the example code at
http://www.zend.com/lists/php-dev/200307/msg00244.html using PHP 5.0.3
The backtrace doesn't see class b at all, all references to it have
vanished into thin air.
I spent days trying to solve this on my own until I happened upon this
thread - it appears that there is no clean way of retrieving the name of
the calling class, in a classmethod defined in the superclass. I do not
want to overload the sperclass' method.
I do not accept that this is misusing the static concept - without it,
PHP 5 seems rather lame. How does one go about making a feature request?
There has to be a way to get this implemented into PHP 5...
Cheers,
-Morten

Hi guys,
I guess it's time to risk asking on php-dev ;) I will try my luck. 
Let's see
what the gurus say!

Regards, Torsten
why do you think they'd respond with something else than ask at 
php.generals ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: php style guides

2005-01-12 Thread Jochem Maas
Jason Barnett wrote:
Tim Burgan wrote:
Hi everyone,
What 'rules' do you follow about styling/formatting your PHP code? Do 
you follow a guide that is available online?

sacred_cow_warningPlease do not flame me here, different strokes for 
different folks!/sacred_cow_warning
:-)

...
And that's fine.  The main thing is: aim for consistency of your coding 
standards.  That way when you look through an entire project it's easy 
to see what's going on.
thats probably the best advice so far!
...
Personally I don't mix and match HTML with my PHP code.  I am extremely 
lazy and enjoy finding PHP code available that will do all of the 
echo'ing for HTML I want to build.  The PEAR package HTML_Quickform is a 
I am pretty good at PHP and I have tried using the HTML_Quickform 
package, I thought it was a nightmare. don't get me wrong the idea is 
great! It took me days to get a form working that ammounted to a very 
simple comment/email form, something that should take very little time 
as it is (and the idea of the package is to speed this kind of thing up).

AFAIKT HTML_Quickform excels at abstracting complex, multipage forms but 
its got a steep learning curve.

I DO NOT RECOMMEND BEGINNERS USING IT, first fully understand the 
concepts and problems that HTML_Quickform trys to address then give it a 
shot to see if it meets your need.

I-DONT-CARE-IF-YOU-FLAME-ME
That was my personal opinion, if it hurts your feels flame on,
you will be ignored ;-)
/I-DONT-CARE-IF-YOU-FLAME-ME
good example here; it solves a common problem (building an MVC form) for 
me in a way that is faster than coding it all out by hand.  That is, 
once you know how to use the package.  (There are loads of other 
packages out there as well; this is but one example.)

But if you look at your HTML as a template (which it pretty much is) for 
your front end and you view PHP as your logic back-end (which it is) 
then mixing them together is fine.  Separating presentation and logic is 
generally a good idea; this way you can easily change the way it looks 
oh boy, talk about opening a can or worms :-)
without breaking functionality (or vice versa).  Although if/when I do 
it this way I try to make it pretty obvious what I'm trying to accomplish.

html
head?php include 'functions.php'; ?/head
body
  h1?php getHeader1(); ?/h1
  h2Hello ?php getUserName(); ?!  How are you doing this fine day?/h2
/body
/html
that is a nice example of using well named functions (goes for 
classes,vars,constants,etc as well) to make your code transparent


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


Re: [PHP] Re: use of curly braces with string interpolation.

2005-01-12 Thread Jochem Maas
M. Sokolewicz wrote:
Jochem Maas wrote:
...
I always use curly braces around vars placed in double quoted strings, 
I do this for 2 reasons:

1. I believe It helps the engine because the var delimitation is 
explicit, and this means the interpolation is (should be?) faster.
consider that belief destroyed!
it's just as fast as not using it. The delimiter with variables is 
simply the $[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* part. Simple 
variables (scalar) are described using the above, it doesn't make it 
faster to put more around em. Adding {} around array's/objects shouldn't 
make it faster, since it's still just taking the entire thing as a 
variable until it comes acress a character that either delimits the 
whole thing, or is simply not allowed there.
ok, thanks for the insight!

2. it looks nice (easier to read!)
I think it looks ugly... but it's a simple matter of personal taste ;)
hihi :) (touché)
actually one of the reasons I find it easier to read is that (some of) 
my texteditor highlight curly-brace-delimited strings. secondly I seem 
to have trained myself to scan for the curlies.

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


[PHP] PHP5 Exception tutorial

2005-01-12 Thread Thomas Munz
Does anybody know a good PHP5 Exception Tutorial that explain this new 
function step by step?

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



Re: [PHP] Re: php style guides

2005-01-12 Thread Tom
Something I've laboured over for years, in various languages (same issue 
in perl, ASP, JSP...).
My personal preference depends on how much of what is being dumped. If 
it's a really simple page, then do it in line, I tend to indent it as a 
seperate tree to the php code (ie there are two staggers).
However if it's a longer page or includes loads of javascript or 
dynamically built tables etc, then I tend to keep the html in another 
file wrapped up as php functions with a UI_ prefix. This does make it a 
bit slower (calling loads of functions), but the maintenance is loads 
easier and it leaves the main code tree legible!

All down to personal preference though. The only hard and fast rule is 
to keep it consistent and comment well so that when you pick it up again 
a few months down the line you can still maintain it!

eg
?
 include ./...displayFunctions.php;
 nest1
 ...
   nest2
   UI_tableRow($arrayOfElements);
   more nest2 code
 UI_tableEnd;
 more nest1 code
...
?
Tom
But what I'm really wanting to get everyones thoughts about is in regard 
to combining PHP with HTML.

I used to do:
?php
  echo blah;
  ?h1test/h1?php
  echo blah;
?
but just tried
?php
  echo 'blah';
  echo 'h1test/h1';
  echo 'blah';
?
   

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


Re: [PHP] [Fwd: [PHP-INSTALL] Install of PHP 5.0.3 Error]

2005-01-12 Thread Richard Lynch
Kelly wrote:
 I have installed PHP 5.0.3 on an Intel box running Apache 1.3 with a
 Solaris 9 x86 OS.  When I try to restart the Apache server I get this
 error:

 Syntax error on line 249 of
 /etc/apache/httpd.conf:
 Cannot load /usr/apache/libexec/libphp5.so into server: ld.so.1:
 /usr/apache/bin/httpd: fatal: relocation error: file
 /usr/apache/libexec/libphp5.so: symbol xmlRelaxNGCleanupTypes:
 referenced symbol not found


 I looked up on the PHP bugs website and it says the error is not a bug
 it is bogus.  It says the problem is UNIX maintenance.  It seems if you
 have two 'libxml2' versions on the system you will get this error.  It
 says to delete the older version and Apache will start.  I found a
 version at '/usr/include/libxml2/libxml' and
 '/usr/local/include/libxml2/libxml'.  I deleted the entire directory
 '/usr/include/libxml2/libxml'.

So you deleted the 'include' directory, but what about the corresponding
.so file which is probably still hanging around, still being found, and
still being loaded...

Only now you have 1 and 1/2 installations instead of 2, so it's *REALLY*
messed up. :-)

 I still get the same error.  I decided
 OK maybe I should recompile PHP now that the other version is gone.  I
 can do a './configure --with-apxs=/usr/apache/bin/apxs'.  After I do the
 configure and enter 'make' it says make: not found.  So not only can I
 not get past the error now I cannot even re-compile.  What am I doing
 wrong.  Is there a registry like componant to Solaris I need to change
 to show the old version is gone?  Any help out there for me?

I dunno about Solaris, but under Linux one would do 'ldconfig' to re-load
the available set of libraries.

-- 
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: Get name of extending class with static method call

2005-01-12 Thread Jochem Maas
Morten Rønseth wrote:
Hi,
I just tried the example code at 
http://www.zend.com/lists/php-dev/200307/msg00244.html using PHP 5.0.3

The backtrace doesn't see class b at all, all references to it have 
vanished into thin air.
as a side note - using a function like debug_backtrace() seems to be a 
mis-use -- the debug_ prefix is a pretty clear indication that this is 
to retrieve info for helping you figure out what is wrong, and therefore 
it probably not a good idea to write code that relies on its output in a 
production env.

I spent days trying to solve this on my own until I happened upon this 
thread - it appears that there is no clean way of retrieving the name of 
the calling class, in a classmethod defined in the superclass. I do not 
want to overload the sperclass' method.
that probably wouldn't solve the problem unless you duplicate the whole 
function...

what about doing this in the superclass
yourFunc( $className = '' )
{
if (empty($className)) {
$className = __CLASS__;
}
return parent::yourFunc( $className );
}
not perfect, but it would allow you to stack the classes and minimize 
the code in the overloaded funcs. obviously the original func would use
the argument to determine which class it was called by. hopefully you 
get the idea.

I do not accept that this is misusing the static concept - without it, 
actually I agree - but then I'm no expert :-)
PHP 5 seems rather lame. How does one go about making a feature request? 
calling PHP5 lame is a little harsh - one 'missing' feature is not the 
end of the world - and there are work around.

feature requests are done via the bugs DB:
http://bugs.php.net/
take the time to thoroughly investigate the DB for similar requests 
first though, to avoid duplication. Also you may want to politely 
inquire at [EMAIL PROTECTED] before you do so - possibly they 
may have some clarification or could point you to earlier discussions 
that explain the current developer stance.

There has to be a way to get this implemented into PHP 5...
well if you can write C then definitely - you write it, and submit a 
patch - even if its not accepted you can roll your own version. :-)

Cheers,

-Morten

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


Re: [PHP] Checking if

2005-01-12 Thread Morten Rønseth
Bruno B B Magalhães wrote:
Richard,
my solution right know is:
if(substr($url,-1) != '/')
{
$url = $url.'/';
}
Simple and fast... :)
$url = preg_replace (|^(.*)/?$|, \\1/, $url);


Regards,
Bruno B B Magalhaes
On Jan 12, 2005, at 3:37 PM, Richard Lynch wrote:
Bruno B B Magalhães wrote:
how to determine if the last char of a string is a '/'...
The problem, a webpage can be accessed by www.domain.com/page.php or
www.domain.com/page.php/

In addition to the two fine answers posted so far:
if ($string[strlen($string)-1] == '/'){
  echo It ends in '/'BR\n;
}
else{
  echo It does NOT end in '/'BR\n;
}
substr and the above will be fastest, if it matters (probably not).  The
different in performance between substr and array reference is 
negligible,
I think.

preg_match is more flexible if you need to maybe some day figure out the
last several letters in weird combinations.
substr will be useful if you might some day need more letters, but not in
weird combinations.
The array usage may be more natural if you are already tearing apart the
string character by character in other bits of the same code.
YMMV
--
Like Music?
http://l-i-e.com/artists.htm

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


Re: [PHP] Re: Offline working

2005-01-12 Thread Jochem Maas
Lester Caine wrote:
Matthew Weier O'Phinney wrote:
* Lester Caine [EMAIL PROTECTED]:
Because of the problems working with the email version of the php 
what problems do you have with the email version? from what you say, and 
other concur, the news version is much more of a drag!

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


[PHP] sendmail crash

2005-01-12 Thread Michiel van der Blonk
Hi

I am having a problem with sendmail. It gives me a segfault when I use the
Mail and Mail_Mime package right when I call sendmail.

I am using the following params
Array
(
[host] = localhost
[port] = 25
[auth] = 1
[username] = account
[password] = secret
[sendmail_path] = /path/to/sendmail
)

Then I prepare and call the send command
$hdrs = array(
'From'= $from,
'Subject' = Confirmation for $person-FIRST_NAME
$person-LAST_NAME,
'Bcc' = [EMAIL PROTECTED]
);

$mime = new Mail_mime($crlf);
$text=text;
$html=htmlbodytext/body/html;
$mime-setTXTBody($text);
$mime-setHTMLBody($html);
$mail = Mail::factory('sendmail', $params);
return $mail-send($person-EMAIL, $hdrs, $body);

Result: Apache error messages:
emalloc: cannot allocate ... bytes
and also
erealloc: cannot allocate ... bytes

I just upgraded to php 4.3.10 on FreeBSD.

any ideas?

Michiel
-- 


Kind regards,
Michiel
*
Michiel van der Blonk
CaribMedia Marketing  Consultancy N.V.
Oranjestad, Aruba
Tel: (297) 583-4144 Fax: (297) 582-6102
http://www.caribmedia.com
 
Website Design, Web Application Development,
Web Hosting, Internet Marketing
 
Operators of:
Visit Aruba - http://www.VisitAruba.com
Aruba Links - http://www.ArubaLinks.com
Aruba Business Directory - http://www.visitaruba.com/business/
Aruba Real Estate Locator - http://www.arubarealestate.com
Aruba Bulletin Board - http://bb.visitaruba.com/
Aruba Trip Reports - http://tripreports.visitaruba.com
Aruba Chat - http://chat.visitaruba.com
The VisitAruba Plus SAVINGS CARD - http://www.visitaruba.com/plus/
Contents of this communication are confidential and legally privileged. This
document is intended solely for use of the individual(s) or entity/entities
to whom it is addr

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



Re: [PHP] PHP5 Exception tutorial

2005-01-12 Thread Jochem Maas
Thomas Munz wrote:
Does anybody know a good PHP5 Exception Tutorial that explain this new 
function step by step?

http://www.zend.com/php5/articles/php5-exceptions.php
http://www.php.net/~helly/php/ext/spl/classException.html
http://be.php.net/manual/en/language.exceptions.php
next google first would you, or bother to explain what you have read 
already. I'll assume you haven't read anything or bothered to search so 
for good measure just for you...

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


Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Jochem Maas
Mehdi Achour wrote:
Because it's a change, that should be reverted, or documented.
don't top post - its bad form and many people ignore topposts.
Mehdi is right to say that debug_backtrace() has changed - but so has 
the whole engine - I don't think that function was ever meant to be used 
in the way Morten was (or was it Torsten?). its clearly for debugging, no?
and yeah, everything should be documented - but are you going to do? :-)

didou
...
why do you think they'd respond with something else than ask at 
php.generals ?
bogus! - this is not a case of someone not knowing/understanding 
existing functionality. its a case of him missing something which quite 
a few people think should be available to PHP users, ofcourse the 
developers are entitled to disagree. actually I read php-dev like a 
zealot (brilliant way to learn about php) and I see the chap in question 
has posted his question and already got one answer... which didn't 
mention php-general at all ;-)


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


Re: [PHP] Re: Offline working

2005-01-12 Thread Lester Caine
Jochem Maas wrote:
Lester Caine wrote:
Matthew Weier O'Phinney wrote:
* Lester Caine [EMAIL PROTECTED]:
Because of the problems working with the email version of the php 
what problems do you have with the email version? from what you say, and 
other concur, the news version is much more of a drag!
One that I have asked about on several occasions.
ALL of my posts to www.php.net eMail addresses get returned as rejected, 
 any attempt to 'unregister' fails because I can't send the 
acknowledgment eMail ( SO I still get the email copies as well, just 
can't reply to them ).
I did try registering a new eMail address, but then I have to switch 
addresses every time I post.
I would add that it is ONLY www.php.net that is bouncing my eMails, and 
I would MUCH prefer the same from PHP.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] use of curly braces with string interpolation.

2005-01-12 Thread Jochem Maas
Marek Kilimajer wrote:
Jochem Maas wrote:
hi guys,

I always use curly braces around vars placed in double quoted strings, 
I do this for 2 reasons:

1. I believe It helps the engine because the var delimitation is 
explicit, and this means the interpolation is (should be?) faster.
2. it looks nice (easier to read!)

I have tried to test this with a simple script that does a million 
interations - but I cannot get it to return consistent results - one 
time with curlies is faster, another its slower. 

The difference happens at parse time, so if you want to measure any 
difference execute php script in a loop, not loop inside php script.

DOH! nice one Marek, will make an attempt to 'bash' a script together 
asap (I'm crap at shell scripting! but the challenge is a good one).
thanks for the heads up.

thinking about what you said, dumping some test code inside an exec() 
call would have the same effect, no?

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


[PHP] Re: $_GET $_POST simultaneously

2005-01-12 Thread Morten Rnseth
Bostjan Skufca @ domenca.com wrote:
Hello,
If I create form like this
form name=form action=##_URI_ROOT##/entity/edit.php?a=b method=post
	input type=hidden name=action value=modify /
...
both arrays contain appropriate variables when submitted:
::: $_GET :::
Array
 (
 [a] = b
 )
 
::: $_POST :::
Array
 (
 [action] = modify
	...
)

Now what I am interested in is if this is valid behaviour regarding HTTP 
specification and if other platforms support this interference of GET and 
POST variables in request?

Thank your for your answers,
Bostjan
This is a POST - as the action specifies.
However, you have also supplied GET parameters in the URL, so that when 
PHP parses the URL it will fill in the appropriate GET values. Simple 
and clean.

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


Re: [PHP] geographic search engine

2005-01-12 Thread Lester Caine
Symbulos Partners wrote:
Brian Dunning wrote:
  http://www.zipwise.com/
What about UK postcodes?
Expensive. There are a few postcode management sites that provide 
positional data against the post code, but they all cost quite a bit of 
money. We are working on a cut down version for key areas, with a rough 
entry for the first part for all post codes, with a few that people will 
provide fine detail for their own area later.

A postcode query to www.multimap.com will give you the relevant 
coordinates ;)

http://www.spanner.org/postcodes/ is something that is already available.
--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Get name of extending class with static method call

2005-01-12 Thread Morten Rønseth
Jochem Maas wrote:
Morten Rønseth wrote:
Hi,
I just tried the example code at 
http://www.zend.com/lists/php-dev/200307/msg00244.html using PHP 5.0.3

The backtrace doesn't see class b at all, all references to it have 
vanished into thin air.

as a side note - using a function like debug_backtrace() seems to be a 
mis-use -- the debug_ prefix is a pretty clear indication that this is 
to retrieve info for helping you figure out what is wrong, and therefore 
it probably not a good idea to write code that relies on its output in a 
production env.

I spent days trying to solve this on my own until I happened upon this 
thread - it appears that there is no clean way of retrieving the name 
of the calling class, in a classmethod defined in the superclass. I do 
not want to overload the sperclass' method.

that probably wouldn't solve the problem unless you duplicate the whole 
function...

what about doing this in the superclass
yourFunc( $className = '' )
{
if (empty($className)) {
$className = __CLASS__;
}
return parent::yourFunc( $className );
}
I'll have to wait until I get to work tomorrow to check this one out.
But offhand I cannot see it working as I want it to. Sorry.
not perfect, but it would allow you to stack the classes and minimize 
the code in the overloaded funcs. obviously the original func would use
the argument to determine which class it was called by. hopefully you 
get the idea.

I do not accept that this is misusing the static concept - without it, 

actually I agree - but then I'm no expert :-)
PHP 5 seems rather lame. How does one go about making a feature request? 

calling PHP5 lame is a little harsh - one 'missing' feature is not the 
end of the world - and there are work around.
I feel that this 'missing feature' is a sadly lacking implementation of
the concept and use of classmethods. The gurus/implementors might argue
otherwise, but I believe that being able to tell the class of the
originating call is a logical cause of the static (classmethod) concept
- without it the implementation of classmethods seems incomplete, and
hence lame. I probably should have made this clearer...
Also, I believe that any workaround here is highly undersirable. With
PHP5 we got a very decent object model which made it possible to model
and implement our solutions in a professional way. Overloading in
subclass only to get around a silly misimplemenation of classmethods
is the ghost of versions past...
I'm writing a framework that should do as much work as possible in the
superclass, leaving only tasks specific the the subclass to be
implemented in the subclass. Anything else is mickey mouse.
I bet you can feel the resentment :-)
feature requests are done via the bugs DB:
http://bugs.php.net/
Great! But Torsten already is on this mission, it seems.
take the time to thoroughly investigate the DB for similar requests 
first though, to avoid duplication. Also you may want to politely 
inquire at [EMAIL PROTECTED] before you do so - possibly they 
may have some clarification or could point you to earlier discussions 
that explain the current developer stance.

There has to be a way to get this implemented into PHP 5...

well if you can write C then definitely - you write it, and submit a 
patch - even if its not accepted you can roll your own version. :-)

I write C well, but I'd rather stick to a standard distro then my own
rolll. Besides, I just don't have the time to do this.
Cheers,
-Morten
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Data Enryption

2005-01-12 Thread Greg Donald
On Wed, 12 Jan 2005 18:09:08 +0100, Jochem Maas [EMAIL PROTECTED] wrote:
 I'm no expert on crypto (and never will be either! designing good crypto
 is something best left to the very very very very best in terms of
 computer science) but I think that the following function represents
 very weak crypto -

Feel free to not use it then..  geez.

 which may very suffice, but one thing that could make
 the whole lots fall apart is the fact that the key is kept in the
 function itself - imagine the server has auto source-highlighting for
 php files (when you add an 's' to a filename), if so anyone can readout
 your key!

Imagine a world where there were no inexperienced sysadmins.

 oh and Greg, you may just have told the world the key that you are
 actually using!

I made that one up just for the post.  And even if I didn't.. good
luck finding the data.


-- 
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: Get name of extending class with static method call

2005-01-12 Thread Morten Rønseth
Jochem Maas wrote:
Mehdi Achour wrote:
Because it's a change, that should be reverted, or documented.

don't top post - its bad form and many people ignore topposts.
Mehdi is right to say that debug_backtrace() has changed - but so has 
the whole engine - I don't think that function was ever meant to be used 
in the way Morten was (or was it Torsten?). its clearly for debugging, no?
Ah - but I was only checking out a previous tip on the subject. I wasn't 
actually trying to implement a fix using debug_backtrace().
Good heavens, no! It would be far to ineffective.


and yeah, everything should be documented - but are you going to do? :-)
didou
...
why do you think they'd respond with something else than ask at 
php.generals ?

bogus! - this is not a case of someone not knowing/understanding 
existing functionality. its a case of him missing something which quite 
a few people think should be available to PHP users, ofcourse the 
developers are entitled to disagree. actually I read php-dev like a 
zealot (brilliant way to learn about php) and I see the chap in question 
has posted his question and already got one answer... which didn't 
mention php-general at all ;-)


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


Re: [PHP] Checking if

2005-01-12 Thread Bruno B B Magalhães
Richard,
my solution right know is:
if(substr($url,-1) != '/')
{
$url = $url.'/';
}
Simple and fast... :)
Regards,
Bruno B B Magalhaes
On Jan 12, 2005, at 3:37 PM, Richard Lynch wrote:
Bruno B B Magalhães wrote:
how to determine if the last char of a string is a '/'...
The problem, a webpage can be accessed by www.domain.com/page.php or
www.domain.com/page.php/
In addition to the two fine answers posted so far:
if ($string[strlen($string)-1] == '/'){
  echo It ends in '/'BR\n;
}
else{
  echo It does NOT end in '/'BR\n;
}
substr and the above will be fastest, if it matters (probably not).  
The
different in performance between substr and array reference is 
negligible,
I think.

preg_match is more flexible if you need to maybe some day figure out 
the
last several letters in weird combinations.

substr will be useful if you might some day need more letters, but not 
in
weird combinations.

The array usage may be more natural if you are already tearing apart 
the
string character by character in other bits of the same code.

YMMV
--
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] [Fwd: [PHP-INSTALL] Install of PHP 5.0.3 Error]

2005-01-12 Thread Jochem Maas
Kelly wrote:
High Guys,
I don't take drugs ;-)
I was about to say ask the php-install list - but it looks like you have 
been there.
I have installed PHP 5.0.3 on an Intel box running Apache 1.3 with a
Solaris 9 x86 OS.  When I try to restart the Apache server I get this 
error:

Syntax error on line 249 of
/etc/apache/httpd.conf:
Cannot load /usr/apache/libexec/libphp5.so into server: ld.so.1:
/usr/apache/bin/httpd: fatal: relocation error: file
/usr/apache/libexec/libphp5.so: symbol xmlRelaxNGCleanupTypes:
referenced symbol not found
I looked up on the PHP bugs website and it says the error is not a bug
it is bogus.  It says the problem is UNIX maintenance.  It seems if you
have two 'libxml2' versions on the system you will get this error.  It
says to delete the older version and Apache will start.  I found a
version at '/usr/include/libxml2/libxml' and
'/usr/local/include/libxml2/libxml'.  I deleted the entire directory
'/usr/include/libxml2/libxml'.  I still get the same error.  I decided
OK maybe I should recompile PHP now that the other version is gone.  I
can do a './configure --with-apxs=/usr/apache/bin/apxs'.  After I do the
configure and enter 'make' it says make: not found.  So not only can I
not get past the error now I cannot even re-compile.  What am I doing
wrong.  Is there a registry like componant to Solaris I need to change


to show the old version is gone?  Any help out there for me?
sure there is.
I know next to nothing about solaris (it does not have a registry tho, 
thats an M$ invented POS for allowing hackers to take over you system 
and hiding simple configuration settings from the owners of the system 
;-), but I know how to google:

I tried googling PHP+make: not found+Solaris
and came up with:
http://www.phpbuilder.com/lists/php-install/272/0279.php
in which Rasmus make a comment (which I hope helps you): he may not know 
you (he doesn't know me!) but I think you should know him (he's an PHP 
dev and can be credited with being the guy that gave birth to what came 
to be know as PHP - i.e. he knows his sh**)

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


Re: [PHP] SQL Server log file

2005-01-12 Thread Jochem Maas
John Nichel wrote:
Zouari Fourat wrote:
Hello
am new to ms sql server and using it for a while, i where searching
where to find sql queries log file ? some one have an idea about it ?
There's a php question in there somewhere, right?
John, you have to look 'beyond the surface' ;-)
seriously though - Microsoft host a little site over at 
msdn.microsoft.com which may provide useful info. Or what about opening 
the MSSQL server console and hitting F1?

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


Re: [PHP] php dot net auto complete search engine

2005-01-12 Thread Jochem Maas
Bret Hughes wrote:
On Wed, 2005-01-12 at 05:38, Jochem Maas wrote:
Richard Davey wrote:
...
It's JS (what else could it be?!) - more info here:
what else? spontaneous self-realising tele-kinetic voodoo. :-D

We used to call that MTAM (Mental Telepathy Access Method)  
LOL - I knew there was a proper technical term for it!
you made my day Brett!
Bret
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Data Enryption

2005-01-12 Thread Greg Donald
On Wed, 12 Jan 2005 10:51:31 -0500, Jason Barnett
[EMAIL PROTECTED] wrote:
 No offense intended to you sir... but why do you use a static key in
 this way instead of using mcrypt?  Please forgive my naivete regarding
 encryption.

Because not everyone's PHP is built --with-mcrypt, and not everyone
can control how their PHP is built.  Think 'many different clients on
many different web hosts'.

You think I would say to a client that I can't build them a PHP cart
because their PHP doesn't have mcrypt support?  Umm..  no.


-- 
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] use of curly braces with string interpolation.

2005-01-12 Thread Marek Kilimajer
Jochem Maas wrote:
hi guys,

I always use curly braces around vars placed in double quoted strings, I 
do this for 2 reasons:

1. I believe It helps the engine because the var delimitation is 
explicit, and this means the interpolation is (should be?) faster.
2. it looks nice (easier to read!)

I have tried to test this with a simple script that does a million 
interations - but I cannot get it to return consistent results - one 
time with curlies is faster, another its slower. 
The difference happens at parse time, so if you want to measure any 
difference execute php script in a loop, not loop inside php script.

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


Re: [PHP] Checking if

2005-01-12 Thread Richard Lynch
Bruno B B Magalhães wrote:
 how to determine if the last char of a string is a '/'...

 The problem, a webpage can be accessed by www.domain.com/page.php or
 www.domain.com/page.php/

In addition to the two fine answers posted so far:

if ($string[strlen($string)-1] == '/'){
  echo It ends in '/'BR\n;
}
else{
  echo It does NOT end in '/'BR\n;
}

substr and the above will be fastest, if it matters (probably not).  The
different in performance between substr and array reference is negligible,
I think.

preg_match is more flexible if you need to maybe some day figure out the
last several letters in weird combinations.

substr will be useful if you might some day need more letters, but not in
weird combinations.

The array usage may be more natural if you are already tearing apart the
string character by character in other bits of the same code.

YMMV

-- 
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] geographic search engine

2005-01-12 Thread Jason Barnett
Richard: I found this post incredibly useful.  Thank you!
Richard Lynch wrote:
If you only want close things to a given location, the curvature of the
earth is pretty insignificant.
...
I realized one day that at a distance of a hundred miles or less, I just
didn't *CARE* about curvature of the earth, and replaced that trig with
your basic Cartesian distance.
Made a *HUGE* difference in performance.
...
Put a longitude and latitude column on your existing table, and default it
to NULL.
Write your business logic so that *ANY* time a zip code is changed, the
longitude/latitude is re-set to NULL.  (Or use triggers or whatever you
want to make this happen.  I don't care.)
Finally, write a cron job (scheduled task in Windoze) to find N records at
random in your table where the long/lat is NULL, and *copy* over the
long/lat from the zips table.
...
PPS You can pay $$$ for the complete databases of zips, or use the TIGER
data for free just interpolate from existing entries to make up long/lats
for new zips.  EG:  If tomorrow the USPS creates zip code 60609, I can be
pretty damn sure it's close enough to 60601 through 60608 and just
average them to make up bogus long/lat.  Sure, it's wrong.  It's also
FREE and close enough for what I (and almost for sure you) are doing.

--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://www.php.net/manual/en/index.php
php-general archives: http://marc.theaimsgroup.com/?l=php-generalw=2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] geographic search engine

2005-01-12 Thread Richard Lynch
Brian Dunning wrote:
 On Jan 11, 2005, at 12:39 PM, Greg Donald wrote:

 This does not take into account the curve of the earth.  In addition
 you'll need a db with the latitude and longitude for each zip code.

If you only want close things to a given location, the curvature of the
earth is pretty insignificant.

I used to have that long-ass trigonometric formula in a user-defined
PostgreSQL function so I could implement geogrphical search here:
http://chatmusic.com/venues.htm#search

I realized one day that at a distance of a hundred miles or less, I just
didn't *CARE* about curvature of the earth, and replaced that trig with
your basic Cartesian distance.

Made a *HUGE* difference in performance.

It always amazes me that I was so foolish as to listen to all the
experts who told me I needed this really hairy complex thing when, in
reality, what I needed was something MUCH simpler.

Oh, and another Free Tip:

Once you load in the 65000+ zip codes for the US (plus whatever other
countries you need/find) you'll be doing a JOIN with your search table
with that.

65000 X (number of records in your table)  WAY TOO MANY RECORDS!!!

So it's time to break the cardinal rule of good database design.

Sort of.

Sanely.

Put a longitude and latitude column on your existing table, and default it
to NULL.

Write your business logic so that *ANY* time a zip code is changed, the
longitude/latitude is re-set to NULL.  (Or use triggers or whatever you
want to make this happen.  I don't care.)

Finally, write a cron job (scheduled task in Windoze) to find N records at
random in your table where the long/lat is NULL, and *copy* over the
long/lat from the zips table.

Now, your search only has to deal with however many records are in your
table.  Not 65000 *times* that many.

You're breaking the rules of database design in a sensible, maintainable
way for a HUGE performance gain.

Before I figured this out, I must have brought my server to a crawl I
don't know how many times with a perfectly reasonable query...  that
involved millions of intermediary tuples when I really only expected a
dozen to actually come out in the end.

PPS You can pay $$$ for the complete databases of zips, or use the TIGER
data for free just interpolate from existing entries to make up long/lats
for new zips.  EG:  If tomorrow the USPS creates zip code 60609, I can be
pretty damn sure it's close enough to 60601 through 60608 and just
average them to make up bogus long/lat.  Sure, it's wrong.  It's also
FREE and close enough for what I (and almost for sure you) are doing.

-- 
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] geographic search engine

2005-01-12 Thread symbulos partners
Brian Dunning wrote:

http://www.zipwise.com/

What about UK postcodes?

-- 
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com

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



Re: [PHP] PHP5 sprintf() function borken

2005-01-12 Thread hitek
I ran your code through 3000 iterations and it always results in 0.09. This is 
on Suse 9.2, Apache 2.0.52 and php 5.0.3

 
 From: Thomas Munz [EMAIL PROTECTED]
 Date: 2005/01/11 Tue AM 11:10:37 EST
 To: php-general@lists.php.net
 Subject: [PHP] PHP5 sprintf() function borken
 
 Today i think i found an bu in the PHP5 version 5.0.3 ( allready exits also 
 in 
 the version 5.0.2 , i try this version also ). 
 
 When tryo one of this scripts:
 
 $i_test = 0.085007667542;
 $tm_total = sprintf('%.2f', $i_test);
 echo $tm_total;
 
 $i_test = 0.085007667542;
 $tm_total = sprintf('%.2f', $i_test);
 echo $tm_total;
 
 $i_test = 0.085007667542;
 $tm_total = sprintf('%.2f', floatval($i_test));
 echo $tm_total;
 
 
 i always get an other result. Some time it get a result like that:
 
 -2681561585988522000.00
 
 my friend try it also and have the same problems...
 
 is that a bug in php5?
 
 -- 
 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] geographic search engine

2005-01-12 Thread symbulos partners
 So often php-general is graced with the presence of people with
 multiple personalities.. or are you really the borg?  :)

What??

 
 Any body has any experience with anything similar?
 
 I coded a zip code to distance calculater last week.
 
 x = 69.1 * ( zip2.lat - zip1.lat )
 y = 69.1 * ( zip2.lon - zip1.lon ) * cos( zip1.lat / 57.3 )
 miles = sqrt( x^2 + y^2 )
 
 This does not take into account the curve of the earth.  In addition
 you'll need a db with the latitude and longitude for each zip code.

Does it work for UK postcodes? Where do you find UK post codes to latitude
databases?
-- 
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com

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



Re: [PHP] drag and drop CMS made with php

2005-01-12 Thread Richard Lynch
Graham Anderson wrote:
 is there a php based CMS that exists that allows you to drag/drop and
 reorder tracks ?
 something akin to itunes or winamp  playlist...

 I want users to be able to the change 'order_id'  field  in the
 'PlaylistItems' table...basically a bunch of UPDATE statements to a
 found set.  Basically, the user drags a playlist record and moves it to
 another area in the playlist...

 does this allready exist somewhere?

There's nothing in PHP/HTML that does this with drag-n-drop...

You're looking at JavaScript or Flash (possibly Ming created by PHP) to
get that.

-- 
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] Data Enryption

2005-01-12 Thread Jochem Maas
Greg Donald wrote:
On Wed, 12 Jan 2005 10:13:08 -, Shaun [EMAIL PROTECTED] wrote:
I have site that allows users to upload private information to our server.
We would like to encrypt the data for security reasons and only allow
certain users to be able to un-encrypt the data and view it. I have looked
at the PHP encryption functions and they appear to be one way algorithms - I
am guessing this is the whole point of encrption ;)
Does anyone have any suggestions regarding this?

I'm no expert on crypto (and never will be either! designing good crypto 
is something best left to the very very very very best in terms of 
computer science) but I think that the following function represents 
very weak crypto - which may very suffice, but one thing that could make 
the whole lots fall apart is the fact that the key is kept in the 
function itself - imagine the server has auto source-highlighting for 
php files (when you add an 's' to a filename), if so anyone can readout 
your key!

that was not meant as a 'dis', I just wanted to point out that crypto is 
 very hard to get right.

oh and Greg, you may just have told the world the key that you are 
actually using!

function encrypt( $string )
{
$key = '[EMAIL PROTECTED]';

$result = '';

for( $i = 1; $i = strlen( $string ); $i++ )
{
$char = substr( $string, $i - 1, 1 );
$keychar = substr( $key, ( $i % strlen( $key ) ) - 1, 1 );
$char = chr( ord( $char ) + ord( $keychar ) );
$result .= $char;
}

return $result;
}
function decrypt( $string )
{
$key = '[EMAIL PROTECTED]';

$result = '';

for( $i = 1; $i = strlen( $string ); $i++ )
{
$char = substr( $string, $i - 1, 1 );
$keychar = substr( $key, ( $i % strlen( $key ) ) - 1, 1 );
$char = chr( ord( $char ) - ord( $keychar ) );
$result .= $char;
}

return $result;
}

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


Re: [PHP] Error loading extension dlls in WindosXP for PHP4.3.10

2005-01-12 Thread Richard Lynch
 Well Richard, I could able to solve it by copying all
 dlls into Windows\System32 directory. But still not
 sure why I need to copy all dlls into system32
 directory though I have mentioned in php.ini file that
 extension_directory=c:\PHP4\extensions.

What does ?php phpinfo();? say about your php.ini file?

-- 
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] SQL Server log file

2005-01-12 Thread Jonel Rienton
just to help out, you might wanna try and use the Profiler under the MS 
SQL programs group

http://jonel.road14.com
--
I not know English well, but I know 7 computer languages.
anonymous
On Jan 12, 2005, at 7:54 AM, Zouari Fourat wrote:
Hello
am new to ms sql server and using it for a while, i where searching
where to find sql queries log file ? some one have an idea about it ?
--
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 + MSSQL win32

2005-01-12 Thread Vincent DUPONT
Hi

 

I try to use PHP with MSSQL on a WINXP station.

Usually, on win32 systems this works very well, but today I can't
understand the problem.

 

I can connect and execute SELECT statements

When I try to INSERT , DELETE or UPDATE a record, I have a PHP ERROR,
and a MSSQL error code 15457 in the mssql logs

The insert executes, but I would like not to have the php error...

This seem to be a problem with grants or permissions, but I can't find
where. Even if I log with the 'sa' account I have the error.

 

I use PHP 4.3.10 and MSSQL2000 on winXP pro

 

Any tip would be nice.

 

Moreover, I have found a ini file parameter that is not documented :
mssql.datetimeconvert=Off

Do  you know what does this mean??

 

Thank you

Vincent



RE: [PHP] drag and drop CMS made with php

2005-01-12 Thread Chris W. Parker
Andrew Kreps mailto:[EMAIL PROTECTED]
on Tuesday, January 11, 2005 5:45 PM said:

 I'm not entirely sure you could make this work, if you're speaking of
 a web app.

[snip]

 I also think it would be entirely browser dependent, which can't be a
 good thing.  It sounds like a lot of work to me, although you might
 have fun creating it.  :)

And let's not forget that it wouldn't be PHP doing any of the dragging
and/or dropping.



Chris.

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



Re: [PHP] URL-funtion - returnvalue into variable...?

2005-01-12 Thread Leif Gregory
Hello Wiberg,

Wednesday, January 12, 2005, 1:40:26 AM, you wrote:
W Another company wants me to access their productinfo thorugh URL, something
W like this:
W https://www.anothercompany.com/returnValueOfProductID=1043

Oddly enough I just happened to run across something that might be
useful while looking for something else completely. grin

http://www.tutorio.com/tutorial/php-alternative-to-mod-rewrite-for-se-friendly-urls

Once the page loads, scroll down a bit. There's a weird navigator.


-- 
Leif (TB lists moderator and fellow end user).

Using The Bat! 3.0.2.3 Rush under Windows XP 5.1
Build 2600 Service Pack 2 on a Pentium 4 2GHz with 512MB

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



Re: [PHP] [Fwd: [PHP-INSTALL] Install of PHP 5.0.3 Error]

2005-01-12 Thread Kelly
I found other things about this online doing google.  I have not fixed
it though.  I can get apache to start but PHP will not parse any
variables.  It does does remove the code so I know it is running and the
mail() function can be done.  It just does not contain any variable
information.  I did an ldd and it showed this:

Any help?

ldd -r /usr/apache/libexec/libphp5.so
libresolv.so.2 =/usr/lib/libresolv.so.2
libm.so.1 = /usr/lib/libm.so.1
libdl.so.1 =/usr/lib/libdl.so.1
libnsl.so.1 =   /usr/lib/libnsl.so.1
libsocket.so.1 =/usr/lib/libsocket.so.1
libz.so.1 = /usr/lib/libz.so.1
libxml2.so.2 =  /usr/local/lib/libxml2.so.2
libiconv.so.2 = /usr/local/lib/libiconv.so.2
libc.so.1 = /usr/lib/libc.so.1
libmp.so.2 =/usr/lib/libmp.so.2
libpthread.so.1 =   /usr/lib/libpthread.so.1
libgcc_s.so.1 = /usr/local/lib/libgcc_s.so.1
symbol not found: ap_user_id   
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_group_id  
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_user_name 
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_max_requests_per_child
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_server_root   
(/usr/apache/libexec/libphp5.so)
symbol not found: top_module   
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_loaded_modules
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_block_alarms  
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_unblock_alarms
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_rwrite
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_rflush
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_should_client_block   
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_signal
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_hard_timeout  
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_get_client_block  
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_reset_timeout 
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_table_get 
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_pstrdup   
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_table_set 
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_table_add 
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_send_http_header  
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_log_error 
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_block_alarms  
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_register_cleanup  
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_unblock_alarms
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_setup_client_block
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_add_common_vars   
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_add_cgi_vars  
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_getword   
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_uudecode  
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_getword_nulls_nc  
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_auth_type 
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_kill_timeout  
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_update_mtime  
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_set_last_modified 
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_set_etag  
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_add_version_component 
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_child_terminate   
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_get_server_version
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_sub_req_lookup_uri
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_destroy_sub_req   
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_run_sub_req   
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_pstrndup  
(/usr/apache/libexec/libphp5.so)
symbol not found: ap_table_setn
(/usr/apache/libexec/libphp5.so)
libthread.so.1 =/usr/lib/libthread.so.1

Kelly



 Kelly wrote:
  I have installed PHP 5.0.3 on an Intel box running Apache 1.3 with a
  Solaris 9 x86 OS.  When I try to restart the Apache server I get this
 

Re: [PHP] use of curly braces with string interpolation.

2005-01-12 Thread Marek Kilimajer
Jochem Maas wrote:
Marek Kilimajer wrote:
The difference happens at parse time, so if you want to measure any 
difference execute php script in a loop, not loop inside php script.

DOH! nice one Marek, will make an attempt to 'bash' a script together 
asap (I'm crap at shell scripting! but the challenge is a good one).
thanks for the heads up.

thinking about what you said, dumping some test code inside an exec() 
call would have the same effect, no?

Right, you don't need bash scripting for this, you can use php for just 
about anything now ;)

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


Re: [PHP] [Fwd: [PHP-INSTALL] Install of PHP 5.0.3 Error]

2005-01-12 Thread Richard Lynch
Kelly wrote:
 I found other things about this online doing google.  I have not fixed
 it though.  I can get apache to start but PHP will not parse any
 variables.  It does does remove the code so I know it is running and the
 mail() function can be done.  It just does not contain any variable
 information.  I did an ldd and it showed this:

 Any help?

This sounds like you now have register_globals OFF and you expect it to be
ON.

Fix your code.

I believe everything below is now irrelevent...

 Kelly wrote:
  I have installed PHP 5.0.3 on an Intel box running Apache 1.3 with a
  Solaris 9 x86 OS.  When I try to restart the Apache server I get this
  error:
 
  Syntax error on line 249 of
  /etc/apache/httpd.conf:
  Cannot load /usr/apache/libexec/libphp5.so into server: ld.so.1:
  /usr/apache/bin/httpd: fatal: relocation error: file
  /usr/apache/libexec/libphp5.so: symbol xmlRelaxNGCleanupTypes:
  referenced symbol not found
 
 
  I looked up on the PHP bugs website and it says the error is not a bug
  it is bogus.  It says the problem is UNIX maintenance.  It seems if
 you
  have two 'libxml2' versions on the system you will get this error.  It
  says to delete the older version and Apache will start.  I found a
  version at '/usr/include/libxml2/libxml' and
  '/usr/local/include/libxml2/libxml'.  I deleted the entire directory
  '/usr/include/libxml2/libxml'.

 So you deleted the 'include' directory, but what about the corresponding
 .so file which is probably still hanging around, still being found, and
 still being loaded...

 Only now you have 1 and 1/2 installations instead of 2, so it's *REALLY*
 messed up. :-)

  I still get the same error.  I decided
  OK maybe I should recompile PHP now that the other version is gone.  I
  can do a './configure --with-apxs=/usr/apache/bin/apxs'.  After I do
 the
  configure and enter 'make' it says make: not found.  So not only can I
  not get past the error now I cannot even re-compile.  What am I doing
  wrong.  Is there a registry like componant to Solaris I need to change
  to show the old version is gone?  Any help out there for me?

 I dunno about Solaris, but under Linux one would do 'ldconfig' to
 re-load
 the available set of libraries.

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







 Kelly



-- 
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] Global Postal

2005-01-12 Thread Richard Lynch
Is anybody aware of any existing world-wide data-collection effort of
postal codes in relation to geogrpahical coordinates (long/lat)?

Not unlike the commercial data sets only:
A) Open Source, Open Content (Commons Content?  Whatever.)
B) World-wide.

At the granularity of *JUST* postal code - long/lat

I'm *not* interested in niche database engines for geo-data on the scale
and scope of MapQuest et al, thank you very much.

Just:
country_code + postal_code  (long, lat)
in a one-to-one relationship, as crude as that might be.

K.I.S.S.

You put in your home-town, and I'll put in mine, and we'll all share, okay?

Assuming the answer is No is anybody interested in collaborating on such
a project with me and a colleague?

We're looking at a VERY simple distributed data network model, with all
source and content being OpenSource/CommonContent, and very simplistic
access rules for how you can build/share content with others.

It's 2005.

Shouldn't any web-site anywhere be able to plug in [a subset of] this data
and just run with it already?

Aren't there enough developers who have re-invented this wheel, and have
sufficient data they collected themselves (or could collect) to just build
an OPEN data set?

If a Little Guy like me needs world-wide data set, surely others also do.

Duh.  Did I mention we're coding this in PHP, so it *is* (somewhat)
on-topic to this list?

That said, just contact me off-list if you're interested.  Please include
specific skills/areas of development, and outline the scope of any dataset
for which YOU own copyrights.  No, we do *NOT* want to steal copyrighted
data.  Can you do CVS?  Write PHP code?  Have a server with some bandwidth
to spare?

Thanks.

-- 
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] sendmail crash

2005-01-12 Thread Richard Lynch
Michiel van der Blonk wrote:
 I am having a problem with sendmail. It gives me a segfault when I use the
 Mail and Mail_Mime package right when I call sendmail.

 I am using the following params
 Array
 (
 [host] = localhost
 [port] = 25
 [auth] = 1
 [username] = account
 [password] = secret
 [sendmail_path] = /path/to/sendmail
 )

 Then I prepare and call the send command
 $hdrs = array(
 'From'= $from,
 'Subject' = Confirmation for $person-FIRST_NAME
 $person-LAST_NAME,
 'Bcc' = [EMAIL PROTECTED]
 );

 $mime = new Mail_mime($crlf);
 $text=text;
 $html=htmlbodytext/body/html;
 $mime-setTXTBody($text);
 $mime-setHTMLBody($html);
 $mail = Mail::factory('sendmail', $params);
 return $mail-send($person-EMAIL, $hdrs, $body);

 Result: Apache error messages:
 emalloc: cannot allocate ... bytes
 and also
 erealloc: cannot allocate ... bytes

Is the above the ACTUAL email you are sending?

Or merely a demonstrative sample?

Cuz, like, if the email you are REALLY sending is *HUGE* then I'd not be
surprised by the messages above...

-- 
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] geographic search engine

2005-01-12 Thread Brian Dunning
What about UK postcodes?
I don't have a source for that - looked into it once and it was too 
expensive. And I thought the USPS charged obscene prices...

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


  1   2   >