[PHP] unable to execute external program

2005-01-13 Thread Sagar C Nannapaneni
Hi,

I've compiled an external program in my linux server.
That program creates a pdf file taking a html file as input.
when i run it thru the command line its working fine.
But when i tried to execute the same command from php
with exec() command its not working.

Note that from command i'm logged in as root. And i'm
using PHP as another user on the same server.

Any other suggestions to run a command line commad thru PHP??

/sagar


[PHP] PHP5 & FreeTDS

2005-01-13 Thread Craig Donnelly
I had FreeTDS and PHP 4.3.x working fine, then I upgraded my PHP

installation to PHP 5.0.3, now It isnt working.

On the page where I connect to the MSSQL server I get the following error:

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to
server: 172.16.xx.xxx in /var/ftpusers/tarot/tarot/admin/sqltest.php on line
4

This worked fine before, and I tested it on another box which is also
running freeTDS with PHP 5.0.1 and it

connects fine. Anyone any Ideas??

Regards,

Craig

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



[PHP] Re: quicker arrays as func args?

2005-01-13 Thread M. Sokolewicz
Justin French wrote:
Hi all,
Pretty sure this can't be done, but thought I'd ask any way...
I have a function where the 3rd argument is an array..
function foo($a,$b,$c) {
echo $a.$b;
print_r($c);
}
Obviously the function does more than that, but anyway, I want the calls 
to this function to look a little cleaner than this:

foo("cat","dog",array("a"=>"1","b"=>"2","c"=>"3"));
is there any other way to define the array?
foo("cat","dog",("a"=>"1","b"=>"2","c"=>"3")); or 
foo("cat","dog",{"a"=>"1","b"=>"2","c"=>"3"}); would be nice (Ruby has 
something like this), but I'm guessing it's not possible.
nope, that's the only way
But, I'm asking just in case I've missed it in the docs.
TIA
---
Justin French, Indent.com.au
[EMAIL PROTECTED]
Web Application Development & Graphic Design
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] How to compile a script into executable file

2005-01-13 Thread kioto
Hi all and sorry for my ignorance.
I have used the Bcompiler to compiler a script into .exe file to
distribuited on Windows System but i don't have any result.
Can you explain how to realize with a simple example ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] delete part of array

2005-01-13 Thread Leif Gregory
Hello Jochem,

Wednesday, January 12, 2005, 8:08:09 PM, you wrote:
JM> read the manual entry first (see below) - and understand what the
JM> function actually does - never just assume because its giving you
JM> the result you want now that it will always work the way you
JM> expect.

Don't be a 'tard... Just because someone doesn't explicitly state they
didn't read the manual entry first don't assume they didn't because
you know what they say about assume.

So to make a troll happy, here's exactly what it does with one array
given as an argument:

"If only one array is given and the array is numerically indexed, the
keys get reindexed in a continuous way."

Wow... Oddly enough that sounds exactly like what he wanted, and hence
my suggesting it to him.

JM> you think???

Now.. On to the part where the "I think" applies.. Since they do not
give an example of a single array being used as an argument, I  had to
rely on memory from when I needed to do that nearly four months ago.

I know I used array_merge(), but I didn't remember if I had to assign
it to a variable or not.

JM> hit the manual: http://www.php.net/array_merge (thats 30 chars to
JM> type in the addressbar of your favorite browser and then you'd be
JM> sure)

No duh and if you're using Firefox, you can even do something
really weird like give the php.net website a keyword (oh, "php" seems
to work nicely), and set your location to "http://www.php.net/%s"; and
amazingly enough you can just type in "php array_merge" and
automagically it takes you right there. That's only 15 chars... Much
more efficient than your suggestion.


JM> probably array_merge() will do what he wants but there maybe
JM> side-effects that will bite him in the ass later on, same goes for
JM> my (previous) suggestion of array_values() as it happens .

His array is numerically indexed. It does exactly what he wants.



Cheers,
Leif Gregory 

-- 
TB Lists Moderator (and fellow registered end-user)
PCWize Editor  /  ICQ 216395  /  PGP Key ID 0x7CD4926F
Web Site 

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



Re: [PHP] geographic search engine

2005-01-13 Thread John Nichel
Richard Lynch wrote:

But we DON'T CARE!

The Borg are everywhere!!! ;)
--
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] unable to execute external program

2005-01-13 Thread Jay Blanchard
[snip]
I've compiled an external program in my linux server.
That program creates a pdf file taking a html file as input.
when i run it thru the command line its working fine.
But when i tried to execute the same command from php
with exec() command its not working.

Note that from command i'm logged in as root. And i'm
using PHP as another user on the same server.

Any other suggestions to run a command line commad thru PHP??
[/snip]

Is safe mode on? Did you change the ownership/permissions of the
external program so that the PHP user could run it?

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



[PHP] Re: How to compile a script into executable file

2005-01-13 Thread M. Sokolewicz
Kioto wrote:
Hi all and sorry for my ignorance.
I have used the Bcompiler to compiler a script into .exe file to
distribuited on Windows System but i don't have any result.
Can you explain how to realize with a simple example ?
not. PHP scripts don't need to be compiled. They're interpreted instead.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] PHP + MSSQL win32 / SOLVED

2005-01-13 Thread Vincent DUPONT
Hello,

I found the problem about my last message (see below).
This relates to a bug in 4.3.10 release with MSSQL extension
Bug #31372

I downgraded to PHP 4.3.8 and the problem was solved.

Thank you for your attention and replies

Vincent

-Original Message-
From: Vincent DUPONT 
Sent: mercredi 12 janvier 2005 21:54
To: php-general@lists.php.net
Subject: [PHP] PHP + MSSQL win32

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

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



[PHP] quicker arrays as func args?

2005-01-13 Thread Justin French
Hi all,
Pretty sure this can't be done, but thought I'd ask any way...
I have a function where the 3rd argument is an array..
function foo($a,$b,$c) {
echo $a.$b;
print_r($c);
}
Obviously the function does more than that, but anyway, I want the 
calls to this function to look a little cleaner than this:

foo("cat","dog",array("a"=>"1","b"=>"2","c"=>"3"));
is there any other way to define the array?
foo("cat","dog",("a"=>"1","b"=>"2","c"=>"3")); or 
foo("cat","dog",{"a"=>"1","b"=>"2","c"=>"3"}); would be nice (Ruby has 
something like this), but I'm guessing it's not possible.

But, I'm asking just in case I've missed it in the docs.
TIA
---
Justin French, Indent.com.au
[EMAIL PROTECTED]
Web Application Development & Graphic Design
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] unable to execute external program

2005-01-13 Thread Robinson, Matthew
I think you've answered your own question.

Check the permissions on the file. Can it be executed by the other user?
Is it in the path? What error do you see in the log?

ls -l
chmod

might just be your friends ;-)

 

-Original Message-
From: Sagar C Nannapaneni [mailto:[EMAIL PROTECTED] 
Sent: 13 January 2005 06:54
To: php-general@lists.php.net
Subject: [PHP] unable to execute external program

Hi,

I've compiled an external program in my linux server.
That program creates a pdf file taking a html file as input.
when i run it thru the command line its working fine.
But when i tried to execute the same command from php with exec()
command its not working.

Note that from command i'm logged in as root. And i'm using PHP as
another user on the same server.

Any other suggestions to run a command line commad thru PHP??

/sagar


This message has been checked for all known viruses by the CitC Virus
Scanning Service powered by SkyLabs. For further information visit
http://www.citc.it

___


This message has been checked for all known viruses by the 
CitC Virus Scanning Service powered by SkyLabs. For further information visit
http://www.citc.it

___

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



[PHP] mysql improved extensions affected_rows

2005-01-13 Thread Tom
I've just started playing with the php5 improved mysqli extensions.
I have the following code:-

$updateQuery = "UPDATE client SET status = 'INACTIVE' WHERE clientName = 
'Tom'";

if ($mysqli->query($updateQuery))
{
   $updateCount = $mysqli->affected_rows;
   echo "updateCount = $updateCount";
}
else
{
   excpetionHandler("updateFailed: ".$updateQuery);
}
?>
This returns "updateCount = 1"
However, when I check the underlying table, there are actually 4 rows 
updated (and yes, before anyone asks, I have repeated this several 
times, correctly resetting the data before each run)

Is this a known bug, or am I doing something stupid?
(php 5.0.2, apache 2.0.49)
Thanks
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: How to compile a script into executable file

2005-01-13 Thread Jason Barnett
M. Sokolewicz wrote:
Kioto wrote:
Hi all and sorry for my ignorance.
I have used the Bcompiler to compiler a script into .exe file to
distribuited on Windows System but i don't have any result.
Can you explain how to realize with a simple example ?
not. PHP scripts don't need to be compiled. They're interpreted instead.
Right.
What I think he means (MTAM in progress!) is how could you bundle up the 
source PHP code with, say, a simple CLI version of PHP and throw all of 
that into an executable file.  For Windoze, I suppoze.

Not that I really know how to do that.  :)
--
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-general&w=2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: quicker arrays as func args?

2005-01-13 Thread Jason Barnett
M. Sokolewicz wrote:
Justin French wrote:
Hi all,
Pretty sure this can't be done, but thought I'd ask any way...
I have a function where the 3rd argument is an array..
function foo($a,$b,$c) {
echo $a.$b;
print_r($c);
}
Obviously the function does more than that, but anyway, I want the 
calls to this function to look a little cleaner than this:

foo("cat","dog",array("a"=>"1","b"=>"2","c"=>"3"));
Well you can always store the array in a variable and just pass the 
variable to the function as the third parameter.  At least it would look 
prettier.

$vars = array("a"=>"1","b"=>"2","c"=>"3");
foo("cat","dog",$vars);
is there any other way to define the array?
foo("cat","dog",("a"=>"1","b"=>"2","c"=>"3")); or 
foo("cat","dog",{"a"=>"1","b"=>"2","c"=>"3"}); would be nice (Ruby has 
something like this), but I'm guessing it's not possible.
nope, that's the only way
Well... I suppose that you could create an object and then treat the 
object like an array (i.e. PHP5), but I doubt you want to do this unless 
you have a specific purpose for using the object in this way.

But, I'm asking just in case I've missed it in the docs.
TIA
---
Justin French, Indent.com.au
[EMAIL PROTECTED]
Web Application Development & Graphic Design

--
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-general&w=2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Is this a bug?

2005-01-13 Thread Rory McKinley
Hi
Probably a trivial question
While trying to use mysqli on my dev machine, PHP returns the following:
Fatal error: Trying to clone an uncloneable object of class mysqli
After STFW I have found a solution that involves swiching off 
compatibility with Zend Engine 1 in php.ini.

However, after going to bugs.php.net, it seems that it has not been 
logged as a bug.

So, the question would be - do I log it or am I wasting their time?
--
Rory McKinley
Nebula Solutions
+27 21 555 3227 - office
+27 21 551 0676 - fax
+27 82 857 2391 - mobile
www.nebula.co.za

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


RE: [PHP] PHP5 & FreeTDS

2005-01-13 Thread Michael Sims
Craig Donnelly wrote:
> On the page where I connect to the MSSQL server I get the following
> error:
>
> Warning: mssql_connect() [function.mssql-connect]: Unable to connect
> to server: 172.16.xx.xxx in
> /var/ftpusers/tarot/tarot/admin/sqltest.php on line 4

A couple of things to try:

(1) Try defining a TDSDUMP file before the connection attempt and see if it 
provides
any hints as to why it failed.  I normally do this via:

putenv("TDSDUMP=/tmp/tdsdump");

before the connection attempt.  Make sure to remove this after you're done 
testing,
this file can get very big very quickly.

(2) Install Sqsh (http://www.sqsh.org/) and see if you can connect with it.  If 
not,
it may give you more information on the connection failure than PHP does (just
guessing here)...

HTH

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



Re: [PHP] delete part of array

2005-01-13 Thread Matthew Fonda

use the unset() function. 

for ($i = 0; $i < count($array); $i++) {
if (empty($array[$i]) {
unset($array[$i]);
}
}

On Wed, 2005-01-12 at 16:22, Sebastian wrote:
> how do i delete keys from an array if it has no values?
> eg, this:
> 
> [name] => Array
>   (
>   [0] => grape
>   [1] => apple
>   [2] => 
>   [3] => orange
>   [4] => 
>   [5] => cherry
>   )
> 
> to:
> 
> [name] => Array
>   (
>   [0] => grape
>   [1] => apple
>   [2] => orange
>   [3] => cherry
>   )
-- 
Regards,
Matthew Fonda

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



Re: [PHP] Re: Fw: Identify which function called another

2005-01-13 Thread Jochem Maas
Lars B. Jensen wrote:
Is there any way, I from one function can identify which other 
function called it, without parameter passing the name manually ?
I still question whether its correct to design a function which 
requires this. I thought the idea of encapsulating code inside a 
function is that its non-dependent/black-boxed still for every 
rule there is an exception!

Need it for my "identify why the hell this error occured, send email to 
the admins with full debug, server variables, time, pop that into the 
errorhandling database for cross referencing if it happened before".
damn good reason to use debug_backtrace() if you ask me :-)
Practically, yesterday, we spend a few hours tracing a special error 
occuring extremely seldom and ended up making some crappy debugging on a 
livesite.

Please don't post twice in an hour if you haven't yet received your 
answer. With that in mind, I have an answer for you. :-)
maybe Lars thought his post had disappeared into /dev/null, not 
altogether strange considering the fluctuating time delays in posts 
being sent out! then maybe he's an impatient s.o.b ;-)

Or maybe Lars has multiple email accounts, and realized he was sending 
from the wrong one forgetting he had authorized it beforehand.
I'm guessing Lars has multiple email accounts. ;-)
/ Lars
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] delete part of array

2005-01-13 Thread M. Sokolewicz
that only works for numerical indices.
However, if you're sure that neither null values, nor false values are 
supposed to be present in the array, (that means, they MIGHT be, but 
should be removed anyway; or just not be there at all,) then you could 
try array_filter with no callback-argument :)

Another easy way would be:
foreach($array as $key=>$val) {
   if($val === '') {
  unset($array[$key]);
   }
}
hope it helps
- Tul
Matthew Fonda wrote:
use the unset() function. 

for ($i = 0; $i < count($array); $i++) {
if (empty($array[$i]) {
unset($array[$i]);
}
}
On Wed, 2005-01-12 at 16:22, Sebastian wrote:
how do i delete keys from an array if it has no values?
eg, this:
[name] => Array
 (
 [0] => grape
 [1] => apple
 [2] => 
 [3] => orange
 [4] => 
 [5] => cherry
 )

to:
[name] => Array
 (
 [0] => grape
 [1] => apple
 [2] => orange
 [3] => cherry
 )
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Data Enryption

2005-01-13 Thread Christophe Chisogne
Greg Donald a écrit :
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;
}
This is roughly equivalent to an 'xor' 'encryption', trivial to break.
Ex Read first few pages of 'Applied cryptography' of Bruce Schneier.
Imagine someone feeding 'AA' to the encoder.
By simply diffing hex codes with 'encoded' string, the key is
recovered. By encoding a string made of char(0), the 'encoded'
result is even... The key (ok, perhaps repeated a few times).
As perhaps it's not obvious for beginners, note that it can only work
with 7bits datas like ascii, not 8bits datas (latin1, ex french
accentuated chars, etc). So you cant 'encode' binary datas with it.
-- ord() + ord() is in [0-255] + [0-255], ie in [0-510], above 255.
PS I found code shorter, easier to read and maintain by using
   a simple 0-based index, and by avoiding hard-coded values
   -- especially passwords, keys, etc ;-)
   Example of what I mean:
function encrypt($str, $key)
{
$result = '';
for ($i = 0; $i < strlen($str); $i++) {
$char = $str{$i};
$keychar = $key{$i % strlen($key)};
$result .= chr(ord($char) + ord($keychar));
}
return $result;
}
--
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-13 Thread Stephen Craton
I didn't need to search, turns out there wasn't a folder C:\WINODWS\TEMP so
I just made one and it's all fixed now.

Only thing I don't understand is why it didn't change the save path when I
asked it to. Oh well. Thanks for all the help people!

Thanks,
Stephen Craton
http://www.melchior.us

> -Original Message-
> From: Jason Barnett [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 12, 2005 7:14 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Re: Apache 2.0 and Sessions
> 
> >>> 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-general&w=2
> 
> --
> 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 editor

2005-01-13 Thread William Stokes
Hello,

I'm quite new with writing php code. I was considering of using some kind of
php editor program to help with the syntax. Know any goog ones?

Thanks
-Will

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



Re: [PHP] How to compile a script into executable file

2005-01-13 Thread Richard Davey
Hello kioto,

Thursday, January 13, 2005, 9:03:53 AM, you wrote:

k> I have used the Bcompiler to compiler a script into .exe file to
k> distribuited on Windows System but i don't have any result. Can you
k> explain how to realize with a simple example ?

Never used bCompiler, but does the exe just run from the command-line?
You might want to take a look at this:

http://www.roadsend.com/home/index.php?pageID=compiler

I was testing it out only today and despite needing a LOT of work re:
documentation (and IDE features) it does the job quite well. The
Windows EXE it built failed to include the required run-times though,
which was a bit poor. Still, got to be worth looking at.

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

2005-01-13 Thread John Nichel
Jochem Maas wrote:

(no disrespect to Zend, but ZCE _sounds_ a lot like MSCE and everyone
knows what thats worth  ;-)  - just a but of humour guys!)

Oh yeah, I can hear all the Zend people laughing from here.
--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] How can I build a no depends module?

2005-01-13 Thread Unreal HSHH
Hi,

I want to build a dba module with qdbm.
But after I cp the dba.so to another machine, it depends on libqdbm.so.
How can I build a no depends module? So I am not have to make qdbm to
other machine.

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



RE: [PHP] quicker arrays as func args?

2005-01-13 Thread Michael Sims
Justin French wrote:
> Pretty sure this can't be done, but thought I'd ask any way...
[...]
> foo("cat","dog",("a"=>"1","b"=>"2","c"=>"3")); or
> foo("cat","dog",{"a"=>"1","b"=>"2","c"=>"3"}); would be nice (Ruby has
> something like this), but I'm guessing it's not possible.

No, can't do that.  I'm used to stuff like that from Perl as well.  It has been
brought up a few times on the internals list (check the archives for named
parameters or something like that) but has met with resistance so I doubt we'll 
see
something like this anytime soon.

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



Re: [PHP] Re: Fw: Identify which function called another

2005-01-13 Thread Lars B. Jensen
Is there any way, I from one function can identify which other function 
called it, without parameter passing the name manually ?
I still question whether its correct to design a function which requires 
this. I thought the idea of encapsulating code inside a function is that 
its non-dependent/black-boxed still for every rule there is an 
exception!
Need it for my "identify why the hell this error occured, send email to the 
admins with full debug, server variables, time, pop that into the 
errorhandling database for cross referencing if it happened before".

Practically, yesterday, we spend a few hours tracing a special error 
occuring extremely seldom and ended up making some crappy debugging on a 
livesite.

Please don't post twice in an hour if you haven't yet received your 
answer. With that in mind, I have an answer for you. :-)
maybe Lars thought his post had disappeared into /dev/null, not altogether 
strange considering the fluctuating time delays in posts being sent out! 
then maybe he's an impatient s.o.b ;-)
Or maybe Lars has multiple email accounts, and realized he was sending from 
the wrong one forgetting he had authorized it beforehand.

/ Lars 

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


Re: [PHP] geographic search engine

2005-01-13 Thread symbulos partners
Lester Caine wrote:
> 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.

Interesting. Is it an open project?

> 
> http://www.spanner.org/postcodes/ is something that is already available.
> 

I have tried to connect, but it does not work.
-- 
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] Re: How to compile a script into executable file

2005-01-13 Thread Jay Blanchard
[snip]
>> Hi all and sorry for my ignorance.
>> I have used the Bcompiler to compiler a script into .exe file to
>> distribuited on Windows System but i don't have any result.
>> Can you explain how to realize with a simple example ?
> 
> not. PHP scripts don't need to be compiled. They're interpreted
instead.

Right.

What I think he means (MTAM in progress!) is how could you bundle up the

source PHP code with, say, a simple CLI version of PHP and throw all of 
that into an executable file.  For Windoze, I suppoze.

Not that I really know how to do that.  :)
[/snip]

http://www.priadoblender.com

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



[PHP] Downloading Images

2005-01-13 Thread John Camp
I was able to successfully make a very simple http proxy - turns out the 
php documentation has the code for this =] - but now I need a way to 
display images. I figured the best way would be to download the images 
to a temporary folder, then parse the html to point to the images on my 
server instead. The problem is that I do not know how to download the 
images.

Also if anyone has a link to a parsing script it would save a good 
amount of time.

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


Re: [PHP] delete part of array

2005-01-13 Thread Sebastian
thanks Leif, not too many think like you :)
some people are on this list just because they think they are some genius in
php, then when someone with less experience asks for help they bitch and
basically tell you to find your own solution or read the manual, that is the
first place any REAL php coder would go for help FIRST, but it doesn't
always solve a problem thats why there is a thing called MAILING LIST. :)

cheers.

- Original Message - 
From: "Leif Gregory" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, January 13, 2005 7:39 AM
Subject: Re: [PHP] delete part of array


> Hello Jochem,
>
> Wednesday, January 12, 2005, 8:08:09 PM, you wrote:
> JM> read the manual entry first (see below) - and understand what the
> JM> function actually does - never just assume because its giving you
> JM> the result you want now that it will always work the way you
> JM> expect.
>
> Don't be a 'tard... Just because someone doesn't explicitly state they
> didn't read the manual entry first don't assume they didn't because
> you know what they say about assume.
>
> So to make a troll happy, here's exactly what it does with one array
> given as an argument:
>
> "If only one array is given and the array is numerically indexed, the
> keys get reindexed in a continuous way."
>
> Wow... Oddly enough that sounds exactly like what he wanted, and hence
> my suggesting it to him.
>
> JM> you think???
>
> Now.. On to the part where the "I think" applies.. Since they do not
> give an example of a single array being used as an argument, I  had to
> rely on memory from when I needed to do that nearly four months ago.
>
> I know I used array_merge(), but I didn't remember if I had to assign
> it to a variable or not.
>
> JM> hit the manual: http://www.php.net/array_merge (thats 30 chars to
> JM> type in the addressbar of your favorite browser and then you'd be
> JM> sure)
>
> No duh and if you're using Firefox, you can even do something
> really weird like give the php.net website a keyword (oh, "php" seems
> to work nicely), and set your location to "http://www.php.net/%s"; and
> amazingly enough you can just type in "php array_merge" and
> automagically it takes you right there. That's only 15 chars... Much
> more efficient than your suggestion.
>
>
> JM> probably array_merge() will do what he wants but there maybe
> JM> side-effects that will bite him in the ass later on, same goes for
> JM> my (previous) suggestion of array_values() as it happens .
>
> His array is numerically indexed. It does exactly what he wants.
>
>
>
> Cheers,
> Leif Gregory
>
> -- 
> TB Lists Moderator (and fellow registered end-user)
> PCWize Editor  /  ICQ 216395  /  PGP Key ID 0x7CD4926F
> Web Site 
>
> -- 
> 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] [HAB] Force Browsers to encode in utf8

2005-01-13 Thread OOzy Pal
Dears,

My html templates are encoded using utf-8. When the
browser reads the files as .html it encodes it fine
and my characters looks fine. However, when php reads
the files and sends them to the browser the files
looks ugly and unreadable. How can I force the broswer
to encode the pages in utf-8.

=
Regards,
OOzy

What is the purpose of life?



__ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail

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



Re: [PHP] Is this a bug?

2005-01-13 Thread Jochem Maas
Rory McKinley wrote:
Hi
Probably a trivial question
While trying to use mysqli on my dev machine, PHP returns the following:
Fatal error: Trying to clone an uncloneable object of class mysqli
After STFW I have found a solution that involves swiching off 
compatibility with Zend Engine 1 in php.ini.

However, after going to bugs.php.net, it seems that it has not been 
logged as a bug.

So, the question would be - do I log it or am I wasting their time?
I think they will probably disregard it, I believe that when Ze1compat 
mode is on the object is at some time being truely copied where under 
'normal' situations (ie. using the ZE2 object model) assigning the 
object to another var will merely create a reference - since, 
apparently, creating a copy of the object is not allowed you get the 
error when the engine trys to clone it (when you assign the created 
object to another var, possibly when returning it from a function/method).

Also I recommend switching off ZE1Compat mode if you don't need - it 
means you get all the cool stuff from PHP5 - like proper object 
referencing (i.e. no more worries about using ampersand to pass objs by 
reference etc)


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


RE: [PHP] delete part of array

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



On 13 January 2005 05:28, Matthew Fonda wrote:

> use the unset() function.
> 
> for ($i = 0; $i < count($array); $i++) {
>   if (empty($array[$i]) {
>   unset($array[$i]);
>   }
> }

Without actually running it (I'm too lazy!), I'm pretty sure this won't work
correctly -- the count($array) is being recalculated each time round the
loop, so each time you do an unset() it will reduce by one, resulting in the
last few elements never being checked.

It should, however, be perfectly possible to use foreach in the same way:

  foreach ($array as $i=>$value) {
 if (empty($value]) {
unset($array[$i]);
 }
  }

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: [PHP] delete part of array

2005-01-13 Thread Jochem Maas
crap - hit 'reply' by mistake.
---
Leif Gregory wrote:
> Hello Jochem,
>
> Wednesday, January 12, 2005, 8:08:09 PM, you wrote:
> JM> read the manual entry first (see below) - and understand what the
> JM> function actually does - never just assume because its giving you
> JM> the result you want now that it will always work the way you
> JM> expect.
>
> Don't be a 'tard... Just because someone doesn't explicitly state they
heh but who says I'm not a bar steward ;-)
> didn't read the manual entry first don't assume they didn't because
> you know what they say about assume.
sorry if it came accross a little harsh, but I stand by the point that 
the onus is on the person asking the question to give an indication as 
to what he has done to try and help him/her-self - spoonfeeding is for 
babies, not programmers.

>
> So to make a troll happy, here's exactly what it does with one array
> given as an argument:
>
> "If only one array is given and the array is numerically indexed, the
> keys get reindexed in a continuous way."
happy troll here :-)
>
> Wow... Oddly enough that sounds exactly like what he wanted, and hence
> my suggesting it to him.
>
> JM> you think???
>
> Now.. On to the part where the "I think" applies.. Since they do not
> give an example of a single array being used as an argument, I  had to
> rely on memory from when I needed to do that nearly four months ago.
>
> I know I used array_merge(), but I didn't remember if I had to assign
> it to a variable or not.
so my point stands - if your going to help why not grab the nearest 
shell and test by way of a php -r ''? takes just along as 
writing both versions in the mail and makes _you_ look better IMHO.

>
> JM> hit the manual: http://www.php.net/array_merge (thats 30 chars to
> JM> type in the addressbar of your favorite browser and then you'd be
> JM> sure)
>
> No duh and if you're using Firefox, you can even do something
> really weird like give the php.net website a keyword (oh, "php" seems
> to work nicely), and set your location to "http://www.php.net/%s"; and
> amazingly enough you can just type in "php array_merge" and
> automagically it takes you right there. That's only 15 chars... Much
> more efficient than your suggestion.
indeed it is! thanks for the tip :-) , I might add though that people
choose a close/fast mirror rather than www.php.net itself to help 
offload some of the traffic - my preferred mirror is always way faster 
the www.php.net, which is a nice when your hitting the manual 20+ times 
a day.

BTW: took me a few mins to figure out where to set this: in the 
bookmarks details dialog (via the bookmark manager - and possibly other 
routes) if anyone else is interested.

>
>
> JM> probably array_merge() will do what he wants but there maybe
> JM> side-effects that will bite him in the ass later on, same goes for
> JM> my (previous) suggestion of array_values() as it happens .
>
> His array is numerically indexed. It does exactly what he wants.
I personally couldn't tell what exactly he wanted to filter out of his 
array (false, '' or NULL) or whether he cared about the difference in 
this case. I was merely trying to encourage porper understanding of the 
function rather than using something which works under the current 
conditions

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


Re: [PHP] php editor

2005-01-13 Thread Paul Marinas
i use phpedit www.phpedit.com i think it's preaty good and also have a 
free personal licence

William Stokes wrote:
Hello,
I'm quite new with writing php code. I was considering of using some kind of
php editor program to help with the syntax. Know any goog ones?
Thanks
-Will
--
Paul Marinas, netadm @ RDS Craiova.
Imagination is more important than knowledge... - A.E.
GnuPG Key http://sgi.rdscv.ro/~paulm/paulm.PGP


signature.asc
Description: OpenPGP digital signature


Re: [PHP] php editor

2005-01-13 Thread Leif Gregory
Hello William,

Thursday, January 13, 2005, 9:02:12 AM, you wrote:
W> I'm quite new with writing php code. I was considering of using
W> some kind of php editor program to help with the syntax. Know any
W> goog ones?

There are a few.

http://www.pspad.com is my favorite, and it'll syntax highlight a good
number of programming languages. Plus you can download the PHP
documentation in .chm format from php.net and use it from within
PSPad. It's freeware too.


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



[PHP] Begining CVS

2005-01-13 Thread Zouari Fourat
Hello !
CVS becomes more and more necessary when we develop big projects and
developing in a team...
I were learning how to use CVS, but some problems (that maybe i think
it's critical) like cvs dont recognize deleted/added directories/files
let me think about to learn a better version of cvs (must be open
source) so i've choosen subversion.
i would like to know from you (experimented with both CVS and
subversion) wich is better and wich is more portable and wich is the
better expérience to acqueer...
thanks

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



RE: [PHP] php editor

2005-01-13 Thread phpninja
"Know any goog ones?"

funny you should mention goog.. if you google'd "php editor" youd have
your answer by now..

cheers
phpninja

-Original Message-
From: William Stokes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 13, 2005 8:02 AM
To: php-general@lists.php.net
Subject: [PHP] php editor

Hello,

I'm quite new with writing php code. I was considering of using some kind of
php editor program to help with the syntax. Know any goog ones?

Thanks
-Will

-- 
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] php editor

2005-01-13 Thread John Nichel
William Stokes wrote:
Hello,
I'm quite new with writing php code. I was considering of using some kind of
php editor program to help with the syntax. Know any goog ones?
http://www.thelinuxconsultancy.co.uk/phpeditors/
--
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] php editor

2005-01-13 Thread Bret Hughes
On Thu, 2005-01-13 at 10:02, William Stokes wrote:
> Hello,
> 
> I'm quite new with writing php code. I was considering of using some kind of
> php editor program to help with the syntax. Know any goog ones?

These sort of threads are good every now and then I think.  Especially
since it has been so long since I read this list on a day to day basis.

I assume windows by your mailer.  html-kit was good when I used windows
on a day to day basis several years ago.  I wish there was an html-kit
for linux.. gvim is my old stand by on windows and linux and does a
pretty good job of syntax highlighting but no completion/options based
stuff. gvim in combination with a browser ready to hit the manual pages
is all I use nowadays.

I am interested to hear what other folks are using.

Bret

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



Re: [PHP] php editor

2005-01-13 Thread Jochem Maas
doh, I hit reply again by mistake.
(I'm sure TBird keeps moving the reply-all button when I'm not looking  :-)

William Stokes wrote:
> Hello,
>
> I'm quite new with writing php code. I was considering of using some 
kind of

goog == good? me thinks yes! wonderful little freudian slip (i.e. maybe 
you should GOOGle for it ;-)

> php editor program to help with the syntax. Know any goog ones?
this depends on what you are looking for, some people prefer fully 
integrated IDE environments, other people (like me) often prefer 
standalone editors (e.g because its often easier to combine with 
existing tools you use etc):

I really like Textpad on windows (29 Bucks to register - which I think 
is worth it), its simple, fast, robust, lots of plugins/addons/etc, 
custom syntax highlighting, integrate your own tools (e.g. I have CTRL+4 
setup to do a 'php -l' on the current file - 'php -l ' does syntax 
checking).

On *nix I tend to use 'nano' for quick stuff (I am slowly learning Vi, 
but its a tricky beast to control ;-) when in a shell.

On the IDE front - I'm actually really impressed with the Eclipse IDE, I 
keep firing it up and liking it more and more - its not PHP specific at 
all but has plenty of PHP related addons/customizations available for 
it, pretty amazing stuff + its available on both Windoze and Linux and 
its free :-)

At the end of the day once you get comfortable with PHP and you've 
memorized a bunch of the most used functions, you won't have much 
trouble writing it whatever tool you happen to have available!

hope you enjoy PHP as much as I do.
>
> Thanks
> -Will
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php editor

2005-01-13 Thread Danny Brow
On Thu, 2005-01-13 at 18:02 +0200, William Stokes wrote:
> Hello,
> 
> I'm quite new with writing php code. I was considering of using some kind of
> php editor program to help with the syntax. Know any goog ones?
> 
> Thanks
> -Will
> 

I like Komodo.

Dan.

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



Re: [PHP] Downloading Images

2005-01-13 Thread Greg Donald
On Wed, 12 Jan 2005 22:14:35 -0600, John Camp <[EMAIL PROTECTED]> wrote:
> I was able to successfully make a very simple http proxy - turns out the
> php documentation has the code for this =] - but now I need a way to
> display images. I figured the best way would be to download the images
> to a temporary folder, then parse the html to point to the images on my
> server instead. The problem is that I do not know how to download the
> images.
> 
> Also if anyone has a link to a parsing script it would save a good
> amount of time.

wget can download/mirror an entire site for you, has proxy support,
and it will update the image paths as well.  One little command is all
you need:

wget -m -np http://example.com/


-- 
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] php editor

2005-01-13 Thread Greg Donald
On Thu, 13 Jan 2005 18:02:12 +0200, William Stokes <[EMAIL PROTECTED]> wrote:
> I'm quite new with writing php code. I was considering of using some kind of
> php editor program to help with the syntax. Know any goog ones?

vim.org
editplus.com

Both support PHP syntax highlighting.


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

2005-01-13 Thread Jochem Maas
John Nichel wrote:
Jochem Maas wrote:

(no disrespect to Zend, but ZCE _sounds_ a lot like MSCE and everyone
knows what thats worth  ;-)  - just a but of humour guys!)

Oh yeah, I can hear all the Zend people laughing from here.
good cos that means they have a better sense of humour that most 
Softies. my dig was at MCSE actually, which is just as unfounded as 
likening it to ZCE, and nobody seems to be complaining about me ripping 
into MCSE - double standards guys!

I'm sorry I can't take this too seriously (IT that is) - half the people 
on the planet don't even have running water. and with regard to IT, the 
target is moving so fast that any form of certification is bound to go 
out of date faster than a can of milk in the sahara.

Another thing about certification and exams - if you take them and pass 
it tells the world exactly one thing - your good at cramming info and 
passing exams. And as far as commercial certification goes my own, 
jaded, opinion is that these setups are there to make money not because 
of some altruistic desire to increase general competance.

But just to be absolutely clear:
Zend people, ZCEs, anyone else remotely offended; I was only joking, I 
didn't mean any offence and I apologize if I caused any. My view on Zend 
is that overall its a great company, the guys that run it and work there 
deserve the success they are getting and I commend them for the way they 
are integrating a commercial business with Open Source.


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


Re: [PHP] Downloading Images

2005-01-13 Thread Jochem Maas
John Camp wrote:
I was able to successfully make a very simple http proxy - turns out the 
php documentation has the code for this =] - but now I need a way to 
display images. I figured the best way would be to download the images 
to a temporary folder, then parse the html to point to the images on my 
server instead. The problem is that I do not know how to download the 
images.
$imgdata = file_get_contents("http://somedomain.com/someimage.jpg";);
but this assumes that your php setup has the allow_url_fopen ini setting 
 set to true/1, see here for more info:
http://nl2.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen

if not then the only other way _I_ can think of, using PHP, is using the 
cURL extension - which maynot be available either :-S

Also if anyone has a link to a parsing script it would save a good 
amount of time.

regexps is the way to go, I did a quick google and found this post:
http://forums.devshed.com/t173149/s.html&highlight=parse+image
there is a little code snippet there which might be a starting point for 
you.

here is an untested regexp which goes a little further, it assumes that
the img tags have the src attr properly delimited and specifically 
delimited with doublequotes.

|]*src="([^"]*)"[^>]*>|i
hope that helps you on your way.
(hey list-guys! look no rtfm'ing in sight!)
Thanks for any help.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] regex help

2005-01-13 Thread Jason Morehouse
Hello,
I normally can take a bit of regex fun, but not this time.
Simple enough, in theory... I need to match (count) all of the bold tags 
in a string, including ones with embedded styles (or whatever else can 
go in there).   and .  My attempts keep matching 
 as well.

Thanks!
--
Jason Morehouse
Vendorama - Create your own online store
http://www.vendorama.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] [HAB] Force Browsers to encode in utf8

2005-01-13 Thread Rasmus Lerdorf
On Thu, 13 Jan 2005, OOzy Pal wrote:
> My html templates are encoded using utf-8. When the
> browser reads the files as .html it encodes it fine
> and my characters looks fine. However, when php reads
> the files and sends them to the browser the files
> looks ugly and unreadable. How can I force the broswer
> to encode the pages in utf-8.

Your terminology is a bit off, but you can solve your problem by adding
this to your php.inie file:

default_charset="utf-8"

-Rasmus

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



Re: [PHP] delete part of array

2005-01-13 Thread John Nichel
Ford, Mike wrote:

Without actually running it (I'm too lazy!), I'm pretty sure this won't work
correctly -- the count($array) is being recalculated each time round the
loop, so each time you do an unset() it will reduce by one, resulting in the
last few elements never being checked.

Not too much on this topic, but to save youself a few cpu cycles, you 
could put your size outside of the for loop

$size = sizeof ( $array );
for ( $i = 0; $i < $size; $i++ )
Putting it inside the for() makes it call that function on every loop.
--
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] [HAB] Force Browsers to encode in utf8

2005-01-13 Thread Jochem Maas
OOzy Pal wrote:
Dears,
My html templates are encoded using utf-8. When the
browser reads the files as .html it encodes it fine
and my characters looks fine. However, when php reads
the files and sends them to the browser the files
looks ugly and unreadable. How can I force the broswer
to encode the pages in utf-8.
does it help if you add the following statement to your php file(s):
header("Content-Type: text/plain; charset=UTF-8");
the call to header must occur before any output is done.
also you may wish to investigate the usage of (and your current settings 
of) the follow ini settings:

mbstring.internal_encoding
mbstring.encoding_translation
mbstring.internal_encoding
default_charset
I don't profess to have a good grip on charsets/encoding/transcoding etc 
and I've yet to find an article that I can get my head round...
can anyway out there confess to actually understanding this stuff - Im 
very interested!

=
Regards,
OOzy
What is the purpose of life?
does there need to be a purpose?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Begining CVS

2005-01-13 Thread Greg Donald
On Thu, 13 Jan 2005 19:29:36 +0100, Zouari Fourat <[EMAIL PROTECTED]> wrote:
> Hello !
> CVS becomes more and more necessary when we develop big projects and
> developing in a team...
> I were learning how to use CVS, but some problems (that maybe i think
> it's critical) like cvs dont recognize deleted/added directories/files
> let me think about to learn a better version of cvs (must be open
> source) so i've choosen subversion.
> i would like to know from you (experimented with both CVS and
> subversion) wich is better and wich is more portable and wich is the
> better expérience to acqueer...
> thanks

I'd go with Subversion.  I switched from CVS about 6 months ago and
haven't had any issues.


-- 
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] Begining CVS

2005-01-13 Thread John Nichel
Zouari Fourat wrote:
Hello !
CVS becomes more and more necessary when we develop big projects and
developing in a team...
I were learning how to use CVS, but some problems (that maybe i think
it's critical) like cvs dont recognize deleted/added directories/files
let me think about to learn a better version of cvs (must be open
source) so i've choosen subversion.
i would like to know from you (experimented with both CVS and
subversion) wich is better and wich is more portable and wich is the
better expérience to acqueer...
thanks
*sigh*  This is not a CVS list.
--
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] php editor

2005-01-13 Thread Chris W. Parker
Bret Hughes 
on Thursday, January 13, 2005 11:02 AM said:

> I assume windows by your mailer.  html-kit was good when I used
> windows on a day to day basis several years ago.

I'll second HTML-Kit. It's an excellent program (once you customize the
way it handles the tab key).

www.chami.com



Chris.

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



[PHP] Help with encryption

2005-01-13 Thread Brian Dunning
Howdy all -
I have RTFM and STFW and I still can't get encryption to work. What I 
finally ended up with from the PHP documentation is long, unwieldy, 
confusing, and doesn't work. I give up. I threw my big mess away and 
would like to start from scratch.

Could anyone point me to a web page or other documentation that shows a 
SIMPLE example of encryption? I need two-way encryption & decryption, 
not a one-way hash. I'll be using this to obfuscate get parameters.

Any pointers appreciated. Thanks all,
- Brian
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php editor

2005-01-13 Thread Justin
Bret Hughes wrote:
I am interested to hear what other folks are using.
Bret
Since I do Java, Python etc. on OSX/windows/Linux, I'm using Eclipse 
with the PHPEclipse (PHPEclipse.de), I'm just starting PHP, but I'm 
pretty happy with it so far. One thing I am wondering about is the 
situation which Debugging in PHP4 / PHP5. Is there a Debugger for PHP?

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


Re: [PHP] regex help

2005-01-13 Thread Jochem Maas
Jason Morehouse wrote:
Hello,
I normally can take a bit of regex fun, but not this time.
Simple enough, in theory... I need to match (count) all of the bold tags 
in a string, including ones with embedded styles (or whatever else can 
go in there).   and .  My attempts keep matching 
 as well.
okay, you didn't show the regexp you currently have no worries - I 
happen to have struck the same problem about 9 months ago when I had to 
screenscrape product info from a static site for importation into a DB,
heres a list of regexps which will hopefully give you enough info to
do what you want (the fifth regexp is the one you should look at most 
closely):

// strip out top and bottom
$str = preg_replace('/<[\/]?html>/is','',$str);
// strip out body tags
$str = preg_replace('/<[\/]?body[^>]*>/is','',$str);
// strip out head
$str = preg_replace('/.*<[\/]head>/Uis','',$str);
// strip out non product images
$str = 
preg_replace('/]*(nieuw|new|euro)\.gif[^>]*\/?>/Uis','',$str);
// strip out font, div, span, p, b
$str = preg_replace('/<[\/]?(font|div|span|p|b[^r])[^>]*>/Uis','',$str);
// table, td, tr attributes
$str = preg_replace('/<(table|td|tr)[^>]*>/Uis','<$1>',$str);
// strip out the first table and hr?
$str = preg_replace('/.*/Uis','',$str, 1);
// strip table, td, tr
$str = preg_replace('/<[\/]?(table|td|tr|h5)>/Ui','',$str);
// strip out all new lines
$str = str_replace("\n", '', $str);
// strip out tabs
$str = preg_replace('/[\011]+/', ' ', $str);
// strip out extra white space
$str = preg_replace('/[  ]+/', ' ', $str);


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


RE: [PHP] php editor

2005-01-13 Thread welly limston
i'm usually use Dreamweaver to edit php code
and debug in it
it's very help ones us 
why don't u try
 
HTH

phpninja <[EMAIL PROTECTED]> wrote:
"Know any goog ones?"

funny you should mention goog.. if you google'd "php editor" youd have
your answer by now..

cheers
phpninja

-Original Message-
From: William Stokes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 13, 2005 8:02 AM
To: php-general@lists.php.net
Subject: [PHP] php editor

Hello,

I'm quite new with writing php code. I was considering of using some kind of
php editor program to help with the syntax. Know any goog ones?

Thanks
-Will

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



-
Do you Yahoo!?
 Yahoo! Mail - Easier than ever with enhanced search. Learn more.

Re: [PHP] Begining CVS

2005-01-13 Thread Jochem Maas
Greg Donald wrote:
On Thu, 13 Jan 2005 19:29:36 +0100, Zouari Fourat <[EMAIL PROTECTED]> wrote:
...

I'd go with Subversion.  I switched from CVS about 6 months ago and
haven't had any issues.

Greg,
I hardly dare ask, but here goes anyway... do you use a visual client 
for subversion? the reason I ask is that I found cvs a nightmare until 
someone pointed me to tortoiseCVS - which is just too easy to use!
And I just noticed tortoiseSVN exists which seems to be the subversion 
counterpart...(can't tell if the projects/devs are related or whether 
the name is merely a little mark of respect towards its cvs counterpart)

Also did you step over to subversion out of need for extra functionality 
or was it originally down to curiosity - personally I'm still struggling 
with the concepts of branches and tag too much to dive in and learn even 
more powerful functionality.

BTW: I just want to reiterate that I'm sorry for offending you in the 
first place and the fact that my attempt at humour missed the mark.

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


Re: [PHP] geographic search engine

2005-01-13 Thread Lester Caine
Symbulos Partners wrote:
Lester Caine wrote:
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.
Interesting. Is it an open project?
It will be, but bandwidth is a bit low at present. It will be moving to 
the Firebird Data Archive at some point.
I'll be working on a first cut of the 'areas' table tomorrow.

http://www.spanner.org/postcodes/ is something that is already available.
I have tried to connect, but it does not work.
It was - I grabbed a download earlier to see if they have any better 
data that us ;) but have not had a chance to look at it yet :(

--
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] php editor

2005-01-13 Thread GH
On linux I use thee KDE IDE program...


On Thu, 13 Jan 2005 14:02:17 -0600, Greg Donald <[EMAIL PROTECTED]> wrote:
> On Thu, 13 Jan 2005 18:02:12 +0200, William Stokes <[EMAIL PROTECTED]> wrote:
> > I'm quite new with writing php code. I was considering of using some kind of
> > php editor program to help with the syntax. Know any goog ones?
> 
> vim.org
> editplus.com
> 
> Both support PHP syntax highlighting.
> 
> --
> 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
> 
>

-- 
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-13 Thread Richard Lynch
Kelly wrote:
> Well I think you have the variable problem fixed.  Worked like a charm.
>  But I think I spoke to soon about the mail feature.  I cannot get it to
> mail a form.  Could I have not turned something else on?

There are many things you could have done wrong.

One of them is not correctly setting up your mail program in php.ini,
which is  kind of like not turning register_globals "ON" except that you
*SHOULD* set up your email program in php.ini, and you should *NOT* turn
register_globals "ON"

Meanwhile, you should also check the return value of mail() and you should
check your mail logs for whatever program you think is sending your email.

-- 
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] mysql improved extensions affected_rows

2005-01-13 Thread Richard Lynch
Tom wrote:
> I've just started playing with the php5 improved mysqli extensions.
>
> I have the following code:-
>
>  $mysqlim = new mysqli("localhost", "myUser", "myPassword","myDB");
>
> $updateQuery = "UPDATE client SET status = 'INACTIVE' WHERE clientName =
> 'Tom'";
>
> if ($mysqli->query($updateQuery))
> {
> $updateCount = $mysqli->affected_rows;
> echo "updateCount = $updateCount";
> }
> else
> {
> excpetionHandler("updateFailed: ".$updateQuery);
> }
> ?>
>
>
> This returns "updateCount = 1"
> However, when I check the underlying table, there are actually 4 rows
> updated (and yes, before anyone asks, I have repeated this several
> times, correctly resetting the data before each run)
>
> Is this a known bug, or am I doing something stupid?
> (php 5.0.2, apache 2.0.49)

How many rows actually had 'Tom' for their clientName?...

I mean, is the '1' wrong because it should be 4, or is it changing records
it shouldn't?

-- 
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] [HAB] Force Browsers to encode in utf8

2005-01-13 Thread Richard Lynch
OOzy Pal wrote:
> My html templates are encoded using utf-8. When the
> browser reads the files as .html it encodes it fine
> and my characters looks fine. However, when php reads
> the files and sends them to the browser the files
> looks ugly and unreadable. How can I force the broswer
> to encode the pages in utf-8.

http://php.net/header

You'll need to send that char-encoding header thingie, I suspect.

-- 
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] calling php functions as library or cmd line

2005-01-13 Thread Cere Davis
Does anyone know how to write php  libraries in a modular way so that you
can both test the libraries/functions on the command line with arguments
and/or use the php library as a part of your web code with 'require_once()'
syntax?  Sort of like how Python or Ruby works?

Thanks,
Cere

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



[PHP] Preventing execution without inclusion

2005-01-13 Thread Adam Hubscher
From within the application, I use one page to include 
classes/variables and so on. Is there a way (I may have been missing it 
in the documentation for PHP, however I didnt see anything related) to 
prevent a user from directly accessing/executing *.php by the file 
making sure taht it was only included by index.php?

For example:
config.php defines:
function __autoload($class_name) {

$class_name = strtolower($class_name);
include_once('class.'.$class_name.'.php');
}
as per PHP5 example
1 (the preferred way): user accesses 
http://www.example.org/index.php?function=Join, this loads the class 
NewUser and begins its implementation. Because of the __autoload, it 
includes class.join.php, in order to utilize the class.

2 (the wrong way): user accesses 
http://www.example.org/includes/class.join.php without going through 
index.php.

I am trying to prevent 2 from even occuring, utilizing a piece of code 
that would check if index.php had included it, or not. This code would 
be in the beginning of all the class files, at the top, before any other 
 code was to be executed.

As of yet, it has eluded me...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] delete part of array

2005-01-13 Thread Leif Gregory
Hello Jochem,

Thursday, January 13, 2005, 10:55:35 AM, you wrote:
J> heh but who says I'm not a bar steward ;-)

 I'll take a beer then! I need one after today.

J> sorry if it came accross a little harsh, but I stand by the point
J> that the onus is on the person asking the question to give an
J> indication as to what he has done to try and help him/her-self -
J> spoonfeeding is for babies, not programmers.

I apologize too. Here I am, the moderator and owner of five other
lists harping on my users to not reply too quickly, and here I go and
do it.

Isn't that one of the moderator credos though? "Do as I say, not as I
do?" :-)

I agree that handing someone the silver platter every time they ask
isn't the right way to do it, but I don't mind sharing what I've
learned either.


J> so my point stands - if your going to help why not grab the nearest
J> shell and test by way of a php -r ''? takes just along
J> as writing both versions in the mail and makes _you_ look better
J> IMHO.

True 'nuff.


J> indeed it is! thanks for the tip :-) ,

np :-)


J> I might add though that people choose a close/fast mirror rather
J> than www.php.net itself to help offload some of the traffic - my
J> preferred mirror is always way faster the www.php.net, which is a
J> nice when your hitting the manual 20+ times a day.

I can agree with that. I'll fix mine.


J> BTW: took me a few mins to figure out where to set this: in the
J> bookmarks details dialog (via the bookmark manager - and possibly
J> other routes) if anyone else is interested.

Do you reckon you can handle two "I think"'s is a 24 hour period?


I think you can do this in IE too, but it's more difficult. When I
used to use IE way back when, I think I set up google as my search
engine instead of MSN and did something like that.

It coulda all been a dream too... :-)


J> I personally couldn't tell what exactly he wanted to filter out of
J> his array (false, '' or NULL) or whether he cared about the
J> difference in this case. I was merely trying to encourage porper
J> understanding of the function rather than using something which
J> works under the current conditions

I wasn't quite sure either but thought I'd give it a shot.

At any rate, getting OT.

Talk at you later. It's time to go home and play with the baby's mama.



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



[suspicious - maybe spam] [PHP] [suspicious - maybe spam] strange in MySQL Query.

2005-01-13 Thread adwin wijaya
Hi...
I have an query for mysql that looks like:
SELECT "group" as type FROM mytable WHERE id ="101010"
UNION
SELECT "individual" as type FROM myothertable WHERE id="101010"
The strange result if only one result displayed from myothertable, so 
the "type" will become "indiv" instead of individual.

But when I tried to switch the query become :
SELECT "individual" as type FROM myothertable WHERE id="101010"
UNION
SELECT "group" as type FROM mytable WHERE id ="101010"
it could displaye the result correctly. I dont know why .. is this mysql 
bug ?

--
===
Best Regards
Adwin Wijaya
http://masterkuya.blogspot.com/
http://www.kuya-kuya.net
http://www.e-rhema.net
===

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