[PHP] Re: Sorting multidim array and keeping associations

2004-11-17 Thread Peter Lauri
I have tried to figure it out how to use it with those, but I can not find a
solution.

- Best Of Times
/Peter


"Sebastian Mendel" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Peter Lauri wrote:
> > Best groupmember,
> >
> > I have an multidim array that looks something like this:
> >
> > [40] => [1]=32, [2]=>55, ["total"]=>87
> > [22] => [8]=2, [7]=>105, ["total"]=>107
> > [142] => [2]=3, [7]=>8, ["total"]=>11
> >
> > I want to sort this array according to the "total" and still keep the
acc.
> > with the basekey. I know I can easily do this by writing an function
myself.
> > But are there any built in functions for this? I have looked at usort,
> > uksort and more, but they do not seem to solve my problem.
>
> uksort() or array_multisort() should do fine
>
> --
> Sebastian Mendel
>
> www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com
> www.sf.net/projects/phpdatetimewww.sf.net/projects/phptimesheet

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



Re: [PHP] PHP Supremacy...

2004-11-17 Thread Jeffery Fernandez
Octavian Rasnita wrote:
What do you mean by "perl discontinued"?
Perl 5 is continuu updated and this year I have seen perl 5.8.1, 5.8.3,
5.8.4, 5.8.5 is almost done.
 

That was meant to be a JOKE lol
Perl 6 is planned to run in a precompiled code (like Java programs) in an
environment that will also be able to run programs created in other
programming languages like Python...
For the programs that output web pages PHP is prefered even it is not so
complex like perl for the moment, because PHP is especially created for this
job.
I have seen a web page in which Yahoo explained why they have chosen PHP as
their programming language  for their dynamic web pages and not ASP, java or
C or perl.
(But they say that they also use perl programs for their backend tasks).
(and not ASP or Cold Fusion or other proprietary languages)
Teddy
- Original Message - 
From: "Mike" <[EMAIL PROTECTED]>
To: "'Lista de Php-General'" <[EMAIL PROTECTED]>
Sent: Thursday, November 18, 2004 2:05 AM
Subject: RE: [PHP] PHP Supremacy...

I was really sad to see Perl discontinued so many years ago... damned open
source community not taking care of it's own.
-Original Message-
From: Pedro Irán Méndez Pérez [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 17, 2004 5:18 PM
To: Lista de Php-General
Subject: [PHP] PHP Supremacy...
Hello my friends, I need your help in convince to my boss in adopt php for
 

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


Re: [PHP] PHP Supremacy...

2004-11-17 Thread Octavian Rasnita
What do you mean by "perl discontinued"?

Perl 5 is continuu updated and this year I have seen perl 5.8.1, 5.8.3,
5.8.4, 5.8.5 is almost done.

Perl 6 is planned to run in a precompiled code (like Java programs) in an
environment that will also be able to run programs created in other
programming languages like Python...

For the programs that output web pages PHP is prefered even it is not so
complex like perl for the moment, because PHP is especially created for this
job.

I have seen a web page in which Yahoo explained why they have chosen PHP as
their programming language  for their dynamic web pages and not ASP, java or
C or perl.
(But they say that they also use perl programs for their backend tasks).
(and not ASP or Cold Fusion or other proprietary languages)

Teddy

- Original Message - 
From: "Mike" <[EMAIL PROTECTED]>
To: "'Lista de Php-General'" <[EMAIL PROTECTED]>
Sent: Thursday, November 18, 2004 2:05 AM
Subject: RE: [PHP] PHP Supremacy...


I was really sad to see Perl discontinued so many years ago... damned open
source community not taking care of it's own.

-Original Message-
From: Pedro Irán Méndez Pérez [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 17, 2004 5:18 PM
To: Lista de Php-General
Subject: [PHP] PHP Supremacy...

Hello my friends, I need your help in convince to my boss in adopt php for

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



Re: [PHP] PHP 4 to 5 class issues involving static methods and $this

2004-11-17 Thread Klaus Reimer
Chris wrote:
How can I rewrite my class for PHP 5 to emulate the functionality I had 
in  PHP 4 in an error free way?
Have you tried this:
function format_string($string) {
// format the string...
$result = string;
if (isset($this)) $this->elements[] = $result;
return $result;
}
In this form you can check the existance of $this. If you call the 
method statically then $this is not present and the elements array is 
not filled. If you call it non-statically then $this is present and 
elements is filled. The same you can do with show_all().

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


[PHP] Subscription Request

2004-11-17 Thread sujis sakethram
Hello sir,

 Previously i was subscribed to this list with
email id [EMAIL PROTECTED] but it is geniune account
that receives all important mails i mean from
companies and personal.

So, please subscribe me to this mail-id.

Thanking you sir,

  yours sincerely,
   Rajesh.B


Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

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



[PHP] Re: What should I name my base class?

2004-11-17 Thread Greg Beaver
Brent Clements wrote:
I know this probably doesn't matter, but what is the pretty standard naming
convention for base class names?
Should I name it "base.class", "main.class", or the name of my application,
"application.class"?
What does everyone else use?
Avoid base classes like the plague.  They only limit future flexibility. 
  Use inheritance like salt - as an enhancement for flavoring, 
otherwise you might develop high blood pressure ;).  Better is to use 
delegation, factory or singleton as a way to access needed features, 
because then you can easily plug in new base functionality.

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


Re: [PHP] mp3 cropping

2004-11-17 Thread Ryan King
On Nov 17, 2004, at 10:05 PM, Robby Russell wrote:
On Wed, 2004-11-17 at 21:53 -0600, Ryan King wrote:
Anyone out there know of a tool or technique for cropping an MP3 file
(e.g., cutting the first 30 sec out into another file)? PHP would be
nice, but not necessary.
TIA,
ryan
a php question would be nice, but not necessary. :-p

An bit of help would be nice, but not necessary.
-ryan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mp3 cropping

2004-11-17 Thread Ryan King
On Nov 17, 2004, at 10:05 PM, Robby Russell wrote:
On Wed, 2004-11-17 at 21:53 -0600, Ryan King wrote:
Anyone out there know of a tool or technique for cropping an MP3 file
(e.g., cutting the first 30 sec out into another file)? PHP would be
nice, but not necessary.
TIA,
ryan
a php question would be nice, but not necessary. :-p
An
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] debug_backtrace bug?

2004-11-17 Thread Greg Beaver
Marek Kilimajer wrote:
The 'class' index reflects what __CLASS__ constant would show. Bug report:
http://bugs.php.net/22960
Status: It works as expected and intended.
right, but this states that __CLASS__ is bar inside bar::b() and is foo 
inside foo::b().  In this case, debug_backtrace() is reporting that 
__CLASS__ is foo inside bar::b().

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


Re: [PHP] mp3 cropping

2004-11-17 Thread Robby Russell
On Wed, 2004-11-17 at 21:53 -0600, Ryan King wrote:
> Anyone out there know of a tool or technique for cropping an MP3 file 
> (e.g., cutting the first 30 sec out into another file)? PHP would be 
> nice, but not necessary.
> 
> TIA,
> ryan
> 

a php question would be nice, but not necessary. :-p


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


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


RE: [PHP] How do I get referer in php?

2004-11-17 Thread Zareef Ahmed


Hi
  use 

Print $_SERVER['HTTP_REFRER'];

But some time browser do not send it properly so please check it with
another browser if fails.

Zareef Ahmed 


-Original Message-
From: John Holmes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 18, 2004 3:39 AM
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] How do I get referer in php?


John Nichel wrote:
> M. Sokolewicz wrote:
> 
>>> I'm sure he meant
>>>
>>> echo '',print_r($_SERVER,1),'';
> 
> ---^---^
> 
>>> then... ;)
>>>
>> hadn't noticed that param... I feel ashamed... :$
>>
> Didn't notice that those were commas and not periods either, eh? ;)

Didn't notice the result is the same either way, eh? ;)

-- 

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals - www.phparch.com

-- 


--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



[PHP] mp3 cropping

2004-11-17 Thread Ryan King
Anyone out there know of a tool or technique for cropping an MP3 file 
(e.g., cutting the first 30 sec out into another file)? PHP would be 
nice, but not necessary.

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


Re: [PHP] how to parse a string parse with ereg

2004-11-17 Thread Jason Wong
On Thursday 18 November 2004 06:51, [EMAIL PROTECTED] wrote:

> Well this work's fine in the case the user input is correct :-)
>
> But it's not required to proof in the case I would assume that a
> user input is correct.
>
> To explode with the device as line break to allocate an array mem
> lead's not to an error as this line it won't be in the array.

I meant explode each *line* (at the EOL character(s)), so this:

xxx.x.x.x |  0.0.0.0 255.255.255.255 UH 0 |  |  | 0 |  |  |  | 0 ppp0

is an element of the array. And this:

192.168.0.0 0.0.0.0 255.255.255.0 U |  | 0 |  |  | 0 |  |  |  | 0 eth1

is another element, etc.

> 0.0.0.0 |  |  xxx.x.x.x 0.0.0.0 |  |  UG |  0 |  |  | 0 |  |  |  | 0
>
> E.g. Line 3 won't be in an array. This could maybe be caused from
> drop & paste to copy from a shell into the browser while using
> an extraordinary OS.

Then you can process each line separately but in groups 3 lines at a time 
(assuming they're supposed to be groups of 3).

> ***
> The only solution which should be better now for me is to proof
> for 3 ip addresses in a row to be able to count how much
> of this matching construct in a result is as basis for a difference.
> Then I'am able to compare this with matching lines where the
> device has been taken to explode.
>
> The difference lead's now to an error as the syntax is wrong.

If you state clearly, in detail, what exactly you want the regex to match then 
maybe someone could construct a better one for you. 

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
* Knghtbrd crosses his toes
 (if I crossed my fingers it would be hard to type)
*/

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



Re: [PHP] PHP Supremacy...

2004-11-17 Thread Jason Wong
On Thursday 18 November 2004 06:55, Matthew Sims wrote:

> If Microsoft one day decides to stop work on .NET or goes out of business,
> well then that's just too bad. It's proprietary, belongs only to Microsoft
> and no one has access to the source code to continue its work.

If the demand is there someone would just write a clone of .NET.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
BOFH Excuse #344:

Network failure -  call NBC
*/

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



[PHP] How can i compile a separate module manually

2004-11-17 Thread 成應元
I downloaded php-4.3.9.tar.gz and compiled it in FreeBSD 5.2, the steps I
followed as below:
1) tar zxvf php-4.3.9.tar.gz
2) cd php-4.3.9
3) ./configure --with-ftp
4) cd ext
5)
cc -fpic -DCOMPILE_DL=1 -I/usr/local/include -I. -I.. -I../Zend -I../main -I
../TSRM -c -o ftp.o ftp/php_ftp.c
6) cc -shared -L/usr/local/lib -rdynamic -o ftp.so ftp.o
Up to now, no error happened.
Then I made a example file named test.php as following:



When I executed the file test.php(php -f test.php),  error happened:

Warning: dl(): Invalid library (maybe not a PHP library) 'ftp.so'  in
/usr/home/yingyuan/src/php-4.3.9/ext/test.php on line 2

What makes such error? And How can I compile a extension module by this way?

Thanks.

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



Re: [PHP] Question regarding constructors and child classes

2004-11-17 Thread Jordi Canals
Hi,

Comment inline

On Wed, 17 Nov 2004 20:19:01 -0600, Brent Clements
<[EMAIL PROTECTED]> wrote:
> 
>  
> class foo {
> 
>   function foo () {
> 
> echo "constructed!";
> 
> }
> 
> }
> 
> class childFoo extends foo {
> 
> function childFoo() {
> 

// here you should call the parent constructor:
   parent::foo()
// also you could do this other way (I prefer the one above):
   $this->foo()

> echo "constructed also!";
> 
> }
> 
> }
> 
> $a = new childFoo();
> 
> ?>
> 
> Is there any way to run both the parent and child constructor? 

http://www.php.net/manual/en/language.oop.constructor.php
http://www.php.net/manual/en/language.oop5.decon.php

Regards,
Jordi.

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



Re: [PHP] PHP Supremacy...

2004-11-17 Thread Jordi Canals
On Wed, 17 Nov 2004 16:17:44 -0600, Pedro Irán Méndez Pérez
<[EMAIL PROTECTED]> wrote:

> Hello my friends, I need your help in convince to my boss in adopt php for
> development of a tool for intranet in my office, he told me that php is open
> source and we don´t know if will disappear in a year, or if php have a
> support like .net.
> 
> what arguments can I show for convince him to try PHP?
> 

You know that PHP will not disapear in a year, as it is Open Source
and anybody can take it and do what he wants with the source code ...
Also there are important companies that have PHP based bussines (Zend
for example).

Well, the first thing you must tell him is that Microsoft has
demonstred that changes technologies at his own interests. When a new
version is released you have to update if you want support. As the
source code is closed, nobody else than MS can maintain the code, so
you're married with them. And of course, any upgrade means lots of
money.

If you choose the MS platform, Microsoft will decide when you should
upgrade, if you look at PHP, you have not to upgrade to PHP-5 if PHP4
covers yours needs, as PHP4 continues maintained and patched.

Developing in dotNET means that you will not be able to change your
platform in the future. As it only runs on Windows, you cannot change
in the future. Choosing PHP gives you the freedom to change your
systems when you want. You can concentrate in your development and
don't worry about the platform what will host your scriuts: PHP will
run in that platform. You know PHP is available for ANY platform:
Windows, Linux. Solaris, FreeBSD, and all sort of Unix ...

Also, if you choose PHP, you will easly find lots of ready-made
scripts to help you in your work and to speed-up your developments.
You know, there are tons of sites and projects that provides you with
scripts for almost any purpose and with free open source license. Make
a search in Google and compare results of free code available written
in PHP and in dotNET.

Also the learning curve for PHP is really short. You can quickly start
with simple scripts and scale fast ...

If you thing about hosting companies, most of them support PHP, and
only some support dotNet hosting ... in that price is a factor, as the
companies must pay licenses for Windows and dotNet, when they can give
the same services with Linux+PHP, so, hosting PHP scripts is always
cheaper than hosting dotNET pages.

Now, some info taken from the web:

Taken from the Oracle website. Good article that tells why Oracle
chooses PHP at http://www.oracle.com/technology/pub/articles/hull_asp.html

PHP 4   PHP 5   ASP.NET
Software price  freefreefree
Platform price  freefree$$
Speed   strong  strong  weak
Efficiency  strong  strong  weak
Securitystrong  strong  strong
Platformstrong  strong  weak (IIS only)
Platformany any win32 (IIS only)
Source availableyes yes no
Exceptions  no  yes yes
OOP weakstrong  strong

Also, you can point to some well known companies that use PHP (From
the Zend Website) :

Lucent Technologies
McGrawn Hill
Lycos
Lufthansa
Hewlett Packard
Nortel Networks
AMD
Siemens
Apple
UPS
Bausch & Lomb

Also you will find interesting comparisions and articles if you search
at Google:
php vs asp.net
why choose php over asp.net?

Regards,
Jordi.

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



[PHP] Question regarding constructors and child classes

2004-11-17 Thread Brent Clements
If I have the following: 

 

 

 



 

 

 

Is there any way to run both the parent and child constructor? The reason
I'm asking this is because in my parent class, the constructor creates the
database connection, in the child constructor it set's up all variables for
the child class.

 

 If I recall, I can do a "parent::constructorname()", is there a way to call
the parent's constructor more cleanly, to me , stylewise, it looks funny to
have parent::foo().

 

 

 

How would I do this?

 

 

 

-Brent



[PHP] Segmentation Fault

2004-11-17 Thread Jerry Swanson
I have  index.php file. 
On one server it executes with no problem. 
On another server it gives me Segmentation Fault error.

4.3.2 - Segmentation Fault
4.3.4 - no problem

What can cause such problem? This is simple login page.

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



Re: [PHP] What should I name my base class?

2004-11-17 Thread John Holmes
Brent Clements wrote:
I know this probably doesn't matter, but what is the pretty standard naming
convention for base class names?
Should I name it "base.class", "main.class", or the name of my application,
"application.class"?
Application.class.php
If you name it application.class, it'll more than likely be served up as 
plain text and "main" or "base" are too generic. You could end up with 
conflicts with other programs that haven't thought this out.

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


Re: [PHP] Auto Class loading

2004-11-17 Thread Jordi Canals
On Wed, 17 Nov 2004 19:17:13 -0200, Bruno B B Magalhães
<[EMAIL PROTECTED]> wrote:

> Continuing the classes questions...
> 
> I have a class loader called 'load_core_class($class=''), but if $class
> equals to all I would like to load all classes in the core directory,
> include then AND start then this way:
> 

If you're on PHP-5 you could use the __autoload function, so when a
class is used will be automatically locaded. You should declare this
function before using any class:

function __autoload($classname)
{
require_once('/path/to/classes/dir/' . $classname . '.inc');
}

Regards,
Jordi.

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



[PHP] What should I name my base class?

2004-11-17 Thread Brent Clements
I know this probably doesn't matter, but what is the pretty standard naming
convention for base class names?

 

Should I name it "base.class", "main.class", or the name of my application,
"application.class"?

 

 

 

What does everyone else use?

 

If I went by the pear standards, they use a base class name of "pear.php" so
I probably would go with "application.class" or "application.php"

 

Thanks,

Brent



[PHP] database adapters

2004-11-17 Thread Justin French
Hi,
Just upgraded to PHP5 and MySQL 4.1, so I'm keen to try out the 
mysqli_* functions, SQLite, etc etc.

What I'm trying to decide here is if I should go with PHP's dbx module, 
or accept the fact that it's going to be quite rare for me to switch 
databases once an application is live, and just write a bunch of simple 
adapters to mysql, mysqli, etc so that I have a choice *at the time I 
start building*.

There's a few nice reference articles arguing for adapters:
http://jeremy.zawodny.com/blog/archives/002194.html
http://www.allinthehead.com/retro/213/scalability-vs-performance
But no one has really discussed the DBX module, it's performance, etc.
Any wisdom from the group?
Any articles on writing some simple adapters?
TIA
Justin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: PHP Supremacy...

2004-11-17 Thread Brian Dunning
what arguments can I show for convince him to try PHP?
http://www.php.net/usage.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] pear integration

2004-11-17 Thread Rayan Lahoud
Hy,
 
i installed the pear manager on my php5 on windows, bur i am having some 
problems with running files that use the pecl packages. I am having this error:
 
Warning: main(Inline_C.php) [function.main]: failed to open stream: No such 
file or directory in c:\wamp\www\test.php on line 3

Fatal error: main() [function.require]: Failed opening required 'Inline_C.php' 
(include_path='.;c:\wamp\php\pear') in c:\wamp\www\test.php on line 3
 
Knowing that i have changed the include_path variable in php.ini to 
c:\wamp\php\pear, what should i do to fix this problem?
 
(in fact i installed the wamp5_1.3.2)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[PHP] IBM Universe + PHP

2004-11-17 Thread daniel
Hi there, I am coming here as a last resort (yes I have thoroughly
googled) . Work has purchased aad space sales application that uses a U2 low 
level database. I am having
extreme issues trying toget PHP on unix to be able to talk to this database or 
sync it with mysql.
We have the I386 versionon cd , it comes with the server and odbc client 
driver. I have managed to
connect on windowsfine, what I am trying to work out is how to get an odbc 
connection via
PHP. I have been in searchfor a unix driver for universe with no success :| 
Would a DB2 driver work
? I havent tried it yet, if icould find a unix .so style driver for Universe i 
could connect easily via
iodbc and the odbcextension right ? If anyone has had a success story please 
let me know
thanks.
Daniel

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



[PHP] Re: PHP Supremacy...

2004-11-17 Thread Matthew Weier O'Phinney
* Pedro irán méndez pérez <[EMAIL PROTECTED]>:
> Hello my friends, I need your help in convince to my boss in adopt php
> for development of a tool for intranet in my office, he told me that
> php is open source and we don´t know if will disappear in a year, or
> if php have a support like .net.
>
> what arguments can I show for convince him to try PHP?

Even if PHP were to disappear, you'd still have it installed on your
intranet -- and I assume you make backups. 

In addition, 'open source' should imply that it *won't* disappear.
Proprietary products exist at the whim of the company producing them.
Microsoft could decide next year that .NET is a failure... and it would
be gone. Microsoft could decide to exit the software biz and go into
hardware... and .NET would be gone. PHP, on the other hand, will have
its source code out available for anyone to modify -- and if one
developer stops working on it, others will come forward to fill the
void.

PHP is also free; you won't need to pay a cent for it. The same is not
true of .NET, and you may actually have to pay for it again and again,
based on the license you purchase. Because PHP is free, you can also
prototype your intranet without spending a cent -- which might be
something you want to do to show your boss what PHP can do.

As for support, again, with .NET, you have to pay for support (although
there are a number of free forums out there). With PHP, your primary
means of support are free -- these mailing lists/newsgroups, forums,
etc. You can always opt for paid support through companies like Zend,
but it's doubtful you'll need to do so.

Additionally, PHP has been around quite a number of years. I first heard
of it before I ever heard mention of .NET. I'd say that the fact PHP has
been around as long as it has gives some indication of its staying power
in the future.

(And, for the record: our intranet is PHP based.)

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

2004-11-17 Thread Mike
I was really sad to see Perl discontinued so many years ago... damned open
source community not taking care of it's own.

-Original Message-
From: Pedro Irán Méndez Pérez [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 17, 2004 5:18 PM
To: Lista de Php-General
Subject: [PHP] PHP Supremacy...

Hello my friends, I need your help in convince to my boss in adopt php for
development of a tool for intranet in my office, he told me that php is open
source and we don´t know if will disappear in a year, or if php have a
support like .net.

what arguments can I show for convince him to try PHP?

Thank you very much :)

 =
"¿Acaso se olvidará la mujer de su bebé, y dejará de compadecerse del hijo
de su vientre? Aunque ellas se olviden, yo no me olvidaré de ti"

Isa 40:27
 =

Atte   Pedro Irán Méndez Pérez

-- 
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] debug_backtrace bug?

2004-11-17 Thread Marek Kilimajer
The 'class' index reflects what __CLASS__ constant would show. Bug report:
http://bugs.php.net/22960
Status: It works as expected and intended.
Thomas Peri wrote:
I wanted to run this past the list before submitting a bug report.  
(I've searched the bugs and haven't found anything relevant to my problem.)

The problem is that when s method of one class is overridden in a 
subclass, debug_backtrace() doesn't distinguish between the two 
methods.  For example, this code:

class A {
function __construct() {
$bt = debug_backtrace();
foreach ($bt as $t)
print $t['class']."::".$t['function']."";
}
}

class B extends A {
function __construct() {
parent::__construct();
}
}

$b = new B();

...produces this output:
B::__construct
B::__construct
...instead of the output I'd expect:
A::__construct
B::__construct
It happens for regular methods also, not just constructors.  Is this a 
bug, or is this behavior correct for some reason?  (Tested in php 5.0.0, 
5.0.1, and 5.0.2)

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


[PHP] Re: PHP Supremacy...

2004-11-17 Thread Chris
On Wed, 17 Nov 2004 16:17:44 -0600, Pedro irÃn mÃndez pÃrez  
<[EMAIL PROTECTED]> wrote:

Hello my friends, I need your help in convince to my boss in adopt php  
for
development of a tool for intranet in my office, he told me that php is  
open
source and we donÂt know if will disappear in a year, or if php have a
support like .net.

what arguments can I show for convince him to try PHP?

How do you know .NET will still be around?  Microsoft has dropped support  
for a number of products in the past.  What ever happened to J++ anyway?

--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP 4 to 5 class issues involving static methods and $this

2004-11-17 Thread Greg Beaver
Chris wrote:
I have a class where I need to be able to use the methods as static  
methods as well as using them inside an initialized class.  Here's an  
example of what I need to do:

class my_class {
var $elements = array(); // holds all of my elements
function format_string($string) {
// format the string...
return $this->elements[] = $string;
}
function show_all() {
return implode("\n", $this->elements);
}
}
This worked fine in PHP 4.  It silently ignored the $this->elements[]  
assignment in statically called methods and just returned my formatted  
string without any fuss.  However, in PHP 5, I understand that I'm now  
required to declare the method format_string as public static if I want 
to  just call my_class::format_string(), and if I want to use $elements 
inside  a static method, it also requires being declared as static.  I 
also  understand that I can't use $this inside a statically called 
method.  I've  tried these things, but they don't seem to help.

How can I rewrite my class for PHP 5 to emulate the functionality I had 
in  PHP 4 in an error free way?
elements[] = $rm->invoke(null, $args);
} catch (ReflectionException $e) {}
}
}
static_my_class::format_string('a');
$a = new my_class;
$a->format_string('a');
?>
Greg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: debug_backtrace bug?

2004-11-17 Thread Greg Beaver
Thomas Peri wrote:
I wanted to run this past the list before submitting a bug report.  
(I've searched the bugs and haven't found anything relevant to my problem.)

The problem is that when s method of one class is overridden in a 
subclass, debug_backtrace() doesn't distinguish between the two 
methods.  For example, this code:

class A {
function __construct() {
$bt = debug_backtrace();
foreach ($bt as $t)
print $t['class']."::".$t['function']."";
}
}

class B extends A {
function __construct() {
parent::__construct();
}
}

$b = new B();

...produces this output:
B::__construct
B::__construct
...instead of the output I'd expect:
A::__construct
B::__construct
It happens for regular methods also, not just constructors.  Is this a 
bug, or is this behavior correct for some reason?  (Tested in php 5.0.0, 
5.0.1, and 5.0.2)
This looks like a bug to me, open a report.
Greg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How do I get referer in php?

2004-11-17 Thread John Holmes
John Nichel wrote:
M. Sokolewicz wrote:
I'm sure he meant
echo '',print_r($_SERVER,1),'';
---^---^
then... ;)
hadn't noticed that param... I feel ashamed... :$
Didn't notice that those were commas and not periods either, eh? ;)
Didn't notice the result is the same either way, eh? ;)
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] PHP Supremacy...

2004-11-17 Thread Vail, Warren
Because among 17 million installed domains, and because the Open Source is
"open", someone in those 17 million domains will keep it going.

http://www.php.net/usage.php

Some people never get it, you confuse them with too many facts, hope your
manager has an open mind.

Warren Vail


> -Original Message-
> From: Matthew Sims [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, November 17, 2004 2:55 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP Supremacy...
> 
> 
> > Hello my friends, I need your help in convince to my boss 
> in adopt php 
> > for development of a tool for intranet in my office, he 
> told me that 
> > php is open source and we don´t know if will disappear in a 
> year, or 
> > if php have a support like .net.
> >
> > what arguments can I show for convince him to try PHP?
> >
> > Thank you very much :)
> 
> If the original developers of PHP decide to stop working on 
> PHP, anyone can pick it up and continue developing it since 
> it's open source.
> 
> If Microsoft one day decides to stop work on .NET or goes out 
> of business, well then that's just too bad. It's proprietary, 
> belongs only to Microsoft and no one has access to the source 
> code to continue its work.
> 
> Seeing the major breakthrough PHP has made in the past few 
> years, does your boss really think PHP is going away?
> 
> I see that Perl is still around.
> 
> -- 
> --Matthew Sims
> --
> 
> -- 
> 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] Auto Class loading

2004-11-17 Thread Marek Kilimajer
Bruno B B MagalhÃes wrote:
Continuing the classes questions...
I have a class loader called 'load_core_class($class=''), but if $class 
equals to all I would like to load all classes in the core directory, 
include then AND start then this way:

$this->$loadedclassname = new $loadedclassname;
Is it possible?
Yes.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How do I get referer in php?

2004-11-17 Thread John Nichel
M. Sokolewicz wrote:
I'm sure he meant
echo '',print_r($_SERVER,1),'';
---^---^
then... ;)
hadn't noticed that param... I feel ashamed... :$
Didn't notice that those were commas and not periods either, eh? ;)
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP 4 to 5 class issues involving static methods and $this

2004-11-17 Thread Chris
I have a class where I need to be able to use the methods as static  
methods as well as using them inside an initialized class.  Here's an  
example of what I need to do:

class my_class {
var $elements = array(); // holds all of my elements
function format_string($string) {
// format the string...
return $this->elements[] = $string;
}
function show_all() {
return implode("\n", $this->elements);
}
}
This worked fine in PHP 4.  It silently ignored the $this->elements[]  
assignment in statically called methods and just returned my formatted  
string without any fuss.  However, in PHP 5, I understand that I'm now  
required to declare the method format_string as public static if I want to  
just call my_class::format_string(), and if I want to use $elements inside  
a static method, it also requires being declared as static.  I also  
understand that I can't use $this inside a statically called method.  I've  
tried these things, but they don't seem to help.

How can I rewrite my class for PHP 5 to emulate the functionality I had in  
PHP 4 in an error free way?

--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] fwrite() seems to destroy Special Characters

2004-11-17 Thread Dennis Lahay
I'm having trouble with writing special charcaters to a text file. The 
characters are your run-of-the-mill accented characters. Passing them 
back and forth in the database and displaying them on screen is NOT a 
problem.

code snippet:
$row = mysql_fetch_array($query_result, MYSQL_ASSOC);
foreach ($exportOrder as $key => $value) { // makes tab-delimited file 
from array
if (array_key_exists($key, $row)) {
$bigString .= $row[$key] . "\t";
} else {
$bigString .= "\t";
}
}
print $bigString;
$filename = "../../../Volumes/FILEJOB/DB Art IN/" . 
$row['currentSVVersion'];
if (!$file = fopen($filename, 'w+')) {
print "Cannot open file ($filename)";
exit;
}
fwrite($file, $bigString);
fclose($file);

I print the string immediately before I write the file. It looks like 
this (i hope this formats correctly for the list):
INGRÉDIENTS : VINAIGRE, EAU, GRAINES DE MOUTARDE, SEL, CURCUMA, ÉPICES 
À Â Æ Ç È É Ê Ë Î Ï Ô Û Ü Œ

I write the file, open it up in BBEdit (or your favorite text editor) 
and it looks like this:
INGR…DIENTS : VINAIGRE, EAU, GRAINES DE MOUTARDE, SEL, CURCUMA, …PICES 
¿ ¬ ? « » …   À †Œ œ ‘ € ‹ å

Why would I lose those special characters when writing to a text file? 
How can I avoid this? The text file will be opened offline, so using 
É and other character entities won't work.

I've tried:
 - $file = fopen($filename, 'w+b'); adding binary flag doesn't affect 
anything
 - Iooking at php.ini; nothing stood out

Any suggestions? [Mac OSX 10.3.6 : PHP 4.3.2 : MySQL 4.0.18 : Apache 
1.3.29]

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



Re: [PHP] how to parse a string parse with ereg

2004-11-17 Thread Mark-Walter
Hi,

> I have to admit I'm not following you. My suggestion that you use explode() 
> was based on the premise that you have a bunch of lines:
> 
> ...
> xxx.x.x.x   0.0.0.0 255.255.255.255 UH 0      0        0 ppp0
> 192.168.0.0 0.0.0.0 255.255.255.0 U    0      0        0 eth1
> 0.0.0.0     xxx.x.x.x 0.0.0.0     UG   0      0        0 ppp0
> ...
> that are currently stored in a string. After explode() you can use foreach() 
> to loop through the array and check each line individually. Then based on 
> whether the line passes the check you could either:
> 
> a) unset that array element (doesn't pass check so get rid of it)
> or
> b) copy that element to a new array (passes check so store it in a 'good' 
> array)
> Either way you'll end up with an array containing only 'good' lines.

Well this work's fine in the case the user input is correct :-)

But it's not required to proof in the case I would assume that a
user input is correct.

To explode with the device as line break to allocate an array mem 
lead's not to an error as this line it won't be in the array.

xxx.x.x.x |  0.0.0.0 255.255.255.255 UH 0 |  |  | 0 |  |  |  | 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U |  | 0 |  |  | 0 |  |  |  | 0 eth1
0.0.0.0 |  |  xxx.x.x.x 0.0.0.0 |  |  UG |  0 |  |  | 0 |  |  |  | 0

E.g. Line 3 won't be in an array. This could maybe be caused from 
drop & paste to copy from a shell into the browser while using
an extraordinary OS.

***
The only solution which should be better now for me is to proof
for 3 ip addresses in a row to be able to count how much
of this matching construct in a result is as basis for a difference. 
Then I'am able to compare this with matching lines where the 
device has been taken to explode.

The difference lead's now to an error as the syntax is wrong.

The only problem which still remains is the case the device 
is missing __AND__ there're not 3 following ip addresses. This user
input data is not going to be proofed but it seems to be better 
than before.

And for sure normally the user input should be correct :-) 

-- 
Best Regards, 

Mark 

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



Re: [PHP] PHP Supremacy...

2004-11-17 Thread Matthew Sims
> Hello my friends, I need your help in convince to my boss in adopt php for
> development of a tool for intranet in my office, he told me that php is
> open
> source and we don´t know if will disappear in a year, or if php have a
> support like .net.
>
> what arguments can I show for convince him to try PHP?
>
> Thank you very much :)

If the original developers of PHP decide to stop working on PHP, anyone
can pick it up and continue developing it since it's open source.

If Microsoft one day decides to stop work on .NET or goes out of business,
well then that's just too bad. It's proprietary, belongs only to Microsoft
and no one has access to the source code to continue its work.

Seeing the major breakthrough PHP has made in the past few years, does
your boss really think PHP is going away?

I see that Perl is still around.

-- 
--Matthew Sims
--

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



Re: [PHP] PHP Supremacy...

2004-11-17 Thread Robby Russell
On Wed, 2004-11-17 at 16:17 -0600, Pedro IrÃn MÃndez PÃrez wrote:
> Hello my friends, I need your help in convince to my boss in adopt php for
> development of a tool for intranet in my office, he told me that php is open
> source and we donÂt know if will disappear in a year, or if php have a
> support like .net.
> 
> what arguments can I show for convince him to try PHP?
> 
> Thank you very much :)


The internet might disappear in a year..and then PHP could disappear as
well. 

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


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


Re: [PHP] How to assure that php.ini is being obeyed?

2004-11-17 Thread Mailit, LLC
Yes, I restarted httpd and ran phpinfo() to check if the parameter 
values were being recognized by php.
Two different Linux servers respond differently to the same change in 
php.ini.
That is why I suspect that my server has some basic setting that 
overrides everything that I do for php.
I am asking this question because my situation looks unique and the 
answer might be ridiculous.
Challenging, huh?

Jay Blanchard wrote:
[snip]
Did anybody have this experience before?
[/snip]
Just out of curiosity, did you restart Apache after you made the changes
to the php.ini?
 

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


[PHP] PHP Supremacy...

2004-11-17 Thread Pedro Irán Méndez Pérez
Hello my friends, I need your help in convince to my boss in adopt php for
development of a tool for intranet in my office, he told me that php is open
source and we don´t know if will disappear in a year, or if php have a
support like .net.

what arguments can I show for convince him to try PHP?

Thank you very much :)

 =
"¿Acaso se olvidará la mujer de su bebé, y dejará de compadecerse del hijo
de su vientre? Aunque ellas se olviden, yo no me olvidaré de ti"

Isa 40:27
 =

Atte   Pedro Irán Méndez Pérez

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



Re: [PHP] How do I get referer in php?

2004-11-17 Thread M. Sokolewicz
John Holmes wrote:
M. Sokolewicz wrote:
Chris W. Parker wrote:
  echo "",print_r($_SERVER),"";

why are you echoing the result of print_r ?! The result is a boolean 
true or false. the actual output ON SCREEN is done from WITHIN the 
function automatically. Echoing the result is useless, and even more, 
it adds to confusion because of a '1' appearing all of a sudden on 
screen.

I'm sure he meant
echo '',print_r($_SERVER,1),'';
then... ;)
hadn't noticed that param... I feel ashamed... :$
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] How do I get referer in php?

2004-11-17 Thread Chris W. Parker
John Nichel 
on Wednesday, November 17, 2004 2:01 PM said:

> M. Sokolewicz wrote:
>>> I'm sure he meant
>>> 
>>> echo '',print_r($_SERVER,1),'';
>  ---^---^
> 
>>> then... ;)
>>> 
>> hadn't noticed that param... I feel ashamed... :$
>> 
> 
> Didn't notice that those were commas and not periods either, eh? ;)

yeah gosh i guess some people just don't know all the in's and out's of
php!! :P

but seriously, i never add the second parameter to print_r(). i've just
gotten used to the 1 that shows up and i just ignore it.



chris.

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



Re: [PHP] How to assure that php.ini is being obeyed?

2004-11-17 Thread Mailit, LLC
I set display_errors, startup_errors, track_errors On in php.ini, 
restarted Apache and reran an upload session.
The only error message displayed upon attempt to upload a large file is 
"This document contains no data"
The specified log file is empty.
I am using Apache 2.0, but could not find LimitRequestBody in httpd.conf
I am not desperate, because the other server is working with large 
files. But I am really curious on why this
server has this limitation.
M. Sokolewicz wrote:

Sebastian Mendel wrote:
Llc Mailit wrote:
My problem: To upload large files.
Although /etc/php.ini on my Linux server specifies
upload_max_filesize = 8M
post_max_size = 8M
only files smaller than 512 kB are uploaded, while larger files fail 
with message
"This document contains no data"

quota?
free space?
try setting display_errors and startup_errors on
try track_errors with on
also, when using apache 1.3.2 or later, see the LimitRequestBody 
directive.

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


[PHP] Auto Class loading

2004-11-17 Thread Bruno B B Magalhães
Continuing the classes questions...
I have a class loader called 'load_core_class($class=''), but if $class 
equals to all I would like to load all classes in the core directory, 
include then AND start then this way:

$this->$loadedclassname = new $loadedclassname;
Is it possible?
Regards,
Bruno B B Magalhaes
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How do I get referer in php?

2004-11-17 Thread John Holmes
M. Sokolewicz wrote:
Chris W. Parker wrote:
  echo "",print_r($_SERVER),"";
why are you echoing the result of print_r ?! The result is a boolean 
true or false. the actual output ON SCREEN is done from WITHIN the 
function automatically. Echoing the result is useless, and even more, it 
adds to confusion because of a '1' appearing all of a sudden on screen.
I'm sure he meant
echo '',print_r($_SERVER,1),'';
then... ;)
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How do I get referer in php?

2004-11-17 Thread M. Sokolewicz
Chris W. Parker wrote:
Brent Clements 
on Wednesday, November 17, 2004 11:55 AM said:

Let's say I have a page at another site that links to a php script on
my server. Is there anyway to get the referrer to the php script
using php? 

Yes, and more.

  echo "",print_r($_SERVER),"";
why are you echoing the result of print_r ?! The result is a boolean 
true or false. the actual output ON SCREEN is done from WITHIN the 
function automatically. Echoing the result is useless, and even more, it 
adds to confusion because of a '1' appearing all of a sudden on screen.

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


Re: [PHP] How do I get referer in php?

2004-11-17 Thread Robby Russell
On Wed, 2004-11-17 at 13:54 -0600, Brent Clements wrote:
> Let's say I have a page at another site that links to a php script on my
> server. Is there anyway to get the referrer to the php script using php?
> 
>  

Look in the $_SERVER array.

-Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


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


RE: [PHP] How do I get referer in php?

2004-11-17 Thread Chris W. Parker
Brent Clements 
on Wednesday, November 17, 2004 11:55 AM said:

> Let's say I have a page at another site that links to a php script on
> my server. Is there anyway to get the referrer to the php script
> using php? 

Yes, and more.

",print_r($_SERVER),"";

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



Re: [PHP] How do I get referer in php?

2004-11-17 Thread Randy Rinehart
Yes, you should be able to use

$_SERVER['HTTP_REFERER'];

-Randy Rinehart



- Original Message - 
From: "Brent Clements" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 17, 2004 1:54 PM
Subject: [PHP] How do I get referer in php?


> Let's say I have a page at another site that links to a php script on my
> server. Is there anyway to get the referrer to the php script using php?
> 
>  
> 
> Thanks,
> 
> Brent
> 
>  
> 
> 

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



[PHP] How do I get referer in php?

2004-11-17 Thread Brent Clements
Let's say I have a page at another site that links to a php script on my
server. Is there anyway to get the referrer to the php script using php?

 

Thanks,

Brent

 



RE: [PHP] How to assure that php.ini is being obeyed?

2004-11-17 Thread Jay Blanchard
[snip]
Did anybody have this experience before?
[/snip]

Just out of curiosity, did you restart Apache after you made the changes
to the php.ini?

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



RE: [PHP] adding a symbol in front of each line

2004-11-17 Thread Jay Blanchard
[snip]
> You should get yourself a *real* mail client :)

Cut Jay some slack.  There's not too many clients available out there 
for the TSR-80. ;)
[/snip]

Oh great! Now my secret is out! What am I going to do when fossil fuels
become a thing of the past?

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



[PHP] Re: Sorting multidim array and keeping associations

2004-11-17 Thread Peter Lauri
I have tried to figure it out how to use it with those, but I can not find a
solution.

- Best Of Times
/Peter


"Sebastian Mendel" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Peter Lauri wrote:
> > Best groupmember,
> >
> > I have an multidim array that looks something like this:
> >
> > [40] => [1]=32, [2]=>55, ["total"]=>87
> > [22] => [8]=2, [7]=>105, ["total"]=>107
> > [142] => [2]=3, [7]=>8, ["total"]=>11
> >
> > I want to sort this array according to the "total" and still keep the
acc.
> > with the basekey. I know I can easily do this by writing an function
myself.
> > But are there any built in functions for this? I have looked at usort,
> > uksort and more, but they do not seem to solve my problem.
>
> uksort() or array_multisort() should do fine
>
> --
> Sebastian Mendel
>
> www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com
> www.sf.net/projects/phpdatetimewww.sf.net/projects/phptimesheet

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



[PHP] debug_backtrace bug?

2004-11-17 Thread Thomas Peri
I wanted to run this past the list before submitting a bug report.  
(I've searched the bugs and haven't found anything relevant to my 
problem.)

The problem is that when s method of one class is overridden in a 
subclass, debug_backtrace() doesn't distinguish between the two 
methods.  For example, this code:

class A {
function __construct() {
$bt = debug_backtrace();
foreach ($bt as $t)
print $t['class']."::".$t['function']."";
}
}

class B extends A {
function __construct() {
parent::__construct();
}
}

$b = new B();
...produces this output:
B::__construct
B::__construct
...instead of the output I'd expect:
A::__construct
B::__construct
It happens for regular methods also, not just constructors.  Is this a 
bug, or is this behavior correct for some reason?  (Tested in php 
5.0.0, 5.0.1, and 5.0.2)

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


Re: [PHP] How to assure that php.ini is being obeyed?

2004-11-17 Thread Jason Wong
On Thursday 18 November 2004 01:32, Mailit, LLC wrote:
> My problem: To upload large files.
> Although /etc/php.ini on my Linux server specifies
> upload_max_filesize = 8M
> post_max_size = 8M
> only files smaller than 512 kB are uploaded, while larger files fail
> with message
> "File contains no data"
> Everything happens as if php.ini were being ignored, although the
> parameters in question appear
> with correct values on the table generated by phpinfo()
> It is failing on my server, but on another server upload works as
> defined by /etc/php.ini
> It must be something in the initialization of the server, or apache, but
> I don't know where to look.

Raditha, where are you? This is your area of expertise :)

http://www.radinks.com/upload/config.php

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Choose two:
(A) Fast
(B) Efficient
(C) Stable
(D) Windows 95 (counts as two)
*/

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



[PHP] Re: How to assure that php.ini is being obeyed?

2004-11-17 Thread M. Sokolewicz
Sebastian Mendel wrote:
Llc Mailit wrote:
My problem: To upload large files.
Although /etc/php.ini on my Linux server specifies
upload_max_filesize = 8M
post_max_size = 8M
only files smaller than 512 kB are uploaded, while larger files fail 
with message
"File contains no data"
Everything happens as if php.ini were being ignored, although the 
parameters in question appear
with correct values on the table generated by phpinfo()
It is failing on my server, but on another server upload works as 
defined by /etc/php.ini
It must be something in the initialization of the server, or apache, 
but I don't know where to look.
Did anybody have this experience before?

quota?
free space?
try setting display_errors and startup_errors on
try track_errors with on
also, when using apache 1.3.2 or later, see the LimitRequestBody directive.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] adding a symbol in front of each line

2004-11-17 Thread John Nichel
Jason Wong wrote:
On Thursday 18 November 2004 00:45, Jay Blanchard wrote:

Yeah, I know. I hit reply-to-all and got that. Force of habit.

You should get yourself a *real* mail client :)
Cut Jay some slack.  There's not too many clients available out there 
for the TSR-80. ;)

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


[PHP] Re: How to assure that php.ini is being obeyed?

2004-11-17 Thread Sebastian Mendel
Llc Mailit wrote:
My problem: To upload large files.
Although /etc/php.ini on my Linux server specifies
upload_max_filesize = 8M
post_max_size = 8M
only files smaller than 512 kB are uploaded, while larger files fail 
with message
"File contains no data"
Everything happens as if php.ini were being ignored, although the 
parameters in question appear
with correct values on the table generated by phpinfo()
It is failing on my server, but on another server upload works as 
defined by /etc/php.ini
It must be something in the initialization of the server, or apache, but 
I don't know where to look.
Did anybody have this experience before?
quota?
free space?
try setting display_errors and startup_errors on
try track_errors with on
--
Sebastian Mendel
www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com
www.sf.net/projects/phpdatetimewww.sf.net/projects/phptimesheet
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] How to assure that php.ini is being obeyed?

2004-11-17 Thread Mailit, LLC
My problem: To upload large files.
Although /etc/php.ini on my Linux server specifies
upload_max_filesize = 8M
post_max_size = 8M
only files smaller than 512 kB are uploaded, while larger files fail 
with message
"File contains no data"
Everything happens as if php.ini were being ignored, although the 
parameters in question appear
with correct values on the table generated by phpinfo()
It is failing on my server, but on another server upload works as 
defined by /etc/php.ini
It must be something in the initialization of the server, or apache, but 
I don't know where to look.
Did anybody have this experience before?
Thanks

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


[PHP] Re: Array unset

2004-11-17 Thread Greg Beaver
Bruno b b magalhães wrote:
So, the question, how resort the numeric values to 1,2,3,4?
http://www.php.net/array_values
Greg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] adding a symbol in front of each line

2004-11-17 Thread Jason Wong
On Thursday 18 November 2004 00:45, Jay Blanchard wrote:

> Yeah, I know. I hit reply-to-all and got that. Force of habit.

You should get yourself a *real* mail client :)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I'm thinking about DIGITAL READ-OUT systems and computer-generated
IMAGE FORMATIONS ...
*/

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



Re: [PHP] adding a symbol in front of each line

2004-11-17 Thread Jason Wong
On Wednesday 17 November 2004 23:15, Merlin wrote:

> actually that is not as easy as it looks.

Nowhere in your original post did you specify what exactly it is you wanted.

> Lets say we want to ad a \n after each 80 characters. There is always the
> problem what happens if the line has already a \n inside.
>
> E.g:
> This is a sample text. This is a sample text.
> This is a sample text
>
> Should result in:
>  > This is a sample text. This is a
>  > sample text.
>  > This is a sample text
>
> That looks very complicated to me. Can anybody point me into the right
> direction? Thanx for any help,

If it's only one level of '>' that you need to add then it's pretty easy using 
the wordwrap() function. If you need to handle multiple levels then it will 
get very complicated, and you should probably google for some algorithms.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Isn't it strange that the same people that laugh at gypsy fortune
tellers take economists seriously?
*/

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



[PHP] Re: Array unset

2004-11-17 Thread Sebastian Mendel
Bruno b b magalhães wrote:
The problem is that when I delete an specific array, it outputs  
something like this:

(
[0] => Array
(
[moduleId] => 4
[moduleName] => Contents
[modulePath] => contents
[moduleAliasPath] =>
[moduleController] => administration
[moduleLevel] => 5
[moduleOrder] => 0
[moduleVisibility] => 1
[moduleType] => none
[moduleStatus] => 1
)
[2] => Array
(
[moduleId] => 1
[moduleName] => System
[modulePath] => system
[moduleAliasPath] =>
[moduleController] => administration
[moduleLevel] => 5
[moduleOrder] => 2
[moduleVisibility] => 1
[moduleType] => default
[moduleStatus] => 1
)
[3] => Array
(
[moduleId] => 2
[moduleName] => Logout
[modulePath] => logout
[moduleAliasPath] =>
[moduleController] => administration
[moduleLevel] => 5
[moduleOrder] => 3
[moduleVisibility] => 1
[moduleType] => alias
[moduleStatus] => 1
)
)
So, the question, how resort the numeric values to 1,2,3,4?
which "numeric values" ?
--
Sebastian Mendel
www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com
www.sf.net/projects/phpdatetimewww.sf.net/projects/phptimesheet
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] adding a symbol in front of each line

2004-11-17 Thread Jay Blanchard
[snip]
It's usually not a good idea to include the author in your reply unless
they 
specifically asked to be CC'ed. There's little value in receiving two
copies 
of the same post.
[/snip]

Yeah, I know. I hit reply-to-all and got that. Force of habit.

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



Re: [PHP] Images problem

2004-11-17 Thread Phpu
It's working  Thanks a lot


- Original Message - 
From: "Randy Rinehart" <[EMAIL PROTECTED]>
To: "Phpu" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, November 17, 2004 6:29 PM
Subject: Re: [PHP] Images problem


> I believe you can use imagecopymerged to do this.
> 
> http://us2.php.net/manual/en/function.imagecopymerge.php
> 
> please let me know if that helps.
> 
> Thanks
> 
> -randy rinehart
> 
> - Original Message - 
> From: "Phpu" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, November 17, 2004 10:05 AM
> Subject: [PHP] Images problem
> 
> 
> If i have 2 images:
> 
> $im1 = imagecreate (100, 100);
> $white = ImageColorAllocate ($im1, 255, 255, 255);
> 
> 
> $im2 = imagecreate (50, 50);
> $black = ImageColorAllocate ($im2, 0, 0, 0);
> 
> 
> How can i put $im2 over $im1 and result one single image? Is there a
> function to do this?
> 
> Thank You
> 
> 

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



RE: [PHP] Images problem

2004-11-17 Thread Mike
If you're looking for a way to merge images, look at imagecopyresized()

If you're going to be doing a lot with images in PHP, it's good to spend a
lot of time reading the images section of the manual - there's a lot in
there and all with somewhat similar names - it can get confusing at first.

-M 

-Original Message-
From: Phpu [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 17, 2004 11:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Images problem

If i have 2 images:

$im1 = imagecreate (100, 100); 
$white = ImageColorAllocate ($im1, 255, 255, 255);


$im2 = imagecreate (50, 50); 
$black = ImageColorAllocate ($im2, 0, 0, 0);


How can i put $im2 over $im1 and result one single image? Is there a
function to do this?

Thank You

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



[PHP] Re: File Handing Windows / Linux

2004-11-17 Thread Sebastian Mendel
Steve Vernon wrote:
Hiya!
I am trying to make some code which gets a handle to a directory, but has
different code for my localhost (Windows) and for online (Linux server). 

Basically, I want either of the below lines. Say if the first fails, it must
be on Linux and then it uses the line below. 

The two example lines are:
  @ $handle =
opendir("c:/websites/mywebsite/extra/photos/".$_GET['page']."/");
  @ $handle =
opendir("/home/mywebsite/public_html/extra/photos/".$_GET['page']."/");
Had a search on google, but not really sure what to look for!
why not ry relative path?
$handle = opendir("./extra/photos/".$_GET['page']."/");
--
Sebastian Mendel
www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com
www.sf.net/projects/phpdatetimewww.sf.net/projects/phptimesheet
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Sorting multidim array and keeping associations

2004-11-17 Thread Sebastian Mendel
Peter Lauri wrote:
Best groupmember,
I have an multidim array that looks something like this:
[40] => [1]=32, [2]=>55, ["total"]=>87
[22] => [8]=2, [7]=>105, ["total"]=>107
[142] => [2]=3, [7]=>8, ["total"]=>11
I want to sort this array according to the "total" and still keep the acc.
with the basekey. I know I can easily do this by writing an function myself.
But are there any built in functions for this? I have looked at usort,
uksort and more, but they do not seem to solve my problem.
uksort() or array_multisort() should do fine
--
Sebastian Mendel
www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com
www.sf.net/projects/phpdatetimewww.sf.net/projects/phptimesheet
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Images problem

2004-11-17 Thread Eakin, W
Phpu wrote:
If i have 2 images:
$im1 = imagecreate (100, 100); 
$white = ImageColorAllocate ($im1, 255, 255, 255);

$im2 = imagecreate (50, 50); 
$black = ImageColorAllocate ($im2, 0, 0, 0);

How can i put $im2 over $im1 and result one single image? Is there a 
function to do this?
Thank You
 

this looks like what you need
http://www.php.net/manual/en/function.imagecopymerge.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] adding a symbol in front of each line

2004-11-17 Thread Jason Wong
On Wednesday 17 November 2004 23:33, Jay Blanchard wrote:

> And your e-mail address keeps getting bounced...
>
> The following recipient(s) could not be reached:

It's usually not a good idea to include the author in your reply unless they 
specifically asked to be CC'ed. There's little value in receiving two copies 
of the same post.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Goldenstern's Rules:
 (1) Always hire a rich attorney
 (2) Never buy from a rich salesman.
*/

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



Re: [PHP] Images problem

2004-11-17 Thread Randy Rinehart
I believe you can use imagecopymerged to do this.

http://us2.php.net/manual/en/function.imagecopymerge.php

please let me know if that helps.

Thanks

-randy rinehart

- Original Message - 
From: "Phpu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 17, 2004 10:05 AM
Subject: [PHP] Images problem


If i have 2 images:

$im1 = imagecreate (100, 100);
$white = ImageColorAllocate ($im1, 255, 255, 255);


$im2 = imagecreate (50, 50);
$black = ImageColorAllocate ($im2, 0, 0, 0);


How can i put $im2 over $im1 and result one single image? Is there a
function to do this?

Thank You

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



[PHP] Images problem

2004-11-17 Thread Phpu
If i have 2 images:

$im1 = imagecreate (100, 100); 
$white = ImageColorAllocate ($im1, 255, 255, 255);


$im2 = imagecreate (50, 50); 
$black = ImageColorAllocate ($im2, 0, 0, 0);


How can i put $im2 over $im1 and result one single image? Is there a function 
to do this?

Thank You

[PHP] Re: DOS-textfile?

2004-11-17 Thread Felipe Alcacibar
Gustav:

  Christopher give you the differences within unix, dos [return]
characters.. you can use chop() perl function to strip carrige return of the
strings, example:

$line = chop(fgets($fileHandler, 1024));

also  you can use str_replace:

function file2unix($stringFile)
{
return /* mac case */ str_replace("\r", "\n", /* dos case */
str_replace("\r\n/", "\n",  $stringFile));
}

$line = file2unix(fgets($fileHandler, 1024));

I can use preg_replace but can't find /(\r\n|\r)/ but maybe it finds the
alone carrige returns and not the carrige return with the newline after...


<[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Hello!
>
> I have a problem. I have som code in PHP that creates a textfile. The code
> is on a Linux-server, but when creating the textfile it is in Mac-mode. I
> can convert the textfile to DOS-textfile through TextPad (An editor), but
> I want the textfile to be in DOS-mode through the PHP-code. Can I do
> that???
>
> /Gustav Wiberg
> Swedish site:
> http://www.varupiraten.se/

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



RE: [PHP] how to show errors in browser

2004-11-17 Thread Jack . van . Zanen
Hi 


In your PHP.INI there is a section that will take care of that

;;
; Error handling and logging ;
;;

; error_reporting is a bit-field.  Or each number up to get desired error
; reporting level
; E_ALL - All errors and warnings
; E_ERROR   - fatal run-time errors
; E_WARNING - run-time warnings (non-fatal errors)
; E_PARSE   - compile-time parse errors
; E_NOTICE  - run-time notices (these are warnings which often
result
; from a bug in your code, but it's possible that it was
; intentional (e.g., using an uninitialized variable and
; relying on the fact it's automatically initialized to
an
; empty string)
; E_CORE_ERROR  - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING- warnings (non-fatal errors) that occur during PHP's
; initial startup
; E_COMPILE_ERROR   - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR  - user-generated error message
; E_USER_WARNING- user-generated warning message
; E_USER_NOTICE - user-generated notice message
;
; Examples:
;
;   - Show all errors, except for notices
;
;error_reporting = E_ALL & ~E_NOTICE
;
;   - Show only errors
;
;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
;
;   - Show all errors except for notices
;
error_reporting  =  E_ALL & ~E_NOTICE

-Original Message-
From: Rayan Lahoud [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 17, 2004 3:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] how to show errors in browser


Hy, i am opening php files from my browser. If there are some errors in the
php file i can not see what are the errors in the browser
 
Can anyone help please?


-
Do you Yahoo!?
 Discover all that's new in My Yahoo!

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



RE: [PHP] adding a symbol in front of each line

2004-11-17 Thread Jay Blanchard
[snip]
...
[/snip]

And your e-mail address keeps getting bounced...

The following recipient(s) could not be reached:

  [EMAIL PROTECTED] on 11/17/2004 9:31 AM
The e-mail account does not exist at the organization this
message was sent to.  Check the e-mail address, or contact the recipient
directly to find out the correct address.
< our.mailserver.com #5.1.1 SMTP; 550 <[EMAIL PROTECTED]>
Benutzer hat zuviele Mails auf dem Server. / User has too many messages
on the server.>

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



RE: [PHP] adding a symbol in front of each line

2004-11-17 Thread Jay Blanchard
[snip]
That looks very complicated to me. Can anybody point me into the right 
direction? Thanx for any help,
[/snip]

strip the \n from the existing text first, then

'>' . $line . '\n'

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



Re: [PHP] adding a symbol in front of each line

2004-11-17 Thread Merlin
Chris Boget wrote:
Hi there,
I would like to add a > symbol infront of each line I pull out of a
database.
Similar to the function seen in online e-mail clients when you click on
reply.
Has anybody an idea on how to add a symbol in front of each line?`

Should be simple enough using explode() followed by implode().
thnx,
Chris
Hi,
actually that is not as easy as it looks.
Lets say we want to ad a \n after each 80 characters. There is always the 
problem what happens if the line has already a \n inside.

E.g:
This is a sample text. This is a sample text.
This is a sample text
Should result in:
> This is a sample text. This is a
> sample text.
> This is a sample text
That looks very complicated to me. Can anybody point me into the right 
direction? Thanx for any help,

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


RE: [PHP] adding a symbol in front of each line

2004-11-17 Thread Jay Blanchard
[snip]
I would like to add a > symbol infront of each line I pull out of a
database. 
Similar to the function seen in online e-mail clients when you click on
reply.

Has anybody an idea on how to add a symbol in front of each line?`
[/snip]

Use a '.'

example --

while(!feof($file)){
   $line = fgets($file, 4096);
   $newLine = '>' . $line;
   echo $newLine;
}

HTH!

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



Re: [PHP] adding a symbol in front of each line

2004-11-17 Thread Chris Boget
> Hi there,
> I would like to add a > symbol infront of each line I pull out of a
database.
> Similar to the function seen in online e-mail clients when you click on
reply.
> Has anybody an idea on how to add a symbol in front of each line?`

Should be simple enough using explode() followed by implode().

thnx,
Chris

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



Re: [PHP] Problem typing in PHP forms on Mac OS

2004-11-17 Thread Brent Baisley
For the record, this is NOT a PHP problem. I have no problem on my Mac 
using Safari or FireFox, or even Camino .7. However, there is a problem 
using IE on the Mac. Which, if you have Mac users still using IE, you 
should tell them to cease and desist. It's a discontinued product. But, 
you may not be able to exert this amount of control.

The problem appears to be with the credit card number fields. I can 
enter data as long as I tab to the fields, but I can't click on them. 
When I do, I lose the cursor. My guess is that the problem is caused by 
you using the same id for all 4 credit number fields (id="cardnum"). 
id's are supposed to be unique and the validator should have flagged 
this.

My recommendation to you is fix EVERYTHING that the validator flags. 
It's the right thing to do and a good habit to get into. It will save 
you a lot of time in trying to troubleshoot problems like this. Second, 
download and use FireFox for testing your javascript and your page 
structure. Under the Tools menu there is an option for a Javascript 
Console which will show you anything wrong with your javascript code. 
There is also a DOM Inspector, which will help you troubleshoot the 
structure of your web page. On your javascript init() function you are 
not setting a default value for the block variable.

Most of the browsers on the Mac (and Linux) are adhering to internet 
standards, not to what will work in IE. Code to the standards and your 
web page will most likely just have cosmetic issues due to varying 
levels of support for CSS. There are a lot of things in your code that 
are not exactly wrong, but definitely not correct. You don't have a 
DOCTYPE declared (read up on it, it's important), this will affect how 
a browser will render your page and function. You don't specify which 
version of javascript you are coding to, that can affect how your 
javascript is run. You should declare a script block like this:

[PHP] Sorting multidim array and keeping associations

2004-11-17 Thread Peter Lauri
Best groupmember,

I have an multidim array that looks something like this:

[40] => [1]=32, [2]=>55, ["total"]=>87
[22] => [8]=2, [7]=>105, ["total"]=>107
[142] => [2]=3, [7]=>8, ["total"]=>11

I want to sort this array according to the "total" and still keep the acc.
with the basekey. I know I can easily do this by writing an function myself.
But are there any built in functions for this? I have looked at usort,
uksort and more, but they do not seem to solve my problem.

- Best Of Times
/Peter

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



[PHP] Sorting multidim array and keeping associations

2004-11-17 Thread Peter Lauri
Best groupmember,

I have an multidim array that looks something like this:

[40] => [1]=32, [2]=>55, ["total"]=>87
[22] => [8]=2, [7]=>105, ["total"]=>107
[142] => [2]=3, [7]=>8, ["total"]=>11

I want to sort this array according to the "total" and still keep the acc.
with the basekey. I know I can easily do this by writing an function myself.
But are there any built in functions for this? I have looked at usort,
uksort and more, but they do not seem to solve my problem.

- Best Of Times
/Peter

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



[PHP] adding a symbol in front of each line

2004-11-17 Thread Merlin
Hi there,
I would like to add a > symbol infront of each line I pull out of a database. 
Similar to the function seen in online e-mail clients when you click on reply.

Has anybody an idea on how to add a symbol in front of each line?`
Thanx for any hint,
Merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: File Handing Windows / Linux

2004-11-17 Thread Ing. Ivo F.A.C. Fokkema
On Sun, 14 Nov 2004 18:21:23 +0100, M. Sokolewicz wrote:

> Steve Vernon wrote:
> 
>> Hiya!
>> 
>> I am trying to make some code which gets a handle to a directory, but
>> has different code for my localhost (Windows) and for online (Linux
>> server).
>> 
>> Basically, I want either of the below lines. Say if the first fails, it
>> must be on Linux and then it uses the line below.
>> 
>> The two example lines are:
>> 
>>   @ $handle =
>> opendir("c:/websites/mywebsite/extra/photos/".$_GET['page']."/");
>>   @ $handle =
>> opendir("/home/mywebsite/public_html/extra/photos/".$_GET['page']."/");
>> 
>> Had a search on google, but not really sure what to look for!
>> 
>> Love,
>> 
>> Steve
>> XxX
> 
> if(false === ($handle =
> opendir("c:/websites/mywebsite/extra/photos/".$_GET['page']."/"))) {
> $handle =
> opendir("/home/mywebsite/public_html/extra/photos/".$_GET['page']."/");
> }

IMHO, it would be better to check the constant PHP_OS for the current OS
or check the current $_SERVER['HTTP_HOST'] to find out whether you are on
your local windows server or the linux server. So (not tested)

if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
@ $handle = 
opendir("c:/websites/mywebsite/extra/photos/".$_GET['page']."/");
} else {
@ $handle = 
opendir("/home/mywebsite/public_html/extra/photos/".$_GET['page']."/");
}

HTH,

Ivo

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



Re: [PHP] how to show errors in browser

2004-11-17 Thread Jason Wong
On Wednesday 17 November 2004 22:00, Rayan Lahoud wrote:
> Hy, i am opening php files from my browser. If there are some errors in the
> php file i can not see what are the errors in the browser

Put:

    error_reporting(E_ALL);
    ini_set('display_errors', TRUE);

at the beginning of your page.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
BOFH Excuse #310:

asynchronous inode failure
*/

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



Re: [PHP] Sorting...

2004-11-17 Thread Matt M.
> array (
>  20040310, Title, Author
>  20041115, Title, Author
>  20040513, Title, Author
>   )
> 
> where each array element is 1 line from the csv. When I go to print it
> out, Im going to explode each by , and then print it out the way I like.
> 
> BUT, I want to sort them all by those first 8 digits, which happen to be
> the date. Any way to sort an array by the first x characters in its
> string?
> 
> This would save a lot on processor time, otherwise Im going to have to
> pull an array of those characters, sort it, and then run some matching
> scheme against the CSV data to print it in the order I like - which would
> be HUGELY processor intensive.

I think sort should do it for you

$array = array("20040310, Title, Author",
"20041115, Title, Author",
"20040513, Title, Author");
sort($array);
reset($array);
while (list($key, $val) = each($array)) {
   echo "array[" . $key . "] = " . $val . "";
}

but, if you wanted to just make sure it was the first entry in the CSV try usort

function cmp($a, $b)
{   

   $first = explode(',', $a);   
   $second = explode(',', $b);  

   if ($first == $second) {
   return 0;
   }
   return ($first < $second) ? -1 : 1;
}


$array = array("20040310, Title, Author",
"20041115, Title, Author",
"20040513, Title, Author");
usort($array, "cmp");

while (list($key, $value) = each($array)) {
   echo "array[" . $key . "] = " . $value . "";
}

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



Re: [PHP] Sorting...

2004-11-17 Thread Francisco M. Marzoa Alonso
If each element of the array is a string with those contains, it should 
be sorted as you want just calling sort function. It will considerate 
also rest of characters, of course, but the most significative should be 
the first ones.

Another alternative is to wrote a quicksort function in PHP customized 
by yourself, but I cannot figure out if this will be faster (probably not).

Russell P Jones wrote:
I have an array filled with CSV data...
array (
20040310, Title, Author
20041115, Title, Author
20040513, Title, Author
 )
where each array element is 1 line from the csv. When I go to print it
out, Im going to explode each by , and then print it out the way I like.
BUT, I want to sort them all by those first 8 digits, which happen to be
the date. Any way to sort an array by the first x characters in its
string?
This would save a lot on processor time, otherwise Im going to have to
pull an array of those characters, sort it, and then run some matching
scheme against the CSV data to print it in the order I like - which would
be HUGELY processor intensive.
Thanks,
Russ
 

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


[PHP] Re: how to show errors in browser

2004-11-17 Thread Peter Lauri
Check the function error_reporting() or check the settings in the php.ini

- Best Of Times
/Peter


"Rayan Lahoud" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Hy, i am opening php files from my browser. If there are some errors in
the php file i can not see what are the errors in the browser
>
> Can anyone help please?
>
>
> -
> Do you Yahoo!?
>  Discover all that's new in My Yahoo!

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



Re: [PHP] Sorting...

2004-11-17 Thread Ramil Sagum
On Wed, 17 Nov 2004 09:03:12 -0500 (EST), Russell P Jones


<[EMAIL PROTECTED]> wrote:
> I have an array filled with CSV data...
>
> array (
>  20040310, Title, Author
>  20041115, Title, Author
>  20040513, Title, Author
>   )
>
> where each array element is 1 line from the csv. When I go to print it
> out, Im going to explode each by , and then print it out the way I like.
>
> BUT, I want to sort them all by those first 8 digits, which happen to be
> the date. Any way to sort an array by the first x characters in its
> string?
>

How about a non php solution? Maybe sort the lines in the CSV file
first using a sort command line utility (like "sort" in *nix), sample
to a temp file, then open that file in PHP



ramil

http://ramil.sagum.net


-- 


ramil

http://ramil.sagum.net

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



Re: [PHP] Saving thumbnails [SOLVED]

2004-11-17 Thread Phpu
I resolv the problem. Thanks anyway
- Original Message -
From: "Eakin, W" <[EMAIL PROTECTED]>
To: "Phpu" <[EMAIL PROTECTED]>
Sent: Wednesday, November 17, 2004 3:21 PM
Subject: Re: [PHP] Saving thumbnails


> Phpu wrote:
>
> >Hi,
> >I found a tutorial that creates thumbnails on the fly. The only problem
is that i want to save those thumbnails on the server.
> >
> >Could anyone help me?
> >
> >Thanks
> >
> >
> how does the script work? can you send me a link to the tutorial if it's
> on line? Recently I had to write something myself that might help you.
>

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



RE: [PHP] Saving thumbnails

2004-11-17 Thread Mike
Use imagejpeg()
http://us2.php.net/manual/en/function.imagejpeg.php

-M

-Original Message-
From: Phpu [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 17, 2004 6:23 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Saving thumbnails

Hi,
I found a tutorial that creates thumbnails on the fly. The only problem is
that i want to save those thumbnails on the server.

Could anyone help me?

Thanks

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



[PHP] Sorting...

2004-11-17 Thread Russell P Jones
I have an array filled with CSV data...

array (
 20040310, Title, Author
 20041115, Title, Author
 20040513, Title, Author
  )

where each array element is 1 line from the csv. When I go to print it
out, Im going to explode each by , and then print it out the way I like.

BUT, I want to sort them all by those first 8 digits, which happen to be
the date. Any way to sort an array by the first x characters in its
string?

This would save a lot on processor time, otherwise Im going to have to
pull an array of those characters, sort it, and then run some matching
scheme against the CSV data to print it in the order I like - which would
be HUGELY processor intensive.

Thanks,

Russ

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



[PHP] how to show errors in browser

2004-11-17 Thread Rayan Lahoud
Hy, i am opening php files from my browser. If there are some errors in the php 
file i can not see what are the errors in the browser
 
Can anyone help please?


-
Do you Yahoo!?
 Discover all that’s new in My Yahoo!

RE: [PHP] Efficency in looping arrays?

2004-11-17 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: Peter Lauri [mailto:[EMAIL PROTECTED] 
> Sent: 17 November 2004 12:11

> For the moment when I loop an array I use something like this:
> 
> reset($arr);
> while($a=each($arr)) {
> echo $a['value'];
> }
> 
> But the each() function genereates a array with four elements 
> (0,1,value, key), I am only interested in the "value".

foreach ($arr as $value)

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] Efficency in looping arrays?

2004-11-17 Thread Dirk Kredler
Hey again :)

Peter Lauri:
> But what if the array  have a unordered keystructure? What your loop do is
> to call the value with key $i, or am I wrong? What if the keys are strings?


$arr= array(1 => "dirk", 'wife' => "iris", 'dog' => "feivel", 'peter' => 
"lauri");
$values= array_values($arr);

for($i= 0, $size= sizeof($values); $i < $size; $i++) {
  echo $values[$i];
}

should work :)



> "Dirk Kredler" <[EMAIL PROTECTED]> skrev i meddelandet
> news:[EMAIL PROTECTED]
>
> > hey :)
> >
> > i use for this reason:
> >
> > for($i= 0, $size= sizeof($arr); $i < $size; $i++) {
> >   echo $arr[$i];
> > }
> >
> > Peter Lauri:
> > > Best groupmember,
> > >
> > > For the moment when I loop an array I use something like this:
> > >
> > > reset($arr);
> > > while($a=each($arr)) {
> > > echo $a['value'];
> > > }
> > >
> > > But the each() function genereates a array with four elements
>
> (0,1,value,
>
> > > key), I am only interested in the "value".

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



Re: [PHP] Efficency in looping arrays?

2004-11-17 Thread Peter Lauri
Probably, thank you :)

"Pluance" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> You mean this?
>
> foreach ($arr as $key => $value) {
>  echo "\$arr[${key}] = $value";
> }
>
> On Wed, 17 Nov 2004 14:05:23 +0100, Peter Lauri <[EMAIL PROTECTED]> wrote:
> > Hey :)
> >
> > But what if the array  have a unordered keystructure? What your loop do
is
> > to call the value with key $i, or am I wrong? What if the keys are
strings?
> >
> > - Best Of Times
> > /Peter Lauri
> >
> >
> > "Dirk Kredler" <[EMAIL PROTECTED]> skrev i meddelandet
> > news:[EMAIL PROTECTED]
> >
> >
> > > hey :)
> > >
> > > i use for this reason:
> > >
> > > for($i= 0, $size= sizeof($arr); $i < $size; $i++) {
> > >   echo $arr[$i];
> > > }
> > >
> > > Peter Lauri:
> > > > Best groupmember,
> > > >
> > > > For the moment when I loop an array I use something like this:
> > > >
> > > > reset($arr);
> > > > while($a=each($arr)) {
> > > > echo $a['value'];
> > > > }
> > > >
> > > > But the each() function genereates a array with four elements
> > (0,1,value,
> > > > key), I am only interested in the "value".
> > > >
> >
> > --
> > 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] Efficency in looping arrays?

2004-11-17 Thread Pluance
You mean this?

foreach ($arr as $key => $value) {
 echo "\$arr[${key}] = $value";
}

On Wed, 17 Nov 2004 14:05:23 +0100, Peter Lauri <[EMAIL PROTECTED]> wrote:
> Hey :)
> 
> But what if the array  have a unordered keystructure? What your loop do is
> to call the value with key $i, or am I wrong? What if the keys are strings?
> 
> - Best Of Times
> /Peter Lauri
> 
> 
> "Dirk Kredler" <[EMAIL PROTECTED]> skrev i meddelandet
> news:[EMAIL PROTECTED]
> 
> 
> > hey :)
> >
> > i use for this reason:
> >
> > for($i= 0, $size= sizeof($arr); $i < $size; $i++) {
> >   echo $arr[$i];
> > }
> >
> > Peter Lauri:
> > > Best groupmember,
> > >
> > > For the moment when I loop an array I use something like this:
> > >
> > > reset($arr);
> > > while($a=each($arr)) {
> > > echo $a['value'];
> > > }
> > >
> > > But the each() function genereates a array with four elements
> (0,1,value,
> > > key), I am only interested in the "value".
> > >
> 
> --
> 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



  1   2   >