Re: [PHP] Bizarre array create error

2007-07-31 Thread Richard Lynch
On Sun, July 29, 2007 5:49 pm, Ken Tozier wrote:
 I'm trying to assign two fields of an object returned from a MySQL
 query and have stumbled upon the most bizarre PHP bug where I can't
 create two arrays in succession.

 Here's the MySQL query with two dummy fields to be filled in later

 select *, 0 as dummy_1, 0 as dummy_2 from table

 Here's how I'm grabbing the query results

 $result   = array();
 while ($row = mysql_fetch_object($query_result))
 {
   $result[]   = $row;
 }

 Once that's done, I try to set two of the rows to arrays like this

 $result- dummy_1 = array(1, 2, 3, 4);
 $result- dummy_2 = array('a', 'b', 'c', 'd');

$result is an array and you are treating it like an object...

While this is supposed to work, I think, it's pretty confusing to this
naive reader...

$result['dummy_1'] = array(1, 2, 3, 4);

would make more sense...

And you do realize that your actual objects are ELEMENTS of the array
$result, not $result itself...

So maybe you want something more like:

$row1 = $result[0];
$row1-dummy_1 = array(1, 2, 3, 4);

That said, you're altering an Object that MySQL returned, and I've got
NO IDEA what kind of an object that is, or what you're allowed to cram
into its variables...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] $HTTP_POST_FILES always produces empty value.

2007-07-31 Thread Patrik Hasibuan
Thank you very much for your help, Richard.

It's solved.

On Tue, 31 Jul 2007 00:47:51 -0500 (CDT)
Richard Lynch [EMAIL PROTECTED] wrote:

 Try this:
 
 echo _FILES:br /\n;
 var_dump($_FILES);
 echo br /\nHTTP_POST_FILESbr /\n;
 var_dump($HTTP_POST_FILES);
 
 On Mon, July 30, 2007 7:00 am, Patrik Hasibuan wrote:
  Dear my friends
 
  I don't understand why $HTTP_POST_FILES always produces empty value.
 
  This is my code
  ===
  //cgi/cgiprodukcatalogadmin.php
  ?php
  $berkasgambarproduk=$HTTP_POST_FILES['gambarproduk']['name'];
  echo gambarproduk: $gambarprodukbr;
  echo berkasgambarproduk: $berkasgambarprodukbr;
  ?
  ===
  This is the output in my Opera internet browser:
  ===
  gambarproduk: /tmp/phppd6DZy
  berkasgambarproduk:
  ===
  this is my php.ini:
  ===
  
  ; File Uploads ;
  
 
  ; Whether to allow HTTP file uploads.
  file_uploads = On
 
  ; Temporary directory for HTTP uploaded files (will use system default
  if not
  ; specified).
  ;upload_tmp_dir =
  upload_tmp_dir = /srv/www/htdocs/tmpphp
 
  ; Maximum allowed size for uploaded files.
  upload_max_filesize = 100M
  ===
 
  Please tell me, where is my mistake?.
 
  Thank you very much in advance.
  --
  Patrik Hasibuan [EMAIL PROTECTED]
  Junior Programmer
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 -- 
 Some people have a gift link here.
 Know what I want?
 I want you to buy a CD from some indie artist.
 http://cdbaby.com/browse/from/lynch
 Yeah, I get a buck. So?
 
 
 


-- 
Patrik Hasibuan [EMAIL PROTECTED]
Junior Programmer

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



Re: [PHP] Objects

2007-07-31 Thread Richard Lynch
On Sun, July 29, 2007 12:45 pm, Nathan Nobbe wrote:
 one of the hardest parts about using design patterns in reality is you
 have
 to be able to recognize a certain
 problem and then you can begin to understand how to apply a particular
 pattern or set of patterns to your
 solution.

Or, in my experience with pattern zealots, mis-recognize a problem as
a pattern it isn't, mis-apply the solution and then spend years
dealing with a square peg in a round hole...

:-) :-) :-)

If you're not experienced in the first place, design patterns are just
a big fat jumble of over-engineered toys that will make a pig's
breakfast of everything.

YMMV

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Dealing with ImageMagick from PHP

2007-07-31 Thread Richard Lynch
On Sun, July 29, 2007 12:49 am, Eric Holt (PHP List) wrote:
 Right now, I call ImageMagick from a exec call in PHP.  When I first

 Now, after that long rambling... My question is this:  Would I see a
 big
 speed improvement by using the ImageMagick extension built into PHP
 (MagicWand, is it called?)?  I'd hate to spend all the time recoding
 the
 application to work with MagicWand, only to find out that I dont end
 up
 with any performance increase -- or worse of all, a decrease.

exec() fires up a whole new process, with a micro-environment shell.
That's usually relatively expensive.

So you will almost-for-sure get some kind of improved performance out
of the change.

You could try comparing an exec() of a MUCH simpler ImageMagick call
with the corresponding PHP script to compare the two on your hardware.

That said, if the time is all being spent in the guts of ImageMagick
doing pixel mainpulation, then switching won't help much.

You could also use valgrind/callgrind to see where the time is being
spent, though it might be easier for a newbie to just hack up a PHP
script and an exec to compare...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] PHP Rating system

2007-07-31 Thread Richard Lynch
On Sun, July 29, 2007 1:41 pm, Chris Carter wrote:
 I am trying for a php rating code that can utilized for a restaurant
 requirement. First of all I am not sure if there is database that is
 obvious
 with rating system. In case it is or even if its not, is there some
 site and
 code available from where the code can be used.

 I have tried some but most of them do not work.

Pretty much everything you'd need to know for a simple one is in any
basic PHP MySQL Tutorial or textbook you'd care to try...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Bizarre array create error

2007-07-31 Thread Tom Ray [Lists]

Paul Novitski wrote:

At 7/29/2007 09:59 PM, Ken Tozier wrote:

/*--*/
/* Next two lines are where the problem 
starts  */
/* If I comment either of them out the script 
runs  */

/* but with both uncommented, it dies
/*--*/
// create the rect and usable rect records
$result-rect   = array(0, 0, 
$result-page_width, $result- page_height);


Does this typo exist in your script?  $result- page_height with a 
space between - and ?


Regards,

Paul

I thought the same thing but when I did the copy and paste no spaces 
where there.  I think it's how the email clients display it.


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



[PHP] Blooging Portal

2007-07-31 Thread Christian Hänsel

Good morning group,

this is not generally a PHP question, but either way I'm gonna ask :oP

Does any of you know a decent Blooging Portal software? Of course, it should 
be OpenSource ;o) What I wanna do is: I want to give people the ability to 
create their own blogs on my server under one domain name... so 
myblogonchrisserver.com/stephen would go to stephen's blog (just so you see 
what I mean).


Does anybody have an idea? It'd be greatly appreciated.

All the best!

Chris

--
-
My baby's first words will be
Hello World or maybe foo/bar

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



Re: [PHP] Blooging Portal

2007-07-31 Thread Paul Scott

On Tue, 2007-07-31 at 10:27 +0200, Christian Hänsel wrote:
 Does any of you know a decent Blooging Portal software? Of course, it should 
 be OpenSource ;o) What I wanna do is: I want to give people the ability to 
 create their own blogs on my server under one domain name... so 
 myblogonchrisserver.com/stephen would go to stephen's blog (just so you see 
 what I mean).
 

Well, to bring this back to a PHP question, you could try the Chisimba
blogging software. See it in action at http://fsiu.uwc.ac.za (where this
list is blogged using it) and download it at http://avoir.uwc.ac.za or
contact me off list to ask any questions.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

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

Re: [PHP] Blooging Portal

2007-07-31 Thread Jad madi
also take a look at WordPress MU
http://mu.wordpress.org/


On 31/07/07, Paul Scott [EMAIL PROTECTED] wrote:

 On Tue, 2007-07-31 at 10:27 +0200, Christian Hänsel wrote:
  Does any of you know a decent Blooging Portal software? Of course, it should
  be OpenSource ;o) What I wanna do is: I want to give people the ability to
  create their own blogs on my server under one domain name... so
  myblogonchrisserver.com/stephen would go to stephen's blog (just so you see
  what I mean).
 

 Well, to bring this back to a PHP question, you could try the Chisimba
 blogging software. See it in action at http://fsiu.uwc.ac.za (where this
 list is blogged using it) and download it at http://avoir.uwc.ac.za or
 contact me off list to ask any questions.

 --Paul


 All Email originating from UWC is covered by disclaimer 
 http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm


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



-- 
Jad Madi


[PHP] Includes eating up my time

2007-07-31 Thread Dave M G

PHP general list,

This is probably obvious to people who are good at PHP, but I'm

I have a PHP based CMS (content management system) built, which has 
grown and become quite robust. It's now spread out over about 30 files, 
and each file represents one class within the object oriented design. 
Each are a couple hundred lines of code, and two or three of the most 
critical classes are over a thousand lines of code.


While first building it, I didn't really anticipate quite that many 
files. What I did is have a file called includes.php, which list all 
the files to be included. Then I in turn included includes.php at the 
beginning of my index.php file. Every page request passes through the 
index.php file, so that basically means every single file is included 
at the start of every new page request.


I'm using Zend Studio, which has a profile option, which shows how 
long it takes for my PHP scripts to complete a request. It has a 
breakdown showing percentages of which scripts are using that processing 
time.


Currently, my processes are taking under a second, but they can be 
around half a second or more. Although it all happens too fast for me to 
really notice as a person, it seems to me that a half second of 
processing time might be kind of long and lead to scalability problems.


My first question is: Is a half second too long? I'm pretty sure it is, 
but maybe I'm just being paranoid. What do people consider to be 
acceptable time frames for processing a web page similar to what 
Wikipedia delivers?


Most of the time is taken with the includes. Anywhere from 60% to 90% of 
the time it takes to process my scripts is coming from the includes.php 
file.


I read somewhere that it's not a good idea to have more than 10 includes 
in any one place. I'm fine with trying to break up my include requests, 
but I'm unsure as to how. As each function in each class passes around 
objects, it's not clear from looking at the code which ones are used at 
any one time, so I'm unsure how to efficiently include only the 
necessary classes.


My second question is: Is there a systematic way of determining how to 
incrementally include files that people use? Or is it just a constant 
process of testing and checking?


Thank you for any advice.

--
Dave M G
Ubuntu Feisty 7.04
Kernel 2.6.20-16-386

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



[PHP] Flash 8 UI controls

2007-07-31 Thread Man-wai Chang

From a Flash 8 ActionScript book I glanced this afternoon, I couldn't
find a table input type, nor a grid class. How does Flash name them?

-- 
  @~@   Might, Courage, Vision, SINCERITY.
 / v \  Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 7.04)  Linux 2.6.22.1
  ^ ^   17:56:01 up 19 days 20:00 2 users load average: 0.11 0.03 0.01
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

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



RE: [PHP] Blooging Portal

2007-07-31 Thread Oliver Clarke
Christian Hänsel wrote:

 this is not generally a PHP question, 
 but either way I'm gonna ask :oP

 Does any of you know a decent 
 Blooging Portal software? 

Sorry you must have the wrong list. This one is dedicated to futile
discussions about Copyright Infringement vs Theft. 

:)

Regards,
Oliver
Skype: OliverC999
Mobile: 07985 144636

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



Re: [PHP] Includes eating up my time

2007-07-31 Thread David Restall - System Administrator
Hi Dave,

 PHP general list,
 
 This is probably obvious to people who are good at PHP, but I'm
 
 I have a PHP based CMS (content management system) built, which has 
 grown and become quite robust. It's now spread out over about 30 files, 
 and each file represents one class within the object oriented design. 
 Each are a couple hundred lines of code, and two or three of the most 
 critical classes are over a thousand lines of code.

It may just be a 'dave' thing but my stuff does that too :-)

 While first building it, I didn't really anticipate quite that many 
 files. What I did is have a file called includes.php, which list all 
 the files to be included. Then I in turn included includes.php at the 
 beginning of my index.php file. Every page request passes through the 
 index.php file, so that basically means every single file is included 
 at the start of every new page request.

Ahh the 'dave' thing returns :-)

 I'm using Zend Studio, which has a profile option, which shows how 
 long it takes for my PHP scripts to complete a request. It has a 
 breakdown showing percentages of which scripts are using that processing 
 time.

Real dave's use vi  top :-P

 My second question is: Is there a systematic way of determining how to 
 incrementally include files that people use? Or is it just a constant 
 process of testing and checking?
 
 Thank you for any advice.

What version of PHP are you using ?  I moved over to 5 and it has a nice
cute feature :-

http://uk3.php.net/__autoload

which basically only loads classes when they are required.  PHP 5 has
some other nice to have features and will cause you a bit of work if
you migrate to it BUT it is worth the effort especially in the light of
888 :-)

As for your performance problems, the times are heavily dependant on the
hardware and underlying OS  server load etc. without further info,
diagnosing problems will be dificult.

TTFN



Dave
php/general-2007-07-31.tx  php-general [EMAIL PROTECTED]
++
| Dave Restall, Computer Nerd, Cyclist, Radio Amateur G4FCU, Bodger  |
| Mob +44 (0) 7973 831245  Skype: dave.restall Radio: G4FCU  |
| email : [EMAIL PROTECTED] Web : Not Ready Yet :-(   |
++
| Big book, big bore.|
| -- Callimachus |
++

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



Re: [PHP] PHP and Java: accessing Java classes from PHP

2007-07-31 Thread Holografix
Hi


 If you mean you tried this:
 http://php.net/java

It was the first thing I tried. I will post a bug in http://bugs.php.net

Then I read about php-java-bridge but the examples were using older versions 
of php-jb.

 That said, I don't see how you could possibly access Java without
 running Java... But maybe servelets is something separate from the
 monolithic Java already running?

We can't use apache tomcat (java app server). Java is present and running 
but not tomcat.

 You might also consider taking a step back and writing a Java program
 that uses SOAP/RPC/??? to provide the info PHP needs via HTTP instead
 of trying to get PHP and Java to play nice together at the binary
 level...

I am not the java coder so I have to use the code that already exists.

Thank you very much for the answer.

greets
holo


Richard Lynch [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 On Fri, July 27, 2007 10:31 am, Holografix wrote:
 I need to access some custom and native Java classes from php.
 I've tried the steps form php manual and php-javabridge from sf but I
 always
 get an apache crash.
 I don't need to run servlets and it's impossible to start servlet
 engine in
 the server (project requirements).

 The tutorials i've found are outdated (old php-javabridge versions)
 and
 refer to some files that no longer exists.

 If someone can point the right direction I would like to see the
 solution.

 I'm using win xp pro sp2, php 5.2.3, java 1.6.0_02.

 If you mean you tried this:
 http://php.net/java
 and it crashed, then post a bug report here:
 http://bugs.php.net/

 If you haven't tried that, try it. :-)

 That said, I don't see how you could possibly access Java without
 running Java... But maybe servelets is something separate from the
 monolithic Java already running?

 You might also consider taking a step back and writing a Java program
 that uses SOAP/RPC/??? to provide the info PHP needs via HTTP instead
 of trying to get PHP and Java to play nice together at the binary
 level...

 -- 
 Some people have a gift link here.
 Know what I want?
 I want you to buy a CD from some indie artist.
 http://cdbaby.com/browse/from/lynch
 Yeah, I get a buck. So?
 

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



[PHP] if inside an echo.

2007-07-31 Thread Hulf
I am outputting a selectbox and want to do the follwoing. How can I add the 
IF statement inside the the echo?


for ($value = 0; $value = 2000; $value += 100) {

 echo option value=\$value\ if ($min_rent==$value) {echo 
selected=selected } $value/option;

  }

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



Re: [PHP] Includes eating up my time

2007-07-31 Thread Chad Robinson

Dave M G wrote:

Currently, my processes are taking under a second, but they can be
around half a second or more. Although it all happens too fast for me to
really notice as a person, it seems to me that a half second of
processing time might be kind of long and lead to scalability problems.
  
That's hardly the worst performance I've seen from a CMS, but you should 
know that nearly all CMS systems are slow, many slower than this, for 
similar reasons. The solution is usually to build a front-end cache, 
either in the CMS itself or using an external tool. For instance, MODx 
caches internally, while others rely on Apache/Enfold/etc.

My first question is: Is a half second too long? I'm pretty sure it is,
but maybe I'm just being paranoid. What do people consider to be
acceptable time frames for processing a web page similar to what
Wikipedia delivers?
  
When you quote Wikipedia, you do realize that they're not a CMS, right, 
that they're a Wiki? There are some subtle differences. I haven't looked 
at Wikipedia's Wiki code (I like TWiki) but the Wikis I've used don't 
actually use a database or a billion classes to get their work done. 
They're more focused on editing an entire page of static content, which 
is stored on disk (and thus directly accessible by the server).


If you want that kind of scalability you also MUST implement some sort 
of caching. PHP is a scripting language, and no scripting language will 
ever keep up with compiled code, no matter how good (and PHP is good). 
You might also consider looking at the Zend Optimizer - I've never tried 
it, but have heard good things.

My second question is: Is there a systematic way of determining how to
incrementally include files that people use? Or is it just a constant
process of testing and checking?
  
PHP does have an auto-include system called the autoloader. We use this 
heavily in Blackbird ESB to load classes on the fly when they're 
referenced. It only works for loading classes, but since you say that's 
what you have... Take a look here:

http://us.php.net/autoload

Regards,
Chad

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



RE: [PHP] if inside an echo.

2007-07-31 Thread Edward Kay


 -Original Message-
 From: Hulf [mailto:[EMAIL PROTECTED]
 Sent: 31 July 2007 12:11
 To: php-general@lists.php.net
 Subject: [PHP] if inside an echo.
 
 
 I am outputting a selectbox and want to do the follwoing. How can 
 I add the 
 IF statement inside the the echo?
 
 
 for ($value = 0; $value = 2000; $value += 100) {
 
  echo option value=\$value\ if ($min_rent==$value) {echo 
 selected=selected } $value/option;
 
   }
 

Just split it into multiple echo statments:

for ($value = 0; $value = 2000; $value += 100) {

   echo option value=\$value\;
   if ($min_rent==$value)
  echo  selected=\selected\;
   echo  $value/option;

}

Edward

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



[PHP] Re: Includes eating up my time

2007-07-31 Thread Emil Ivanov
Consider using the __autoload() function in php.
(also the SPL autoloading features).
It's a way to tell php to load a file when it cannot find a definition for a 
CLASS (only for classes).
I don't know how you have set-uped your project, but in mine the only place 
in the project where I use include is thie __autoload() function.

In other words - php supports load-on-demand for classes.

Check out http://php.net/__autoload

Regards,
Emil Ivanov
Dave M G [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 PHP general list,

 This is probably obvious to people who are good at PHP, but I'm

 I have a PHP based CMS (content management system) built, which has grown 
 and become quite robust. It's now spread out over about 30 files, and each 
 file represents one class within the object oriented design. Each are a 
 couple hundred lines of code, and two or three of the most critical 
 classes are over a thousand lines of code.

 While first building it, I didn't really anticipate quite that many files. 
 What I did is have a file called includes.php, which list all the files 
 to be included. Then I in turn included includes.php at the beginning of 
 my index.php file. Every page request passes through the index.php 
 file, so that basically means every single file is included at the start 
 of every new page request.

 I'm using Zend Studio, which has a profile option, which shows how long 
 it takes for my PHP scripts to complete a request. It has a breakdown 
 showing percentages of which scripts are using that processing time.

 Currently, my processes are taking under a second, but they can be around 
 half a second or more. Although it all happens too fast for me to really 
 notice as a person, it seems to me that a half second of processing time 
 might be kind of long and lead to scalability problems.

 My first question is: Is a half second too long? I'm pretty sure it is, 
 but maybe I'm just being paranoid. What do people consider to be 
 acceptable time frames for processing a web page similar to what Wikipedia 
 delivers?

 Most of the time is taken with the includes. Anywhere from 60% to 90% of 
 the time it takes to process my scripts is coming from the includes.php 
 file.

 I read somewhere that it's not a good idea to have more than 10 includes 
 in any one place. I'm fine with trying to break up my include requests, 
 but I'm unsure as to how. As each function in each class passes around 
 objects, it's not clear from looking at the code which ones are used at 
 any one time, so I'm unsure how to efficiently include only the necessary 
 classes.

 My second question is: Is there a systematic way of determining how to 
 incrementally include files that people use? Or is it just a constant 
 process of testing and checking?

 Thank you for any advice.

 -- 
 Dave M G
 Ubuntu Feisty 7.04
 Kernel 2.6.20-16-386 

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



Re: [PHP] if inside an echo.

2007-07-31 Thread Alan Milnes
On 31/07/07, Hulf [EMAIL PROTECTED] wrote:
 I am outputting a selectbox and want to do the follwoing. How can I add the
 IF statement inside the the echo?

Something like this:-

for ($value = 0; $value = 2000; $value += 100) {

 echo option value=\$value\;
 if ($min_rent==$value) {
 echo selected=\selected\;
  }
 echo  $value/option;

Alan

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



Re: [PHP] if inside an echo.

2007-07-31 Thread M. Sokolewicz

Edward Kay wrote:



-Original Message-
From: Hulf [mailto:[EMAIL PROTECTED]
Sent: 31 July 2007 12:11
To: php-general@lists.php.net
Subject: [PHP] if inside an echo.


I am outputting a selectbox and want to do the follwoing. How can 
I add the 
IF statement inside the the echo?



for ($value = 0; $value = 2000; $value += 100) {

 echo option value=\$value\ if ($min_rent==$value) {echo 
selected=selected } $value/option;


  }



Just split it into multiple echo statments:

for ($value = 0; $value = 2000; $value += 100) {

   echo option value=\$value\;
   if ($min_rent==$value)
  echo  selected=\selected\;
   echo  $value/option;

}

Edward


Or use the ternary operator:

for ($value = 0; $value = 2000; $value += 100) {
  echo 'option value='.$value.' '.($min_rent==$value ? 
'selected=selected' : '').'  '.$value.'/option';

}

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



Re: [PHP] Blooging Portal

2007-07-31 Thread Christian Hänsel
Oliver Clarke [EMAIL PROTECTED] schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]

Christian Hänsel wrote:


this is not generally a PHP question,
but either way I'm gonna ask :oP



Does any of you know a decent
Blooging Portal software?


Sorry you must have the wrong list. This one is dedicated to futile
discussions about Copyright Infringement vs Theft.

:)

Regards,
Oliver
Skype: OliverC999
Mobile: 07985 144636


Thanks guys,

I will check out both programs... any other ideas while I am downloading? 
;o)


Cheers

Chris

--
-
My baby's first words will be
Hello World

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



RE: [PHP] if inside an echo.

2007-07-31 Thread Edward Kay


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
 Alan Milnes
 Sent: 31 July 2007 12:41
 To: php-general@lists.php.net
 Subject: Re: [PHP] if inside an echo.


 On 31/07/07, Hulf [EMAIL PROTECTED] wrote:
  I am outputting a selectbox and want to do the follwoing. How
 can I add the
  IF statement inside the the echo?

 Something like this:-

 for ($value = 0; $value = 2000; $value += 100) {

  echo option value=\$value\;
  if ($min_rent==$value) {
  echo selected=\selected\;
   }
  echo  $value/option;

 Alan


Snap :) One small point though; you're missing a required space before
selected. It should be:

echo  selected=

otherwise you won't output valid HTML.

E

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



Re: [PHP] Authentication

2007-07-31 Thread Dan Shirah
Correct Stut, I want transparent authentication, but I also want to have the
currently logged in user name pulled so I can use it for tracking purposes.
My application deals with very sensitive company information and I want to
pull the username for tracking purposes. I have everything running local on
the same PC.  Win2k3 server, IIS, PHP and MSSQL Server.  I have PHP
installed for use with ldap and have NT Authentication set in IIS for the
site.  This allows me to perform the transparency, but I can't seem to
extract the username.

On 7/29/07, Stut [EMAIL PROTECTED] wrote:

 Dan Shirah wrote:
  I looked on PHP.net but I couldn't not find anything suitable to answer
 my
  question.
 
  Within PHP, is there a way to pull the name of the user that is
 currently
  logged into the PC?
 
  I know with some of the _SERVER functions you can pull the IP of the
 machine
  and other data, is there a function within this family that would work?

 I'm assuming you're after transparent authentication where the user
 doesn't need to do anything to authenticate with the site. This is only
 possible with IE as the client on an NT domain with the server on the
 same domain. If you're using IIS on the server then it's as easy as
 removing anonymous and basic authentication from the site/directory. If
 you're using Apache or something else you need to find an
 extension/module that provides NTLM authentication, but not all of the
 ones I tried fully supported the transparent side of it.

 I implemented this for a corporate intranet a while back in Apache on
 FreeBSD with mod_ntlm (Google for it - dunno if it's still maintained).
 That was in 2004 and information was sparse, but with a bit of research
 and *lots* of experimenting I was able to get it to work.

 To be perfectly honest, if I were doing it again I'd save the time and
 use IIS on the server - sooo much easier.

 -Stut

 --
 http://stut.net/



Re: [PHP] Authentication

2007-07-31 Thread Stut

Dan Shirah wrote:
Correct Stut, I want transparent authentication, but I also want to have 
the currently logged in user name pulled so I can use it for tracking 
purposes.  My application deals with very sensitive company information 
and I want to pull the username for tracking purposes. I have everything 
running local on the same PC.  Win2k3 server, IIS, PHP and MSSQL 
Server.  I have PHP installed for use with ldap and have NT 
Authentication set in IIS for the site.  This allows me to perform the 
transparency, but I can't seem to extract the username.


Spit out the contents of $_SERVER with print_r - it's probably in there 
somewhere.


print 'pre'.print_r($_SERVER, true).'/pre';

-Stut

--
http://stut.net/

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread tedd

At 3:44 PM -0400 7/30/07, Robert Cummings wrote:

On Mon, 2007-07-30 at 15:33 -0400, tedd wrote:

 At 8:23 PM +0100 7/30/07, Stut wrote:
 tedd wrote:
 At 2:30 PM -0400 7/30/07, Robert Cummings wrote:
 Ownership is an illusion... What you have may be taken away at anytime
 by the state (be it your own state or a victorious state that just
 subjugated your previous state).
 
 But illusion all we have. There is no truth in perception.
 
 Then there is no truth in anything for all things are based on perception.
 
 -Stut


 You are now one with the universe.


We are all one with the universe and at the same time not one with the
universe.

Cheers,
Rob.



Yes Yoda.  :-)

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread tedd

At 8:53 PM +0100 7/30/07, Stut wrote:

tedd wrote:

  Don't expect that only one living
  entity can envision such a permutation.


 Don't expect anyone with our limitations to be capable to determine
 the truth of that statement.


The phone was independently envisioned by two distinct humans at the
same time. The same is true of calculus. So you are wrong, we are
capable of determine the validity of the statement by the existence of
such events in history.

-snip-


No, I was addressing a concept deeper than that. The only one who 
can envision such a permutation is God, not man. Your previous 
paragraph mentioned permutation of what might exist -- which would 
be infinite. The only living entity that fills that bill is God.


Now, you may argue that, but it's not a topic for this list.


Indeed not, but I must point out your assumption that God exists 
which is in no way a certainty regardless of your beliefs.


-Stut



Yes, but that's why it's called faith.

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread Stut

tedd wrote:

At 8:53 PM +0100 7/30/07, Stut wrote:

tedd wrote:

  Don't expect that only one living
  entity can envision such a permutation.


 Don't expect anyone with our limitations to be capable to determine
 the truth of that statement.


The phone was independently envisioned by two distinct humans at the
same time. The same is true of calculus. So you are wrong, we are
capable of determine the validity of the statement by the existence of
such events in history.

-snip-


No, I was addressing a concept deeper than that. The only one who can 
envision such a permutation is God, not man. Your previous paragraph 
mentioned permutation of what might exist -- which would be infinite. 
The only living entity that fills that bill is God.


Now, you may argue that, but it's not a topic for this list.


Indeed not, but I must point out your assumption that God exists which 
is in no way a certainty regardless of your beliefs.


-Stut



Yes, but that's why it's called faith.


My point was that it makes no sense to try and prove or demonstrate 
anything using God because the existance of God itself cannot be proven 
or demonstrated.


-Stut

--
http://stut.net/

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



Re: [PHP] Objects

2007-07-31 Thread Nathan Nobbe
 On 7/31/07, Richard Lynch [EMAIL PROTECTED] wrote:
 Or, in my experience with pattern zealots, mis-recognize a problem as
 a pattern it isn't, mis-apply the solution and then spend years
 dealing with a square peg in a round hole...

The funny thing about that is w/ OOP and design patterns you can fit square
pegs
in round holes!  its called the Adapter pattern :-P
Any way the problem youre trying to pin on Design Patterns is a more general
problem
that applies to practically every walk of life; once you learn something in
theory you simply
cant be good at it until you have done it.
the same can be said for low level code and people just starting to program
professionally.
everyone makes mistakes, especially at first.  if youre learning patterns
well, you
will almost certainly make mistakes when trying to implement them in
reality.  it takes courage to
attempt to implement design patterns because its hard, and most people dont
know what youre
talking about, so you can barely communicate.
design patterns actually started out in the world of architecture, building
houses.  see, building houses
became building cities and people learned how to build cities the right way;
they wrote it down.
eventually it made its way into software.
more to the point of code, i have seen some really bad code.  ill tell you
honestly most php devs
ive met dont know much about oop let alone design patterns.  they end up
writing horrible
spaghetti code that is difficult to decipher and even more difficult to
maintain and extend.  i
feel sorry for Richard; if youd ever seen a successful implementation of
design patterns in the wild
well you would probly feel like i do...  gotta have em :)

-nathan

On 7/31/07, Richard Lynch [EMAIL PROTECTED] wrote:

 On Sun, July 29, 2007 12:45 pm, Nathan Nobbe wrote:
  one of the hardest parts about using design patterns in reality is you
  have
  to be able to recognize a certain
  problem and then you can begin to understand how to apply a particular
  pattern or set of patterns to your
  solution.

 Or, in my experience with pattern zealots, mis-recognize a problem as
 a pattern it isn't, mis-apply the solution and then spend years
 dealing with a square peg in a round hole...

 :-) :-) :-)

 If you're not experienced in the first place, design patterns are just
 a big fat jumble of over-engineered toys that will make a pig's
 breakfast of everything.

 YMMV

 --
 Some people have a gift link here.
 Know what I want?
 I want you to buy a CD from some indie artist.
 http://cdbaby.com/browse/from/lynch
 Yeah, I get a buck. So?




[PHP] Array difficulty

2007-07-31 Thread Carlton Whitehead
Hi all,

I have an array like this:

$chance = array(lowercase = 27, uppercase = 62, integer = 46); 

The values for each of the keys are randomly generated. I want to find the key 
name of the one which has the highest value. Currently, I'm doing this as 
follows:

arsort($chance);
foreach ($chance as $type = $value)
{
$result = $type;
break;
}

At this point, $result would be equal to uppercase.  I feel like this is a 
really kludgey way to accomplish this.  Is there a better way?

Regards, 
Carlton Whitehead

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread tedd

At 7:28 PM -0500 7/30/07, Larry Garfield wrote:

On Monday 30 July 2007, tedd wrote:
  What about descendants of the author? When anyone dies, their

 descendants have a rightful claim on their parent's assets -- it been
 that way since the dawn of mankind. Do you think you know better than
 the practice of thousands of generations?


Actually no, property law didn't really come in until civilization, some 5000
years ago, which is rather small on the scale of dawn of mankind.


Mankind has been on this Earth for more than a million years. 
Mankind's first known works of art were published in the caves of 
Altamira and Lascaux 15,000 to 10,000 B.C. Physical sculpted items 
such as the Venus of Willendorf were things that certainly could be 
passed down to descendants.


Are you telling me that the son of that artist did not claim 
ownership of that item after his father died? That doesn't seem 
reasonable. If you're father died, wouldn't you want to inherit his 
work? That seems more reasonable to me.




copyright didn't exist until perhaps 5 centuries ago in England, and covered
just publication, and was for less than 20 years.  Copyright being long
enough term for inheritance to matter is less than a century.  Over the scale
of human history, unrestricted information flow has been the rule, not the
exception.


Over the scale of history, it was usually the strongest who took what 
they wanted.



But what you're suggesting is that legalized extortion should be inheritable. 
Copyright is, fundamentally, legalized extortion as a means of promoting the

progress of Science and the Useful Arts.


Extortion? Are you saying that anyone who owes a copyright is 
obtaining money through force or threats? That sounds strange.




Do you keep paying the guy who
built your TV every time you watch something on it?  Do you keep paying the
company that built your house every time you move?  Do you pay your teachers
from college every time you use something you learned there?  Do you pay your
dentist every time you eat?


No, I pay them for their service. The same way I pay for a book or 
software. Your points are getting stranger.




This from the man who just claimed that perpetual copyright for all decedents
of an artist was a fundamental part of human existence for as long as they've
been humans.  Can we stick to facts when making logical arguments rather than
completely made up nonsense?


I didn't say perpetual, but the rest is basically common sense.

In Geology there is an axiom that says The present is the key to the 
past -- while it's not perfect, it does seem to work surprisingly 
well.


I don't think that mankind 15,000 years ago was that much different 
than today and if today's descendants are fighting over their 
parent's processions now, then I don't think that it's unreasonable 
to project that conduct back 15,000 years and make a statement to 
that effect. So, it's not made up nonsense. Besides, that's the way I 
remember it.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Objects

2007-07-31 Thread Eric Butera
On 7/31/07, Nathan Nobbe [EMAIL PROTECTED] wrote:
  On 7/31/07, Richard Lynch [EMAIL PROTECTED] wrote:
  Or, in my experience with pattern zealots, mis-recognize a problem as
  a pattern it isn't, mis-apply the solution and then spend years
  dealing with a square peg in a round hole...

 The funny thing about that is w/ OOP and design patterns you can fit square
 pegs
 in round holes!  its called the Adapter pattern :-P

I thought the same thing. ;)

 i
 feel sorry for Richard; if youd ever seen a successful implementation of
 design patterns in the wild
 well you would probly feel like i do...  gotta have em :)

I doubt it.  People grow comfortable with what they know and don't
want/need to change.  I started out using procedual style but I always
kept saying to myself, There's got to be a better way.  Luckily I
eventually found it in OOP.  I've seen a lot of great procedual code
too though.  There isn't anything wrong with it at all.  I just don't
want to try and maintain it anymore since I'm in a different mindset
now.

OOP isn't going to save anyone though.  It seems almost easier to
shoot yourself in the foot with OOP using things like extends
instead of composition, singletons, etc.

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



Re: [PHP] Bizarre array create error

2007-07-31 Thread Ken Tozier


On Jul 31, 2007, at 2:00 AM, Richard Lynch wrote:


On Sun, July 29, 2007 5:49 pm, Ken Tozier wrote:

I'm trying to assign two fields of an object returned from a MySQL
query and have stumbled upon the most bizarre PHP bug where I can't
create two arrays in succession.

Here's the MySQL query with two dummy fields to be filled in later

select *, 0 as dummy_1, 0 as dummy_2 from table

Here's how I'm grabbing the query results

$result = array();
while ($row = mysql_fetch_object($query_result))
{
$result[]   = $row;
}

Once that's done, I try to set two of the rows to arrays like this

$result- dummy_1= array(1, 2, 3, 4);
$result- dummy_2= array('a', 'b', 'c', 'd');


$result is an array and you are treating it like an object...

While this is supposed to work, I think, it's pretty confusing to this
naive reader...

$result['dummy_1'] = array(1, 2, 3, 4);

would make more sense...


That doesn't work. (I tried already) You have to use the - syntax  
for objects returned by an MySQL query.


And you do realize that your actual objects are ELEMENTS of the array
$result, not $result itself...

So maybe you want something more like:

$row1 = $result[0];
$row1-dummy_1 = array(1, 2, 3, 4);


Yeah. My original post was incorrect. I'm actually doing something  
more like your above suggestion


$result[0]-dummy_1  = array(1, 2, 3, 4);

I posted the complete function at 1:04 a.m. July 30 if you want to  
take a look


That said, you're altering an Object that MySQL returned, and I've got
NO IDEA what kind of an object that is, or what you're allowed to cram
into its variables...


The weird thing is, I've been doing this type of assignment for a  
couple of years, haven't upgraded my copy PHP for a year, but all of  
a sudden it breaks. Very puzzling...


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



Re: [PHP] Array difficulty

2007-07-31 Thread Richard Davey
Hi Carlton,

Tuesday, July 31, 2007, 2:27:46 PM, you wrote:

 I have an array like this:

 $chance = array(lowercase = 27, uppercase = 62, integer = 46);

 The values for each of the keys are randomly generated. I want to
 find the key name of the one which has the highest value. Currently, I'm 
 doing this as follows:

 arsort($chance);
 foreach ($chance as $type = $value)
 {
 $result = $type;
 break;
 }

 At this point, $result would be equal to uppercase.  I feel like
 this is a really kludgey way to accomplish this.  Is there a better way?

Not tested it, but max() should work as the first parameter can be an
array:

http://uk3.php.net/max

Cheers,

Rich
-- 
Zend Certified Engineer
http://www.corephp.co.uk

Never trust a computer you can't throw out of a window

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



RE: [PHP] Array difficulty

2007-07-31 Thread Chris Boget
 At this point, $result would be equal to uppercase.  I feel 
 like this is a really kludgey way to accomplish this.  Is there 
 a better way?

Couldn't you just do

arsort($chance);
$lastItem = chance[( count( $chance ) - 1 )];

?  Why iterate through the array when all you need is the last value?

thnx,
Chris

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread Robert Cummings
On Tue, 2007-07-31 at 08:42 -0400, tedd wrote:
 At 3:44 PM -0400 7/30/07, Robert Cummings wrote:
 On Mon, 2007-07-30 at 15:33 -0400, tedd wrote:
   At 8:23 PM +0100 7/30/07, Stut wrote:
   tedd wrote:
   At 2:30 PM -0400 7/30/07, Robert Cummings wrote:
   Ownership is an illusion... What you have may be taken away at anytime
   by the state (be it your own state or a victorious state that just
   subjugated your previous state).
   
   But illusion all we have. There is no truth in perception.
   
   Then there is no truth in anything for all things are based on 
  perception.
   
   -Stut
 
 
   You are now one with the universe.
 
 We are all one with the universe and at the same time not one with the
 universe.
 
 Cheers,
 Rob.
 
 
 Yes Yoda.  :-)

I always did figure Yoda to be a buddhist :)

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] Array difficulty

2007-07-31 Thread Carlton Whitehead
I tried that earlier, but the problem is:

count( $chance ) - 1 ); returns an integer, so I would be asking for something 
like $chance[1] or $chance[0], neither of which exist in the array.  Keep in 
mind $chance only has keys with string names:

The array looks like this:

$chance = array(lowercase = 27, uppercase = 62, integer = 46);

The values assigned to each key are randomly generated.

Regards,
Carlton Whitehead

- Original Message -
From: Chris Boget [EMAIL PROTECTED]
To: Carlton Whitehead [EMAIL PROTECTED], php-general@lists.php.net
Sent: Tuesday, July 31, 2007 9:43:00 AM (GMT-0500) America/New_York
Subject: RE: [PHP] Array difficulty

 At this point, $result would be equal to uppercase.  I feel 
 like this is a really kludgey way to accomplish this.  Is there 
 a better way?

Couldn't you just do

arsort($chance);
$lastItem = chance[( count( $chance ) - 1 )];

?  Why iterate through the array when all you need is the last value?

thnx,
Chris

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread tedd

At 1:50 PM +0100 7/31/07, Stut wrote:

tedd wrote:

Yes, but that's why it's called faith.


My point was that it makes no sense to try and prove or demonstrate 
anything using God because the existance of God itself cannot be 
proven or demonstrated.


-Stut



I wasn't trying to prove anything using God. His mention came about 
when a feat was described that I believed to be beyond human 
capabilities, and thus brought to mind God.


I agree that the existence of God itself cannot be proven or 
demonstrated -- to some.  But, at least to one, the proof obvious. :-)


Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Array difficulty

2007-07-31 Thread Chris Boget

At this point, $result would be equal to uppercase.  I feel like
this is a really kludgey way to accomplish this.  Is there a better way?

Not tested it, but max() should work as the first parameter can be an
array:
http://uk3.php.net/max


Except he's looking for the key and not the value, which max() would return. 
Come to think of it, the solution I provided does the same thing.


Untested but one of the below should work:

arsort($chance);
$lastItem = key( $chance[( count( $chance ) - 1 )]);

OR

arsort($chance);
$lastItem = key( end( $chance ));

thnx,
Chris 


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



Re: [PHP] Array difficulty

2007-07-31 Thread Robin Vickery
On 31/07/07, Carlton Whitehead [EMAIL PROTECTED] wrote:
 Hi all,

 I have an array like this:

 $chance = array(lowercase = 27, uppercase = 62, integer = 46);

 The values for each of the keys are randomly generated. I want to find the 
 key name of the one which has the highest value. Currently, I'm doing this as 
 follows:

 arsort($chance);
 foreach ($chance as $type = $value)
 {
 $result = $type;
 break;
 }


Assuming $chance is non-empty.

$result = array_search(max($chance), $chance);

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



RE: [PHP] Array difficulty

2007-07-31 Thread Robert Cummings
On Tue, 2007-07-31 at 14:43 +0100, Chris Boget wrote:
  At this point, $result would be equal to uppercase.  I feel 
  like this is a really kludgey way to accomplish this.  Is there 
  a better way?
 
 Couldn't you just do
 
 arsort($chance);
 $lastItem = chance[( count( $chance ) - 1 )];

$lastItem = end( $chance );

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] Includes eating up my time

2007-07-31 Thread Larry Garfield
On Tuesday 31 July 2007, Dave M G wrote:
 PHP general list,

 This is probably obvious to people who are good at PHP, but I'm

 I have a PHP based CMS (content management system) built, which has
 grown and become quite robust. It's now spread out over about 30 files,
 and each file represents one class within the object oriented design.
 Each are a couple hundred lines of code, and two or three of the most
 critical classes are over a thousand lines of code.

 While first building it, I didn't really anticipate quite that many
 files. What I did is have a file called includes.php, which list all
 the files to be included. Then I in turn included includes.php at the
 beginning of my index.php file. Every page request passes through the
 index.php file, so that basically means every single file is included
 at the start of every new page request.

Yep, that's the downside of a shared-nothing architecture.  Initialization 
gets slower.

Possible solutions include:

- If you're using all classes, use PHP 5's __autoload() or better still 
spl_autoload_register() to load classes on demand instead of all at once.

- Refactor your code to conditionally include code only when needed.  E.g., 
you probably only need one page handler loaded per page request.  I'm in the 
process of doing that for Drupal right now and the savings are quite 
substantial.

- Op code cache.  This is exactly where an op code cache will get you the 
biggest win, by saving you the loading and parsing time.  

- Page caching.  To do page caching best, you should have the system do a 
partial bootstrap, check to see if it can serve a page from the cache, do so 
if it can, and if it can't only then finish loading the rest of the system.  
That way you skip most of the loading process on cached requests.

- Some combination of the above.  I'd do the op code cache last, as that's a 
sure-fire easy win while the others take effort.  So do those first, and then 
whatever's left you can throw an op code cache at for an extra boost.

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it.  -- Thomas 
Jefferson

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



RE: [PHP] Array difficulty

2007-07-31 Thread Chris Boget
  Couldn't you just do
  arsort($chance);
  $lastItem = chance[( count( $chance ) - 1 )];
 $lastItem = end( $chance );

end() returns the value as well.  You would also need to use key().

thnx,
Chris

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



[PHP] Senior PHP Role

2007-07-31 Thread Matthew Yates
 

Hi All, 


Apologies for cross posting.

 

I'm recruiting on behalf of a superb e-commerce set up who is investing
heavily in the next stage of their tech development. 


We are looking for an ambitious individual to join the senior management
team who has a good PHP background who will be coming in to manage
development and a revamp of the e-commerce proposition. 

 

The key competencies we are looking for a good LAMP development skill
set, ability to spec out new processes, the ability to lead a team and
think creatively.

 

The role offers unbelievable potential with a superb bonus structure and
a clear career path to a VP of Engineering role. 

 

Would anyone be interested or know of anyone who would be interested?
I'd be happy to discuss the role in a bit more detail. 

 

We'll be holding interviews in the central London office next week. 

 

Thanks


Matt

 

 

 

Matt Yates

Siena Red Recruitment

[EMAIL PROTECTED]

Tel. +44 (0) 207 590 3115

Fax. +44 (0) 207 751 3364

Mob. +44 (0)7989 403324



 

www.sienared.com http://www.sienared.com/  

 

CONFIDENTIALITY NOTICE.

This email, together with any attachments, is for the exclusive and
confidential use of the addressee(s). Any other distribution, use or
reproduction without the sender's prior consent is unauthorized and
strictly prohibited. If you have received this message in error, please
notify the sender by email immediately and delete the message from your
computer without making any copies.

 

 



Re: [PHP] Array difficulty

2007-07-31 Thread Alister Bulman
On 31/07/07, Carlton Whitehead [EMAIL PROTECTED] wrote:
 Couldn't you just do
 arsort($chance);
 $lastItem = chance[( count( $chance ) - 1 )];

 I tried that earlier, but the problem is:
 count( $chance ) - 1 ); returns an integer, so I would be asking for 
 something like $chance[1] or $chance[0], neither of which exist in the array. 
  Keep in mind $chance only has keys with string names:

http://uk3.php.net/current

$chance = array(lowercase = 27, uppercase = 62, integer = 46);
arsort($chance);
$lastItem = current($chance);
echo $lastItem\n\n;   // 62

Alister

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



[PHP] Re: if inside an echo.

2007-07-31 Thread Al

foreach(range(0, 2000, 100) as $value){

$str= option value=\$value\;
$str .= ($value== $min_rent)?  selected=\selected\ : NULL;
echo $str . $value/option;
}

Hulf wrote:
I am outputting a selectbox and want to do the follwoing. How can I add the 
IF statement inside the the echo?



for ($value = 0; $value = 2000; $value += 100) {

 echo option value=\$value\ if ($min_rent==$value) {echo 
selected=selected } $value/option;


  }


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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread Larry Garfield
On Tuesday 31 July 2007, tedd wrote:
 At 7:28 PM -0500 7/30/07, Larry Garfield wrote:
 On Monday 30 July 2007, tedd wrote:
What about descendants of the author? When anyone dies, their
 
   descendants have a rightful claim on their parent's assets -- it been
   that way since the dawn of mankind. Do you think you know better than
   the practice of thousands of generations?
 
 Actually no, property law didn't really come in until civilization, some
  5000 years ago, which is rather small on the scale of dawn of mankind.

 Mankind has been on this Earth for more than a million years.
 Mankind's first known works of art were published in the caves of
 Altamira and Lascaux 15,000 to 10,000 B.C. Physical sculpted items
 such as the Venus of Willendorf were things that certainly could be
 passed down to descendants.

 Are you telling me that the son of that artist did not claim
 ownership of that item after his father died? That doesn't seem
 reasonable. If you're father died, wouldn't you want to inherit his
 work? That seems more reasonable to me.

... Yes, I am telling you exactly that.  Historically there was no concept 
of property until the development of civilization.  The only restrictions 
on information from then until ~500 years ago where inter-national (don't 
tell the insert other guys here how our catapults work) and by the Church 
(don't let the lay people understand how it works, because then the 
priesthood isn't as cool).  

The concept of publication didn't exist for cave paintings.  Nor did it 
exist for early songs sung around a camp fire, nor for the traveling 
minstrels of Europe.  They shared songs regularly, because it improved their 
repertoire and because their songs also doubled as a news service.  

Commercial publication didn't exist as a concept until after the invention 
of the printing press, which is when copyright was invented in order to 
protect the business of the publishers.  

Seriously dude, read up on your history.

 But what you're suggesting is that legalized extortion should be
  inheritable. Copyright is, fundamentally, legalized extortion as a means
  of promoting the progress of Science and the Useful Arts.

 Extortion? Are you saying that anyone who owes a copyright is
 obtaining money through force or threats? That sounds strange.

Yes, the force of the government and courts.  That's why it's a 
government-granted monopoly.  It's a government-granted monopoly that serves 
a legitimate purpose, but absent that force information flows freely and 
replicates itself as it passes from person to person.  Restricting that flow 
of information to create a profit motive is an artificial creation of very 
recent legal systems.  That's the point that we've been making all along.  It 
allows authors (well, copyright holders) to extort money for their work for a 
limited time in return for making it public after that time has passed.  

 Do you keep paying the guy who
 built your TV every time you watch something on it?  Do you keep paying
  the company that built your house every time you move?  Do you pay your
  teachers from college every time you use something you learned there?  Do
  you pay your dentist every time you eat?

 No, I pay them for their service. The same way I pay for a book or
 software. Your points are getting stranger.

If a plumber fixes your toilet, he gets paid once.  

If a writer writes a book, he gets paid n times, where n is a (hopefully for 
him) ever-increasing number.  His children then can continue to get paid n 
times, long after he's dead, having done absolutely nothing.  The plumber's 
kids, however, have to go out and get their own jobs.  

You're saying that's fair and equitable?  

 In Geology there is an axiom that says The present is the key to the
 past -- while it's not perfect, it does seem to work surprisingly
 well.

Well golly gee, good thing we're talking about geology.  

 I don't think that mankind 15,000 years ago was that much different
 than today and if today's descendants are fighting over their
 parent's processions now, then I don't think that it's unreasonable
 to project that conduct back 15,000 years and make a statement to
 that effect. So, it's not made up nonsense. Besides, that's the way I
 remember it.

You remember 15,000 years ago?  That explains it, you must be getting 
senile! :-)

And actually it is unreasonable to project modern social attitudes back 
thousands of years.  It's a mistake that sham historians make on a regular 
basis.  They're still wrong.  In history, studying the past is the key to 
understanding the present, because you see where things developed from.  No, 
people even 100 years ago did not think the same way we did.  People today in 
other parts of the world do not think the same way we do in Euro-America.  
Taking the past out of its historical context is a guaranteed way to have no 
idea what you're talking about and to make claims that are completely and 
totally wrong.  As 

[PHP] magic quotes

2007-07-31 Thread KVIGOR
If magic quotes is on and I dont have access to the php.ini.

Is there any way I can strip quotes from the form field with out using AJAX? 

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



Re: [PHP] Objects

2007-07-31 Thread tedd

At 1:25 AM -0500 7/31/07, Richard Lynch wrote:

On Sun, July 29, 2007 12:45 pm, Nathan Nobbe wrote:

 one of the hardest parts about using design patterns in reality is you
 have
 to be able to recognize a certain
 problem and then you can begin to understand how to apply a particular
 pattern or set of patterns to your
 solution.


Or, in my experience with pattern zealots, mis-recognize a problem as
a pattern it isn't, mis-apply the solution and then spend years
dealing with a square peg in a round hole...

:-) :-) :-)

If you're not experienced in the first place, design patterns are just
a big fat jumble of over-engineered toys that will make a pig's
breakfast of everything.



:-)

Unfortunately, that's the way I see it as well.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Objects

2007-07-31 Thread Nathan Nobbe
well im not trying to convince everyone to start doing oop, just because i
dont have time.  maybe if i get rich and have time
ill go on a dedicated mission or something.
anyway i think its obvious that objects are powerful.  look at the big php
projects out there; wikipedia, facebook, many of the
new frameworks that are coming out.  i dont see how you expect to build a
big system on procedural code, then maintain and
extend it w/o pulling your hair out.  but then again i never really studied
procedural design.  i started out w/ c++ back in high
school and been going from there ever since.  dont get me wrong ive written
assembly for mips and worked with a wide variety
of languages, but quite frankly i treat php development much like java
development, as a high level language focused on the use
of objects and interfaces.

-nathan

On 7/31/07, tedd [EMAIL PROTECTED] wrote:

 At 1:25 AM -0500 7/31/07, Richard Lynch wrote:
 On Sun, July 29, 2007 12:45 pm, Nathan Nobbe wrote:
   one of the hardest parts about using design patterns in reality is you
   have
   to be able to recognize a certain
   problem and then you can begin to understand how to apply a particular
   pattern or set of patterns to your
   solution.
 
 Or, in my experience with pattern zealots, mis-recognize a problem as
 a pattern it isn't, mis-apply the solution and then spend years
 dealing with a square peg in a round hole...
 
 :-) :-) :-)
 
 If you're not experienced in the first place, design patterns are just
 a big fat jumble of over-engineered toys that will make a pig's
 breakfast of everything.


 :-)

 Unfortunately, that's the way I see it as well.

 Cheers,

 tedd
 --
 ---
 http://sperling.com  http://ancientstones.com  http://earthstones.com



[PHP] Unexpected values in PHP array

2007-07-31 Thread Ken Tozier

Hi

I think this is probably just a misunderstanding on my part, but I'm  
creating associative arrays with string keys from MySQL query results  
and when I put a value in the array, I get the expected key  
association along with an index key that has a different value.


For example: If I have a table Foo, do a select, perform coersions  
on the results, and place the coerced value in an array with a key, a  
second uncoerced value is also placed in the array with an index key.  
I know all associative arrays have both key and index accessors, but  
I would think that the values should be the same.


Here's the full function.
(Note: The line where values are added to the array is: $fields 
[$key] = $value; after the coersions switch statement)


function query_database($inQuery)
{
$query  = $inQuery;
$coersions  = null;
$object_key = null;
$group_by_key   = null;

if (is_array($inQuery))
{
$query  = $inQuery['query'];
$coersions  = $inQuery['coersions'];
$object_key = $inQuery['object_key'];
$group_by_key   = $inQuery['group_by_key'];
}

try
{
// determine query type
if (strpos($query, 'insert') === false)
{
$rows   = array();
$rowCounter = 0;

foreach ($this-db-query($query) as $row)
{
$fields = array();
$recordKey  = $rowCounter;

foreach ($row as $key = $value)
{
// remember this key if it matches the 
user specified object key
if (($object_key != null)  ($key == 
$object_key))
$recordKey  = 
$value;

// perform user specified coersions
if ($coersions != null)
{
switch ($coersions[$key])
{
case'integer':
$value  
+= 0;
break;

case'float':
$value  
+= 0.0;
break;

case'datetime':
$value  
= new date_object($value);
break;

case'base64_decode':
$value  
= base64_decode($value);
break;

case'hex_decode':
$value 
 = $this-hex_decode($value);
}
}

$fields[$key]   
= $value;
}

// perform grouping if requested
if ($group_by_key == null)
$rows[$recordKey]   = 
$fields;
else
{
$groupKey   = 
$fields[$group_by_key];

if ($rows[$groupKey] == null)
$rows[$groupKey]= 
array();

  

[PHP] Unexpected values in an associative array

2007-07-31 Thread Ken Tozier

Hi

I think this is probably just a misunderstanding on my part, but I'm  
creating associative arrays with string keys from MySQL query results  
and when I put a value in the array, I get the expected key  
association along with an index key that has a different value.


For example: If I have a table Foo, do a select, perform coersions  
on the results, and place the coerced value in an array with a key, a  
second uncoerced value is also placed in the array with an index key.  
I know all associative arrays have both key and index accessors, but  
I would think that the values should be the same.


Here's the full function.
(Note: The line where values are added to the array is: $fields 
[$key] = $value; after the coersions switch statement)


function query_database($inQuery)
{
$query  = $inQuery;
$coersions  = null;
$object_key = null;
$group_by_key   = null;

if (is_array($inQuery))
{
$query  = $inQuery['query'];
$coersions  = $inQuery['coersions'];
$object_key = $inQuery['object_key'];
$group_by_key   = $inQuery['group_by_key'];
}

try
{
// determine query type
if (strpos($query, 'insert') === false)
{
$rows   = array();
$rowCounter = 0;

foreach ($this-db-query($query) as $row)
{
$fields = array();
$recordKey  = $rowCounter;

foreach ($row as $key = $value)
{
// remember this key if it matches the 
user specified object key
if (($object_key != null)  ($key == 
$object_key))
$recordKey  = 
$value;

// perform user specified coersions
if ($coersions != null)
{
switch ($coersions[$key])
{
case'integer':
$value  
+= 0;
break;

case'float':
$value  
+= 0.0;
break;

case'datetime':
$value  
= new date_object($value);
break;

case'base64_decode':
$value  
= base64_decode($value);
break;

case'hex_decode':
$value 
 = $this-hex_decode($value);
}
}

$fields[$key]   
= $value;
}

// perform grouping if requested
if ($group_by_key == null)
$rows[$recordKey]   = 
$fields;
else
{
$groupKey   = 
$fields[$group_by_key];

if ($rows[$groupKey] == null)
$rows[$groupKey]= 
array();

  

Re: [PHP] Array difficulty

2007-07-31 Thread Robin Vickery
On 31/07/07, Alister Bulman [EMAIL PROTECTED] wrote:
 On 31/07/07, Carlton Whitehead [EMAIL PROTECTED] wrote:
  Couldn't you just do
  arsort($chance);
  $lastItem = chance[( count( $chance ) - 1 )];

  I tried that earlier, but the problem is:
  count( $chance ) - 1 ); returns an integer, so I would be asking for 
  something like $chance[1] or $chance[0], neither of which exist in the 
  array.  Keep in mind $chance only has keys with string names:

 http://uk3.php.net/current

 $chance = array(lowercase = 27, uppercase = 62, integer = 46);
 arsort($chance);

max() returns the maximum value of an array.
array_search() finds the key for a value

So all that's needed to find the key of the maximum value is:

$result = array_search(max($chance), $chance);

I'd pretty much guarantee it'll be about an order of magnitude faster
than any solution that relies on sorting the array.

-robin

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



[PHP] Re: magic quotes

2007-07-31 Thread KVIGOR
Never Mind I figured it out.

KVIGOR [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 If magic quotes is on and I dont have access to the php.ini.

 Is there any way I can strip quotes from the form field with out using 
 AJAX? 

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



[PHP] US Salary Averages for Developers

2007-07-31 Thread Daniel Brown
Good morning, afternoon, evening, or whatever the case may be, folks.

I'm just looking for responses from some of you on salary averages
for those who work with LAMP on a full-time basis.  My job consists of
much more than that, including full *nix server administration and
security; web architecture drafting, interface design, backend
programming, and content editing; integration with previously
offline-only proprietary technology, and more.  I'm also the only web
developer in the company, charged with not only managing the web
servers, but also developing and updating the whole shebang.

As of now, I'm making far less than what I had made on my own, but
because I have faith in the company that I work for, I wanted to get
this first, massive project out of the way to prove myself before
renegotiating my salary and developing a career path with this company
(should I choose to remain here instead of taking the offer I got from
Google --- very sweet).

The bottom line, if any of you are working full-time in a
LAMP-related position, could you give me some pointers?  Or, if you've
seen job postings with salary ranges (I've already tried to run
reports on the web, but they're too single-task-centric), I'd
appreciate the heads-up.

Thank you all!

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Unexpected values in an associative array[Solved]

2007-07-31 Thread Ken Tozier
Turns out that objects returned from SQL queries contain two parts  
for every field, one with a string key and one with an index key.  
Adding an is_numeric test on the keys allows you to filter out the  
numeric keys if you want to. For example:


foreach ($row as $key = $value)
{
if (!is_numeric($key))
{
/* do stuff here */
}
}

Ken


On Jul 31, 2007, at 10:35 AM, Ken Tozier wrote:


Hi

I think this is probably just a misunderstanding on my part, but  
I'm creating associative arrays with string keys from MySQL query  
results and when I put a value in the array, I get the expected key  
association along with an index key that has a different value.


For example: If I have a table Foo, do a select, perform  
coersions on the results, and place the coerced value in an array  
with a key, a second uncoerced value is also placed in the array  
with an index key. I know all associative arrays have both key and  
index accessors, but I would think that the values should be the same.


Here's the full function.
(Note: The line where values are added to the array is: $fields 
[$key] = $value; after the coersions switch statement)


function query_database($inQuery)
{
$query  = $inQuery;
$coersions  = null;
$object_key = null;
$group_by_key   = null;

if (is_array($inQuery))
{
$query  = $inQuery['query'];
$coersions  = $inQuery['coersions'];
$object_key = $inQuery['object_key'];
$group_by_key   = $inQuery['group_by_key'];
}

try
{
// determine query type
if (strpos($query, 'insert') === false)
{
$rows   = array();
$rowCounter = 0;

foreach ($this-db-query($query) as $row)
{
$fields = array();
$recordKey  = $rowCounter;

foreach ($row as $key = $value)
{
// remember this key if it matches the 
user specified object key
if (($object_key != null)  ($key == 
$object_key))
$recordKey  = 
$value;

// perform user specified coersions
if ($coersions != null)
{
switch ($coersions[$key])
{
case'integer':
$value  
+= 0;
break;

case'float':
$value  
+= 0.0;
break;

case'datetime':
$value  
= new date_object($value);
break;

case'base64_decode':
$value  
= base64_decode($value);
break;

case'hex_decode':
$value 
 = $this-hex_decode($value);
}
}

$fields[$key]   
= $value;
}

// perform grouping if requested
if ($group_by_key == null)
$rows[$recordKey]   = 

[PHP] Re: magic quotes

2007-07-31 Thread M. Sokolewicz

KVIGOR wrote:

Never Mind I figured it out.

KVIGOR [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

If magic quotes is on and I dont have access to the php.ini.

Is there any way I can strip quotes from the form field with out using 
AJAX? 


I have no idea how you would do it _WITH_ AJAX actually, I can come up 
with dozens of ways to do it with standard PHP...


- Tul

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



Re: [PHP] Unexpected values in an associative array

2007-07-31 Thread Jim Lucas

Ken Tozier wrote:

foreach ($this-db-query($query) as $row)


Well, this is what I was going to say, is that probably query is using *_fetch_array() instead of 
*_fetch_assoc() or *_fetch_row()



--
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] Unexpected values in an associative array[Solved]

2007-07-31 Thread Robin Vickery
On 31/07/07, Ken Tozier [EMAIL PROTECTED] wrote:
 Turns out that objects returned from SQL queries contain two parts
 for every field, one with a string key and one with an index key.
 Adding an is_numeric test on the keys allows you to filter out the
 numeric keys if you want to. For example:

Or don't get numeric keys in the first place:

foreach ($this-db-query($query, PDO::FETCH_ASSOC) as $row)

-robin

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



Re: [PHP] Unexpected values in an associative array[Solved]

2007-07-31 Thread Zoltán Németh
2007. 07. 31, kedd keltezéssel 11.29-kor Ken Tozier ezt írta:
 Turns out that objects returned from SQL queries contain two parts  
 for every field, one with a string key and one with an index key.  
 Adding an is_numeric test on the keys allows you to filter out the  
 numeric keys if you want to. For example:

thats the documented behaviour of mysql_fetch_array. but you do have
mysql_fetch_assoc and mysql_fetch_row at hand, which return an array
with one method of indexing only
see:
http://hu.php.net/mysql_fetch_array

I don't know what your $this-db-query($query) uses, but you could
look there...

greets
Zoltán Németh

 
 foreach ($row as $key = $value)
 {
   if (!is_numeric($key))
   {
   /* do stuff here */
   }
 }
 
 Ken
 
 
 On Jul 31, 2007, at 10:35 AM, Ken Tozier wrote:
 
  Hi
 
  I think this is probably just a misunderstanding on my part, but  
  I'm creating associative arrays with string keys from MySQL query  
  results and when I put a value in the array, I get the expected key  
  association along with an index key that has a different value.
 
  For example: If I have a table Foo, do a select, perform  
  coersions on the results, and place the coerced value in an array  
  with a key, a second uncoerced value is also placed in the array  
  with an index key. I know all associative arrays have both key and  
  index accessors, but I would think that the values should be the same.
 
  Here's the full function.
  (Note: The line where values are added to the array is: $fields 
  [$key] = $value; after the coersions switch statement)
 
  function query_database($inQuery)
  {
  $query  = $inQuery;
  $coersions  = null;
  $object_key = null;
  $group_by_key   = null;
  
  if (is_array($inQuery))
  {
  $query  = $inQuery['query'];
  $coersions  = $inQuery['coersions'];
  $object_key = $inQuery['object_key'];
  $group_by_key   = $inQuery['group_by_key'];
  }
  
  try
  {
  // determine query type
  if (strpos($query, 'insert') === false)
  {
  $rows   = array();
  $rowCounter = 0;
  
  foreach ($this-db-query($query) as $row)
  {
  $fields = array();
  $recordKey  = $rowCounter;
  
  foreach ($row as $key = $value)
  {
  // remember this key if it matches the 
  user specified object key
  if (($object_key != null)  ($key == 
  $object_key))
  $recordKey  = 
  $value;
  
  // perform user specified coersions
  if ($coersions != null)
  {
  switch ($coersions[$key])
  {
  case'integer':
  $value  
  += 0;
  break;
  
  case'float':
  $value  
  += 0.0;
  break;
  
  case'datetime':
  $value  
  = new date_object($value);
  break;
  
  case'base64_decode':
  $value  
  = base64_decode($value);
  break;
  
  case'hex_decode':
  $value  
  = $this-hex_decode($value);
  }
  }
  
  

Re: [PHP] US Salary Averages for Developers

2007-07-31 Thread Nathan Nobbe
Daniel,

unfortunately php isnt fetching the fat salaries java and .net are.
especially for strictly
development.  administration is another story and that seems to be a typical
supplement
to a well paid php programmer.
by my estimation avg. salary for php developer (strictly) in the us is
around $50k.  $80k is
high, above that is exceptional.  for administrative work as well i think
youre looking at
some negotiating to settle on the final amount.

-nathan

On 7/31/07, Daniel Brown [EMAIL PROTECTED] wrote:

 Good morning, afternoon, evening, or whatever the case may be, folks.

 I'm just looking for responses from some of you on salary averages
 for those who work with LAMP on a full-time basis.  My job consists of
 much more than that, including full *nix server administration and
 security; web architecture drafting, interface design, backend
 programming, and content editing; integration with previously
 offline-only proprietary technology, and more.  I'm also the only web
 developer in the company, charged with not only managing the web
 servers, but also developing and updating the whole shebang.

 As of now, I'm making far less than what I had made on my own, but
 because I have faith in the company that I work for, I wanted to get
 this first, massive project out of the way to prove myself before
 renegotiating my salary and developing a career path with this company
 (should I choose to remain here instead of taking the offer I got from
 Google --- very sweet).

 The bottom line, if any of you are working full-time in a
 LAMP-related position, could you give me some pointers?  Or, if you've
 seen job postings with salary ranges (I've already tried to run
 reports on the web, but they're too single-task-centric), I'd
 appreciate the heads-up.

 Thank you all!

 --
 Daniel P. Brown
 [office] (570-) 587-7080 Ext. 272
 [mobile] (570-) 766-8107

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




Re: [PHP] Unexpected values in an associative array[Solved]

2007-07-31 Thread Ken Tozier


On Jul 31, 2007, at 11:40 AM, Robin Vickery wrote:


Or don't get numeric keys in the first place:

foreach ($this-db-query($query, PDO::FETCH_ASSOC) as $row)


Robin: Bingo! That did the trick.

I knew my solution was hokey but I haven't used PDO before this  
project so wasn't aware of what it did behind the scenes.


Thanks everyone for the quick replies.

Ken

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



RE: [PHP] Unexpected values in an associative array

2007-07-31 Thread Instruct ICC

From: Ken Tozier [EMAIL PROTECTED]
Hi

I think this is probably just a misunderstanding on my part, but I'm  
creating associative arrays with string keys from MySQL query results  and 
when I put a value in the array, I get the expected key  association along 
with an index key that has a different value.


And here's some sample output

array(6) {
  [task_id]=
  int(22)
  [0]=
  string(2) 22
  [container_id]=
  int(3784)
  [1]=
  string(4) 3784
  [name]=
  string(12) 108-6972.XTG
  [2]=
  string(24) 3130382D363937322E585447
}

Why is that? Is there any way to fix this without coercing the same  value 
twice? Once for the key accessor and once for the index accessor?


Thanks In advance

Ken


What is $coersions or $inQuery['coersions']?  Maybe a var_dump or a print_r 
on that for the list?

What is $value and what is this supposed to do:

case'integer':
$value  
+= 0;
break;

case'float':
$value  
+= 0.0;


If $value is a string, you should quote your 0 and 0.0.  What add 0 or 0.0 
to an int or float respectively?


Do a print_r on $row before your foreach ($row as $key = $value) and echo 
your $key and $value as the first line in after that for loop.  Then echo 
$coersions[$key].  Does $coersions[$key] have what you want for switch 
($coersions[$key]) at this point?  I assume you expect $coersions to contain 
datatypes, but does it?


Perhaps start at the end considering the structure of the output array you 
want, then consider how to populate it to have that structure.


What's the extra [] about in $rows[$groupKey][] = $fields;
Maybe that's where your duplicates are coming from although I don't see 
duplicates in your output.


_
http://liveearth.msn.com

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



Re: [PHP] Authentication

2007-07-31 Thread Nathan Nobbe
Dan,

i realize i misunderstood the original question.  am i to understand you
have php running
on all of the client machines ?

thanks,

-nathan

On 7/31/07, Dan Shirah [EMAIL PROTECTED] wrote:

 Correct Stut, I want transparent authentication, but I also want to have
 the
 currently logged in user name pulled so I can use it for tracking
 purposes.
 My application deals with very sensitive company information and I want to
 pull the username for tracking purposes. I have everything running local
 on
 the same PC.  Win2k3 server, IIS, PHP and MSSQL Server.  I have PHP
 installed for use with ldap and have NT Authentication set in IIS for the
 site.  This allows me to perform the transparency, but I can't seem to
 extract the username.

 On 7/29/07, Stut [EMAIL PROTECTED] wrote:
 
  Dan Shirah wrote:
   I looked on PHP.net but I couldn't not find anything suitable to
 answer
  my
   question.
  
   Within PHP, is there a way to pull the name of the user that is
  currently
   logged into the PC?
  
   I know with some of the _SERVER functions you can pull the IP of the
  machine
   and other data, is there a function within this family that would
 work?
 
  I'm assuming you're after transparent authentication where the user
  doesn't need to do anything to authenticate with the site. This is only
  possible with IE as the client on an NT domain with the server on the
  same domain. If you're using IIS on the server then it's as easy as
  removing anonymous and basic authentication from the site/directory. If
  you're using Apache or something else you need to find an
  extension/module that provides NTLM authentication, but not all of the
  ones I tried fully supported the transparent side of it.
 
  I implemented this for a corporate intranet a while back in Apache on
  FreeBSD with mod_ntlm (Google for it - dunno if it's still maintained).
  That was in 2004 and information was sparse, but with a bit of research
  and *lots* of experimenting I was able to get it to work.
 
  To be perfectly honest, if I were doing it again I'd save the time and
  use IIS on the server - sooo much easier.
 
  -Stut
 
  --
  http://stut.net/
 



Re: [PHP] if inside an echo.

2007-07-31 Thread Neil Freeman
Or another way...

for ($value = 0; $value = 2000; $value += 100)
{
echo sprintf(option value=\%s\%s%s/option, $value, 
(($min_rent==$value) ?  selected=\selected\ : NULL), $value);
}

Hulf wrote:
 **
 This Email Has Been Virus Swept
 **
 I am outputting a selectbox and want to do the follwoing. How can I add the 
 IF statement inside the the echo?
 
 
 for ($value = 0; $value = 2000; $value += 100) {
 
  echo option value=\$value\ if ($min_rent==$value) {echo 
 selected=selected } $value/option;
 
   }
 

***
ATTENTION: E-mail addressed to the
[EMAIL PROTECTED] will only be delivered for a limited
period. Please update your address book using the
From address on this e-mail.

This communication is confidential to the intended
recipient(s). If you are not that person you are not
permitted to make use of the information and you are
requested to notify the sender immediately of its receipt
and then destroy the copy in your possession.  Any views
or opinions expressed are those of the originator and may
not represent those of L-3 Communications ASA Ltd.

Sent from L-3 Communications ASA Ltd.
Registered in England and Wales Company No. 1730717
Registered Office: 5th Floor, Chiswell Street, London EC1Y 4UP
***
This Email has been Virus Checked
***

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



Re: [PHP] Unexpected values in an associative array[Solved]

2007-07-31 Thread Robert Cummings
On Tue, 2007-07-31 at 11:29 -0400, Ken Tozier wrote:
 Turns out that objects returned from SQL queries contain two parts  
 for every field, one with a string key and one with an index key.  
 Adding an is_numeric test on the keys allows you to filter out the  
 numeric keys if you want to. For example:
 
 foreach ($row as $key = $value)
 {
   if (!is_numeric($key))
   {
   /* do stuff here */
   }
 }

BAH, use the correct function. You're using mysql_fetch_array() when you
SHOULD be using mysql_fetch_assoc().

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread Crayon Shin Chan
On Tuesday 31 July 2007 21:37, tedd wrote:

 Extortion? Are you saying that anyone who owes a copyright is
 obtaining money through force or threats? That sounds strange.

Wow, it seems you haven't heard of the RIAA and their racketeering.

-- 
Crayon

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread Crayon Shin Chan
On Tuesday 31 July 2007 22:21, Larry Garfield wrote:

 Commercial publication didn't exist as a concept until after the
 invention of the printing press, which is when copyright was invented
 in order to protect the business of the publishers.

Presumably you're talking about Europe, because in China where the 
printing press was invented I don't think they enacted any copyright laws 
until much much much later.

-- 
Crayon

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



Re: [PHP] Unexpected values in an associative array

2007-07-31 Thread Ken Tozier


On Jul 31, 2007, at 12:06 PM, Instruct ICC wrote:


array(6) {
  [task_id]=
  int(22)
  [0]=
  string(2) 22
  [container_id]=
  int(3784)
  [1]=
  string(4) 3784
  [name]=
  string(12) 108-6972.XTG
  [2]=
  string(24) 3130382D363937322E585447
}

What is $coersions or $inQuery['coersions']?  Maybe a var_dump or a  
print_r on that for the list?


For the above record, $coersions is an associative array of the form

array('task_id'= 'integer', 'container_id'= 'integer',  
'name'='hex_decode');


I found that I was doing a lot of coersions with results of SQL  
queries to turn them into real integers, floats or decode from base64/ 
hex before I could use them so rolling all that ugly stuff into the  
query makes it so users of the function don't have to do coersions  
any more. There may be a better way to perform coersions from string  
types returned by PDO queries and their real types but I'm a PDO noob  
so don't know if one.



What is $value and what is this supposed to do:

case'integer':
$value  
+= 0;
break;

case'float':
$value  
+= 0.0;


If $value is a string, you should quote your 0 and 0.0.  What add 0  
or 0.0 to an int or float respectively?


The point of these is to convert the strings to ints, floats, decode  
them etc...


What's the extra [] about in $rows[$groupKey][] = $fields;
Maybe that's where your duplicates are coming from although I don't  
see duplicates in your output.


Another thing I found the need for was to group rows in a select  
result by specific keys. For example say a query gets all ads in a  
publication, and you want to physically group them by page. That's  
what that group function does.


Ken

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



[PHP] Job Opportunity: PHP Developer

2007-07-31 Thread Denice Fitzgerald
Dear Eric,

I am an IT Recruiter looking for PHP Developers for an exciting
opportunity in the Las Vegas NV area. I am looking for people really
passionate about PHP technology! The company is a technology innovator
and are known for being the top technology company in Las Vegas. If you
have any interest, I want to talk to you! Don't worry, they are helping
with relocation if you are not in the NV area. I am requiesting your
help, therefore offering a REFERRAL BONUS if you should point someone my
way that is hired. This company is growing, therefore adding more
developers!!! The salary is based on your experience level. 

If Las Vegas doesn't work, how about Kansas City or Dallas? Please
contact me for details. I am very excited to speak with you regarding my
opportunities! Thanks for your consideration and I look forward to
speaking with you! 

Sincerely,
Denice Fitzgerald

Interested in this job opportunity?
Click here
http://www.zoominfo.com/Search/JobApply.aspx?t=128rid=1387376e=php-ge
[EMAIL PROTECTED]  to learn more...

Position Title:  PHP Developer   
Location:Las Vegas, NV  
Description: PHP Developer
Tasks and Responsibilities: 

· Develop a particular project from start to finish. Use standard
libraries. Implement changes to keep project in line with overall
technical direction of company.
· Work with other developers to insure compatibility with core libraries
and exposed services.
· Independent worker able to meet deadlines

Skills and Qualifications: 

· 3-5 years experience
· College degree in CS preferred, but not required if more than 3 years
experience
· Strong SQL and PHP skills
· Additional languages (C, C++, Perl, Python) beneficial
· Strong understanding of CVS and Subversion
· Must be able to write and debug advanced SQL queries
· Strong understanding of advanced Object Oriented Programming
principles 
· Able to solve complex, multi-dimensional problems
· Can produce documentation of concept including flow charts and API
specifications
· Understanding of internet services such as SOAP, XMLRPC, WDDX, etc.
· Understanding of networking protocols such as HTTP, TCP/IP





Options:.   I would like to learn more
http://www.zoominfo.com/Search/JobApply.aspx?t=128rid=1387376e=php-ge
[EMAIL PROTECTED]  
..  Keep me informed
http://www.zoominfo.com/Search/JobApply.aspx?t=64rid=1387376e=php-gen
[EMAIL PROTECTED]  of other relevant opportunities 
..  Forward this opportunity
http://www.zoominfo.com/Search/JobForward.aspx?rid=1387376e=php-genera
[EMAIL PROTECTED]  to a friend 

This message was sent by:

Allied Global Services
In a dynamic business climate companies must be able to forecast the
human influence on their business accurately in order to achieve a
sustainable return on investment. Our distinctive capabilities have
grown from the understanding that companies need solutions that
cultivate an environment in which people are engaged and empowered to
meet business goals in a repeatable manner.

For more than 40 years, Allied Global Services has been engaged by our
clients to deliver value-based Human Capital, Consulting, and Staff
Augmentation Solutions designed to help companies drive positive
business change.

We view an organization in three parts: People, Process, and Tools and
deliver solutions that addresses all three business layers. Our blended
approach has been the proven catalyst for Allied Global Services' growth
over the last four decades. 




10901 W. 84th Terrace Suite 100 Lenexa, KS 66214

Allied Global Services respects your online privacy. If you would like
to be removed from future Allied Global Services mailings, you may
unsubscribe by clicking here
http://www.zoominfo.com/Search/JobOptOut.aspx?rid=1387376e=php-general
@lists.php.net .




Re: [PHP] Job Opportunity: PHP Developer

2007-07-31 Thread Daniel Brown
Do we have an Eric here?

On 7/31/07, Denice Fitzgerald [EMAIL PROTECTED] wrote:
 Dear Eric,

 I am an IT Recruiter looking for PHP Developers for an exciting
 opportunity in the Las Vegas NV area. I am looking for people really
 passionate about PHP technology! The company is a technology innovator
 and are known for being the top technology company in Las Vegas. If you
 have any interest, I want to talk to you! Don't worry, they are helping
 with relocation if you are not in the NV area. I am requiesting your
 help, therefore offering a REFERRAL BONUS if you should point someone my
 way that is hired. This company is growing, therefore adding more
 developers!!! The salary is based on your experience level.

 If Las Vegas doesn't work, how about Kansas City or Dallas? Please
 contact me for details. I am very excited to speak with you regarding my
 opportunities! Thanks for your consideration and I look forward to
 speaking with you!

 Sincerely,
 Denice Fitzgerald

 Interested in this job opportunity?
 Click here
 http://www.zoominfo.com/Search/JobApply.aspx?t=128rid=1387376e=php-ge
 [EMAIL PROTECTED]  to learn more...

 Position Title:  PHP Developer
 Location:Las Vegas, NV
 Description: PHP Developer
 Tasks and Responsibilities:

 · Develop a particular project from start to finish. Use standard
 libraries. Implement changes to keep project in line with overall
 technical direction of company.
 · Work with other developers to insure compatibility with core libraries
 and exposed services.
 · Independent worker able to meet deadlines

 Skills and Qualifications:

 · 3-5 years experience
 · College degree in CS preferred, but not required if more than 3 years
 experience
 · Strong SQL and PHP skills
 · Additional languages (C, C++, Perl, Python) beneficial
 · Strong understanding of CVS and Subversion
 · Must be able to write and debug advanced SQL queries
 · Strong understanding of advanced Object Oriented Programming
 principles
 · Able to solve complex, multi-dimensional problems
 · Can produce documentation of concept including flow charts and API
 specifications
 · Understanding of internet services such as SOAP, XMLRPC, WDDX, etc.
 · Understanding of networking protocols such as HTTP, TCP/IP





 Options:.   I would like to learn more
 http://www.zoominfo.com/Search/JobApply.aspx?t=128rid=1387376e=php-ge
 [EMAIL PROTECTED]
 ..  Keep me informed
 http://www.zoominfo.com/Search/JobApply.aspx?t=64rid=1387376e=php-gen
 [EMAIL PROTECTED]  of other relevant opportunities
 ..  Forward this opportunity
 http://www.zoominfo.com/Search/JobForward.aspx?rid=1387376e=php-genera
 [EMAIL PROTECTED]  to a friend

 This message was sent by:

 Allied Global Services
 In a dynamic business climate companies must be able to forecast the
 human influence on their business accurately in order to achieve a
 sustainable return on investment. Our distinctive capabilities have
 grown from the understanding that companies need solutions that
 cultivate an environment in which people are engaged and empowered to
 meet business goals in a repeatable manner.

 For more than 40 years, Allied Global Services has been engaged by our
 clients to deliver value-based Human Capital, Consulting, and Staff
 Augmentation Solutions designed to help companies drive positive
 business change.

 We view an organization in three parts: People, Process, and Tools and
 deliver solutions that addresses all three business layers. Our blended
 approach has been the proven catalyst for Allied Global Services' growth
 over the last four decades.




 10901 W. 84th Terrace Suite 100 Lenexa, KS 66214

 Allied Global Services respects your online privacy. If you would like
 to be removed from future Allied Global Services mailings, you may
 unsubscribe by clicking here
 http://www.zoominfo.com/Search/JobOptOut.aspx?rid=1387376e=php-general
 @lists.php.net .





-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Job Opportunity: PHP Developer

2007-07-31 Thread Robert Cummings
On Tue, 2007-07-31 at 12:35 -0400, Daniel Brown wrote:
 Do we have an Eric here?

Eric Butera? Though I don't see him anywhere in the thread :)

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] Job Opportunity: PHP Developer

2007-07-31 Thread Robert Cummings
On Tue, 2007-07-31 at 12:11 -0400, Denice Fitzgerald wrote:
 Dear Eric,
 
 I am an IT Recruiter looking for PHP Developers for an exciting
 opportunity in the Las Vegas NV area. I am looking for people really
 passionate about PHP technology! The company is a technology innovator
 and are known for being the top technology company in Las Vegas. If you
 have any interest, I want to talk to you! Don't worry, they are helping
 with relocation if you are not in the NV area. I am requiesting your
 help, therefore offering a REFERRAL BONUS if you should point someone my
 way that is hired. This company is growing, therefore adding more
 developers!!! The salary is based on your experience level. 
 
 If Las Vegas doesn't work, how about Kansas City or Dallas? Please
 contact me for details. I am very excited to speak with you regarding my
 opportunities! Thanks for your consideration and I look forward to
 speaking with you! 

This being 2007 and all I get quite curious why so many businesses are
still trying to follow the archaic physical location infrastructure. I
mean sure, I can see it if you need to set up machines, or make the boss
some coffee, but for programming, running DB queries, etc... it's seems
somewhat asinine.

Perhaps you as a recruiter could explain the rationale a bit. I mean I
have clients across north America and in Europe, we've never experienced
any problems. Sure there were times they wanted to take me out for
beers, but I settled for some quality time with my family instead. I
don't have to commute, my monthly transit bill is about $50 CAD
(groceries, swim lessons for the kids, etc), and I'm almost always
within reach when problems occur (though I don't use IMs since they are
annoying little beasts).

I realize you're just a recruiter, but does this ever come up in
discussion with your clients?

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



[PHP] Looking for PHP 5.0.1 for Mac OS X 10.3.9

2007-07-31 Thread Rahul Sitaram Johari
Ave,

Does anyone have the old PHP installers for Mac OS X 10.3.9 ??
Entropy.ch only has the latest installer for 10.4 ­ I¹m looking for any PHP
5 Installer that will install  work on a Mac OS X 10.3.9 ... Can¹t seem to
find it anywhere!!!

Help!



~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²



[PHP] Re: PHP list as a blog

2007-07-31 Thread Michelle Konzack
Sorry for the late fdrop in...

Am 2007-07-28 21:31:01, schrieb Børge Holen:
 On Thursday 14 June 2007 00:41, Philip Thompson wrote:
  On Jun 13, 2007, at 1:15 PM, Richard Lynch wrote:
   On Wed, June 13, 2007 12:21 am, Crayon Shin Chan wrote:
snip
   Do students and interns still have quotas on their email accounts?...
 
  Yes. It does depend on the university though. For our students, the
  default is only 50 megs - they may request more. However, these text-
  only emails don't really take up that much space.

WOW, thats hard...

I have an account at the University in Freiburg/Germany and we
have 1 GByte of storage sonce diskspace cost nearly nothing...

(Even if there are over 100.000 Students)

 There seems to be some failure to comunicate (I believe the Prodigy said 
 that)... whatever, quotas on the universities will not keep you from 
 recieving mail... or download anything of the net.  It just defines the space 
 available to the user. The temporary space available lets you pull way more, 
 and get a delete warning from either an automated system or an admin (at my 
 university, wasn't it 10 days or so before forced deletion on random objects 
 occured?... dunno).

Random objects or objects older then a a certain age?
I do not believem that a Sysadmin would delete Random objects...

 Imagine an master or phD degree getting lost because someone set up an 
 university server with some weird download quota.

Such things could be quiet expensive...

 This could hardly be _A_ reason for makin' this blog... the amount of mail or 
 numbers should not be an issue. If it is so... how about them digest mails?

...and I realy ca not believe, that an University seup a quota of 50 
MBytes.

I know many students which create montly folders and then they tar it 
up at the end of the month.

For example I have the whole list fro, 2002 to 2007 as local mailarchive
and the smalest bzip2 tarball is from 2003-11 (308kByte) and the biggest
2007-04 (1538 kByte) and deco,pressed nearly 6 times bigger MAILDIR.

Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSN LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


[PHP] headers-excel file-bad data

2007-07-31 Thread blackwater dev
Hello,

I have an excel file that I am generating.  If I copy over the generated
file and then open it in excel, it works fine, if I try to let the user
download it using the headers below, when I then open it excel complains
that it is an unrecognizable format and the info is garbled...any ideas???

Thanks!

header('Pragma: public');
header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);  //
Date in the past
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate'); //
HTTP/1.1
header('Cache-Control: pre-check=0, post-check=0, max-age=0');//
HTTP/1.1
header (Pragma: no-cache);
header(Expires: 0);
header('Content-Transfer-Encoding: none');
header('Content-Type: application/vnd.ms-excel;'); //
This should work for IE  Opera
header(Content-type: application/x-msexcel);//
This should work for the rest
header('Content-Disposition: attachment; filename=myfile.xls');
readfile(/tmp/myfile.xls);


[PHP] Re: headers-excel file-bad data

2007-07-31 Thread blackwater dev
Looks like I have an empty space somewhere...this code is called down in a
class and if I just cut this out and copy into it's own file and call that
file from the browser, it works fine.  It is someone getting garbled down in
the class.

On 7/31/07, blackwater dev [EMAIL PROTECTED] wrote:

 Hello,

 I have an excel file that I am generating.  If I copy over the generated
 file and then open it in excel, it works fine, if I try to let the user
 download it using the headers below, when I then open it excel complains
 that it is an unrecognizable format and the info is garbled...any ideas???

 Thanks!

 header('Pragma: public');
 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);  //
 Date in the past
 header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
 header('Cache-Control: no-store, no-cache, must-revalidate'); //
 HTTP/1.1
 header('Cache-Control: pre-check=0, post-check=0, max-age=0');//
 HTTP/1.1
 header (Pragma: no-cache);
 header(Expires: 0);
 header('Content-Transfer-Encoding: none');
 header('Content-Type: application/vnd.ms-excel;'); //
 This should work for IE  Opera
 header(Content-type: application/x-msexcel);//
 This should work for the rest
 header('Content-Disposition: attachment; filename=myfile.xls');
 readfile(/tmp/myfile.xls);






Re: [PHP] Job Opportunity: PHP Developer

2007-07-31 Thread Eric Butera
On 7/31/07, Robert Cummings [EMAIL PROTECTED] wrote:
 On Tue, 2007-07-31 at 12:35 -0400, Daniel Brown wrote:
  Do we have an Eric here?

 Eric Butera? Though I don't see him anywhere in the thread :)

 Cheers,
 Rob.
 --
 ...
 SwarmBuy.com - http://www.swarmbuy.com

 Leveraging the buying power of the masses!
 ...

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


Hello! ;)

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



[PHP] Re: PHP list as a blog

2007-07-31 Thread M. Sokolewicz

Michelle Konzack wrote:

Sorry for the late fdrop in...

Am 2007-07-28 21:31:01, schrieb Børge Holen:

On Thursday 14 June 2007 00:41, Philip Thompson wrote:

On Jun 13, 2007, at 1:15 PM, Richard Lynch wrote:

On Wed, June 13, 2007 12:21 am, Crayon Shin Chan wrote:

snip

Do students and interns still have quotas on their email accounts?...

Yes. It does depend on the university though. For our students, the
default is only 50 megs - they may request more. However, these text-
only emails don't really take up that much space.


WOW, thats hard...

I have an account at the University in Freiburg/Germany and we
have 1 GByte of storage sonce diskspace cost nearly nothing...

(Even if there are over 100.000 Students)

There seems to be some failure to comunicate (I believe the Prodigy said 
that)... whatever, quotas on the universities will not keep you from 
recieving mail... or download anything of the net.  It just defines the space 
available to the user. The temporary space available lets you pull way more, 
and get a delete warning from either an automated system or an admin (at my 
university, wasn't it 10 days or so before forced deletion on random objects 
occured?... dunno).


Random objects or objects older then a a certain age?
I do not believem that a Sysadmin would delete Random objects...

Imagine an master or phD degree getting lost because someone set up an 
university server with some weird download quota.


Such things could be quiet expensive...

This could hardly be _A_ reason for makin' this blog... the amount of mail or 
numbers should not be an issue. If it is so... how about them digest mails?


...and I realy ca not believe, that an University seup a quota of 50 
MBytes.
The Radboud University in Nijmegen (The Netherlands) has a 100MiB quota 
till a few months ago, it has been changed to 1.5GiB now I think. It's 
actualy not that strange, it depends on how active the university thinks 
its students are on the internet and what an average student requires. 
In this case, I'm part of the Medical Sciences Faculty, there's not that 
much use for a ton of webspace. While on the Faculty for Mathematics and 
Informatics the students receive 2GiB of extra storage space at the 
start of their first year (it has since been changed to 1.5GiB across 
all faculties though)


I know many students which create montly folders and then they tar it 
up at the end of the month.


For example I have the whole list fro, 2002 to 2007 as local mailarchive
and the smalest bzip2 tarball is from 2003-11 (308kByte) and the biggest
2007-04 (1538 kByte) and deco,pressed nearly 6 times bigger MAILDIR.

Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant




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



Re: Re[2]: [PHP] Reading registry values

2007-07-31 Thread John A DAVIS


2 simple VBA/VB functions that write to specific place in the registry. Here is my library of code on this:

GetSetting(App.EXEName, "Properties", strPropertyName)
SaveSetting(App.EXEName, "Properties", strPropertyName, Trim(CStr(varValue)))
Specific place:
HKEY_CURRENT_USER\Software\VB and VBA Program Settings

If you issue a GetSetting when none exists, it simply returns an empty string. If you issue a SaveSetting where no entry exists, it simply creates the entry and places the value in the entry. Essentially , these have built in error handling.


 "Richard Davey" [EMAIL PROTECTED] 7/30/2007 11:49 AM 
Hi,Monday, July 30, 2007, 7:40:52 PM, you wrote: I'm not sure that there's actually anything you'd need to access in the server registry (and certainly no registry in Linux if you're also transitioning from Windows to Linux). And depending on what the ActiveX control your ASP pages accessed actually does, it may be better to recreate it in PHP instead of trying to access ActiveX via PHP.I've seen ASP components that required access to the registry in orderto validate they were legal. I.e. the installer of the component wrotesome serial number or something to the registry, which the ASP scriptschecked.Nasty, but true. Just saying that he may well have a genuine need forit.Cheers,Rich-- Zend Certified Engineerhttp://www.corephp.co.uk"Never trust a computer you can't throw out of a window"-- PHP General Mailing List (http://www.php.net/)To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Reading registry values

2007-07-31 Thread John A DAVIS


Hope this isn't overkill but it is a module (read "COM", or "VBA module") to manipulate the registry:

Option Compare DatabaseOption Explicit

'' Created by E.Spencer - This code is public domain.''Security Mask constantsPublic Const READ_CONTROL = H2Public Const SYNCHRONIZE = H10Public Const STANDARD_RIGHTS_ALL = H1FPublic Const STANDARD_RIGHTS_READ = READ_CONTROLPublic Const STANDARD_RIGHTS_WRITE = READ_CONTROLPublic Const KEY_QUERY_VALUE = H1Public Const KEY_SET_VALUE = H2Public Const KEY_CREATE_SUB_KEY = H4Public Const KEY_ENUMERATE_SUB_KEYS = H8Public Const KEY_NOTIFY = H10Public Const KEY_CREATE_LINK = H20Public Const KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL Or KEY_QUERY_VALUE Or _ KEY_SET_VALUE Or KEY_CREATE_SUB_KEY Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY Or _ KEY_CREATE_LINK) And (Not SYNCHRONIZE))Public Const KEY_READ = ((STANDARD_RIGHTS_READ Or KEY_QUERY_VALUE Or _ KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY) And (Not SYNCHRONIZE))Public Const KEY_EXECUTE = ((KEY_READ) And (Not SYNCHRONIZE))Public Const KEY_WRITE = ((STANDARD_RIGHTS_WRITE Or KEY_SET_VALUE _ Or KEY_CREATE_SUB_KEY) And (Not SYNCHRONIZE))' Possible registry data typesPublic Enum InTypes ValNull = 0 ValString = 1 ValXString = 2 ValBinary = 3 ValDWord = 4 ValLink = 6 ValMultiString = 7 ValResList = 8End Enum' Registry value type definitionsPublic Const REG_NONE As Long = 0Public Const REG_SZ As Long = 1Public Const REG_EXPAND_SZ As Long = 2Public Const REG_BINARY As Long = 3Public Const REG_DWORD As Long = 4Public Const REG_LINK As Long = 6Public Const REG_MULTI_SZ As Long = 7Public Const REG_RESOURCE_LIST As Long = 8' Registry section definitionsPublic Const HKEY_CLASSES_ROOT = H8000Public Const HKEY_CURRENT_USER = H8001Public Const HKEY_LOCAL_MACHINE = H8002Public Const HKEY_USERS = H8003Public Const HKEY_PERFORMANCE_DATA = H8004Public Const HKEY_CURRENT_CONFIG = H8005Public Const HKEY_DYN_DATA = H8006' Codes returned by Reg API callsPrivate Const ERROR_NONE = 0Private Const ERROR_BADDB = 1Private Const ERROR_BADKEY = 2Private Const ERROR_CANTOPEN = 3Private Const ERROR_CANTREAD = 4Private Const ERROR_CANTWRITE = 5Private Const ERROR_OUTOFMEMORY = 6Private Const ERROR_INVALID_PARAMETER = 7Private Const ERROR_ACCESS_DENIED = 8Private Const ERROR_INVALID_PARAMETERS = 87Private Const ERROR_NO_MORE_ITEMS = 259' Registry API functions used in this module (there are more of them)Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As LongPrivate Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As LongPrivate Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, ByVal lpData As String, lpcbData As Long) As LongPrivate Declare Function RegEnumValue Lib "advapi32.dll" Alias "RegEnumValueA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpValueName As String, lpcbValueName As Long, ByVal lpReserved As Long, lpType As Long, ByVal lpData As String, lpcbData As Long) As LongPrivate Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As LongPrivate Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As LongPrivate Declare Function RegSetValueExString Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal lpValue As String, ByVal cbData As Long) As LongPrivate Declare Function RegSetValueExLong Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpValue As Long, ByVal cbData As Long) As LongPrivate Declare Function RegFlushKey Lib "advapi32.dll" (ByVal hKey As Long) As LongPrivate Declare Function RegEnumKey Lib "advapi32.dll" Alias "RegEnumKeyA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpName As String, ByVal cbName As Long) As LongPrivate Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As LongPrivate Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long

Public Sub Main()On Error GoTo BYEWriteRegistry HKEY_CURRENT_USER, "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\", "DisableTaskMgr", ValDWord, "0"BYE:End Sub

' This routine allows you to get values from anywhere in the Registry, it currently' only handles string, double word and binary values. Binary values are returned as' hex strings. Example'' Text1.Text = ReadRegistry(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", 

Re: [PHP] Job Opportunity: PHP Developer

2007-07-31 Thread Blackbird

Robert Cummings wrote:

This being 2007 and all I get quite curious why so many businesses are
still trying to follow the archaic physical location infrastructure. I
mean sure, I can see it if you need to set up machines, or make the boss
some coffee, but for programming, running DB queries, etc... it's seems
somewhat asinine.
  
I was a big supporter of remote work until recently. I myself worked 
extensively from a home office (every day, barring a day or two a month 
when a client visit was required, usually for sales meetings), and loved 
the freedom and extra time it gave me.


When we started our new business, my business partner convinced me that 
this wasn't always a good idea, and now I can see the other side. We 
have a design and development team here that works VERY closely 
together. I don't mean we have meetings once a day, I mean we talk 
CONSTANTLY. You couldn't possibly do this with IM or e-mail - it's too 
slow, and too annoying, and you can't do things like slide your chair 
over and see your colleague's screen. We'd need to be on the phone the 
entire day.


If we didn't have a development TEAM - if everybody worked on their own 
projects - it wouldn't be a problem. Also, if we had a HUGE project that 
we could document very well, then go off and do our own things for a 
while and come back to meet up and discuss, we'd be fine. But we're a 
startup, so our requirements are changing daily - it's not poor software 
engineering, it's just the nature of a startup. Agility is one of our 
best assets, and not one we'd ever want to sacrifice.


Are there solutions? Sure. You could talk about remote control apps, 
Skype, and so on, but they're all hacks, things to make it 'ok' to do 
remotely what would really be better in the same office, the same room. 
All of this is just IN THIS CASE - I'm not saying working remotely is 
wrong. However, I CAN say (honestly) that for an average employee 
commute time of 20 minutes each way we gain 2.5 hours a day in 
productivity gains. We work together as a team, we can comment on each 
others' ideas all as a group, and we don't have to say Well, Chris said 
that Eric said ...


From an employer's perspective, it has other benefits. For one thing, 
morale is much higher this way. It's hard to feel like a member of a 
family when you never see the people you work with. If somebody puts in 
some long hours, you don't get the emotional impact from seeing an 
e-mail sent at 1am that you get from seeing a guy in the same chair, 
same clothes, that he was in when you left late last night, because he 
pulled an all-nighter.


I think each method has its place. Working from an office isn't the 
'old' way, it's just 'one' way. Working from home or a remote location 
is 'another' way. Each is appropriate for different situations, and 
neither is inherently wrong or right. Use the best thing that works for 
your situation.


Regards,
Chad

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



Re: [PHP] Rules of Engagement

2007-07-31 Thread Ryan A

 
 PS
 I never have figured out why one would want to
 notify a zillion
 strangers that you're on vacation...
 
 I mean, duh, talk about a security risk...
 
 Hey, stranger, I'm on vacation!!!  Nice big house
 of computer geek
 full of stuff sitting unwatched!!!
 
 I'm really not sure who thought this was a Good
 Idea...
 

SH! Dont let the cat outa the bag, he has some
good stuff but not a lot of it...so we cant all share.
You also wont belive the crazy stuff he has hanging on
the walls... and the room where i am typing this out
is way too dark... I'll actually be doing him a favour
by taking this comp althogh the cheap sod does not
have a flatscreen... so here goes my gym workout...
the best thing is... whoops, gotto cut this short...
his phones ringing... yippee! He left is mobile back!

Will continue this from my house... 

Cheers!
R

P.S Anyone wanna bid on a Nokia N73? going cheap...
 I dont have the box or the charger but its in pretty
good condition.

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)


   

Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, 
photos  more. 
http://mobile.yahoo.com/go?refer=1GNXIC

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread Ryan A

--- Crayon Shin Chan [EMAIL PROTECTED]
wrote:

 On Monday 30 July 2007 23:49, tedd wrote:
 
  The opposite of BUYING is STEALING
 
 I think you meant SELLING.
 

Actually to make things easier just lets add a NOT

eg:
The opposite of BUYING is NOT BUYING


Ok, I admit it, am bored and came back to the list
after 3 days and see this thread still going strong...
had to atleast give it a bump ;)

Cheers!
R

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)


   

Yahoo! oneSearch: Finally, mobile search 
that gives answers, not web links. 
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread Ryan A

  Yes, but that's why it's called faith.
 
 My point was that it makes no sense to try and prove
 or demonstrate 
 anything using God because the existance of God
 itself cannot be proven 
 or demonstrated.

Stut,
 
There will be a demonstration of god's existance  in a
little while, please look up when you are burning and
I am sipping nector.






Sorry, couldnt resist, no offense meant ;)

Cheers!
R

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)


  

Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel 
and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread Ryan A

 You have a right to your belief, but that doesn't
 make your belief right.
 
 This works both ways.
 
 Oh yeah, well my dad can beat up your dad.

Well, get both your dads together coz my dad can beat
both of them up.

Reasoning, I'm pretty young compared to most of you
guys so my dad is younger than your dads plus i'll
secretly give him a baseball bat... ;)

Cheers!
R

P.S  no guns allowed in this discussion

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)


  

Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel 
and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 

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



[PHP] Problem with filemtime

2007-07-31 Thread Kevin Murphy
I'm running the following script (simplified for discussion) to  
create a CSV file. My problem here is that the first filemtime and  
the last filemtime always equal each other. What I am trying to get  
is the filemtime ($new_last_modified) of the file that was just  
executed 3 lines earlier. Is there something I need to do  
differently? I tried putting a sleep(20) after the fclose, but that  
didn't seem to help.


$csv_file = myFile.csv;
$last_modified_csv = filemtime($csv_file);

$fh = fopen($csv_file, 'w') or die(can't open file);
fwrite($fh, Data Goes Here);
fclose($fh);

$new_last_modified = filemtime($csv_file);

--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada College
www.wnc.edu
775-445-3326

Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread Stut

Ryan A wrote:

Yes, but that's why it's called faith.

My point was that it makes no sense to try and prove
or demonstrate 
anything using God because the existance of God
itself cannot be proven 
or demonstrated.


Stut,
 
There will be a demonstration of god's existance  in a

little while, please look up when you are burning and
I am sipping nector.


That would also be the day the devil drives to work in a snow plough right?


Sorry, couldnt resist, no offense meant ;)


None taken. My beliefs are my beliefs and yours are yours, and you are 
entitled to say anything you want, as am I. If you prefer to lead a 
blinkered life go ahead, but I prefer to use my head to find my way 
through life rather than live by the teachings of a bunch of fiction 
written by men.


If this God really thinks that makes me unworthy that's its business. 
I really don't want anything to do with any entity that thinks like that.


-Stut

--
http://stut.net/

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



Re: [PHP] Problem with filemtime

2007-07-31 Thread Stut

Kevin Murphy wrote:
I'm running the following script (simplified for discussion) to create a 
CSV file. My problem here is that the first filemtime and the last 
filemtime always equal each other. What I am trying to get is the 
filemtime ($new_last_modified) of the file that was just executed 3 
lines earlier. Is there something I need to do differently? I tried 
putting a sleep(20) after the fclose, but that didn't seem to help.


$csv_file = myFile.csv;
$last_modified_csv = filemtime($csv_file);

$fh = fopen($csv_file, 'w') or die(can't open file);
fwrite($fh, Data Goes Here);
fclose($fh);

$new_last_modified = filemtime($csv_file);


The data returned by filemtime is cached. Use clearstatcache to clear 
the cache (http://php.net/clearstatcache).


-Stut

--
http://stut.net/

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread Ryan A
Hey!

  Sorry, couldnt resist, no offense meant ;)
 
 None taken. My beliefs are my beliefs and yours are
 yours

Yep, and what I said was in jest, and you took it in
jest.End of discussion between us :)

Am just replying to anyone else who's reading this,
please lets not fork this into a god discussion too ;)

Cheers!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)


  

Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel 
and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 

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



Re: [PHP] Problem with filemtime

2007-07-31 Thread Eddie Dunckley
On Tue 31 Jul 07 22:57, Kevin Murphy wrote:
 $csv_file = myFile.csv;
 $last_modified_csv = filemtime($csv_file);

 $fh = fopen($csv_file, 'w') or die(can't open file);
 fwrite($fh, Data Goes Here);
 fclose($fh);

add a clearstatcache() in here.

(and sometimes just for because you might want to emit a buffer, a 
flush();

 $new_last_modified = filemtime($csv_file);

-- 
Eddie Dunckley - [EMAIL PROTECTED] - Realtime Travel Connections 
IBE Development, www.rttc.co.za, cell 083-379-6891, fax 086-617-7831
Where 33deg53'37.23S 18deg37'57.87E Cape Town Bellville Oakdale ZA
  Honk if you hate peace and quiet.

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



Re: [PHP] Reading registry values

2007-07-31 Thread \Crash\ Dummy
 Hope this isn't overkill but it is a module (read COM, or VBA module)
 to manipulate the registry:

Overkill is a massive understatement. :-)

As noted elsewhere in this thread, I got what I wanted by using the PHP exec
command to execute a VB script, which has all the registry access I need. Much
simpler than compiling and installing a COM object module. :-)

To answer everyone's curiosity as to why I want to access the registry, I am
working on my home computer with a dynamic IP, and I need to know what it is so
I can modify my httpd.conf (or hosts) file, if necessary. The ASP page I am
converting is my browser home page, which has lots of useful stuff I obtain with
server side scripts. Here is a snapshot (no, this isn't my home server).
http://crash.thedatalist.com/temp/home16m.png

I am currently running both servers (Apache and IIS), but I'd like to use a
universal scripting format.
-- 
Crash
Please reply to the group. E-mail is blocked.

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread David Powers

Larry Garfield wrote:
If a plumber fixes your toilet, he gets paid once.  


A plumber came recently to fix our hot water system. It took him less 
than one hour. He got paid about $100.


If a writer writes a book, he gets paid n times, where n is a (hopefully for 
him) ever-increasing number.


I write a book (actually, I've written several). It takes me on average 
seven or eight months' full-time work. You buy a copy of my book, I get 
$1.50-$2.25. For me to get the same rate of pay as a plumber, I would 
need to sell 70,000 copies of each book. I should be so lucky.


David Powers

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread Tijnema
On 8/1/07, David Powers [EMAIL PROTECTED] wrote:
 Larry Garfield wrote:
  If a plumber fixes your toilet, he gets paid once.

 A plumber came recently to fix our hot water system. It took him less
 than one hour. He got paid about $100.

  If a writer writes a book, he gets paid n times, where n is a (hopefully for
  him) ever-increasing number.

 I write a book (actually, I've written several). It takes me on average
 seven or eight months' full-time work. You buy a copy of my book, I get
 $1.50-$2.25. For me to get the same rate of pay as a plumber, I would
 need to sell 70,000 copies of each book. I should be so lucky.

 David Powers

Yes, and the president gets a lot more


Tijnema


-- 
Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread tedd

At 9:21 AM -0500 7/31/07, Larry Garfield wrote:


Disclaimer:  Yes, I was raised by a pair of college history professors. :-)



Ahhh, that explains it.

Cheers,

tedd

PS: I'm done.
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] headers-excel file-bad data

2007-07-31 Thread tedd

At 1:32 PM -0400 7/31/07, blackwater dev wrote:

Hello,

I have an excel file that I am generating.  If I copy over the generated
file and then open it in excel, it works fine, if I try to let the user
download it using the headers below, when I then open it excel complains
that it is an unrecognizable format and the info is garbled...any ideas???


Yes, an idea -- this might be due to a bug that's found in excel 
files if a value exist (or doesn't) in the first cell or column of 
the spreadsheet. I vaguely remember running into that several years 
ago.


You can Google excel bug first cell

HTH,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Re: Pirate PHP books online?

2007-07-31 Thread Robert Cummings
On Tue, 2007-07-31 at 14:29 -0700, Ryan A wrote:
 Hey!
 
   Sorry, couldnt resist, no offense meant ;)
  
  None taken. My beliefs are my beliefs and yours are
  yours
 
 Yep, and what I said was in jest, and you took it in
 jest.End of discussion between us :)
 
 Am just replying to anyone else who's reading this,
 please lets not fork this into a god discussion too ;)

Some light humour:

http://www.unm.edu/~humanism/socvsjes.htm

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] Job Opportunity: PHP Developer

2007-07-31 Thread tedd

At 12:11 PM -0400 7/31/07, Denice Fitzgerald wrote:

 The company is a technology innovator
and are known for being the top technology company in Las Vegas.


And this technology innovator requires people on-site to program? 
Sounds like typical technology to me.


Why can't one of these technology innovator companies move next door to me?

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Profile / Debug w/o server modification?

2007-07-31 Thread Instruct ICC

From: Richard Lynch [EMAIL PROTECTED]
Your dev box should only match in software versions (okay, and any
really funky specialized hardware like a hardware random number
generator MAYBE).

Don't ask them for a Gigaplex Mu-on 16-cpu 64 Gig RAM 4 Terabyte hard
drive box.

Take an old box out of your closet and install the same versions of
the OS, Webserver, DB, and PHP and call it done.

Now, a QA box, where you do load-testing and serious release
candidate testing, yeah, THAT should match the production box, if at
all possible...


Do you know of any (free as in money) disk imaging software that would 
capture all the patches/configurations/etc.  Actually, as I write this, I 
remember the reason the imaging tool I used had mysterious failures was 
probably due to bad memory, and I could use a different box now.


Thanks for the advice.


Regarding duplicating the box versus software:
I'm working on a C++ project on a Mac Pro and a MacBook Pro.  Both have 
Intel Core 2 Duo (but the Mac Pro states Xeon, while the MacBook Pro does 
not detail that.  The Mac Pro is 4 cores while the MacBook Pro is 2 cores).
Both use MinGW for Mac 3.4.5, the same mtapi 
http://www.metaquotes.net/files/mtapi.zip and Wine 0.9.40.  Same OS version 
of course, and only 2GB RAM in both each.
I was able to compile on the Mac Pro, but when I tried on the MacBook Pro, I 
receive undefined reference to [EMAIL PROTECTED]  I also saw that on the Mac Pro, 
but I don't remember exactly what I did to resolve it.  I used -shared on 
the MacBook Pro, and I know I did not use that on the Mac Pro.  But now I'm 
getting


../Client/MetaTraderAPI.o: In function `atexit':
/Volumes/senscass/mingw/build_runtime/../mingw-runtime-3.9/dllcrt1.c:161: 
multiple definition of `_atexit'
/usr/local/i386-mingw32-3.4.5/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/crt2.o:/Volumes/senscass/mingw/build_runtime/../mingw-runtime-3.9/crt1.c:269: 
first defined here

../Client/MetaTraderAPI.o: In function `_onexit':
/Volumes/senscass/mingw/build_runtime/../mingw-runtime-3.9/dllcrt1.c:177: 
multiple definition of `__onexit'
/usr/local/i386-mingw32-3.4.5/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/crt2.o:/Volumes/senscass/mingw/build_runtime/../mingw-runtime-3.9/crt1.c:277: 
first defined here

../Client/MetaTraderAPI.o: In function `_onexit':
/Volumes/senscass/mingw/build_runtime/../mingw-runtime-3.9/dllcrt1.c:183: 
multiple definition of `___do_sjlj_init'
/usr/local/i386-mingw32-3.4.5/lib/gcc/i386-mingw32/3.4.5/crtbegin.o:crtstuff.c:(.text+0x0): 
first defined here


It was concept code from my memory and I'm going to have to make sure I 
duplicate my steps, but other than the processor, I thought I had identical 
environments.


I haven't had time to test the PHP environment you suggested.

_
Local listings, incredible imagery, and driving directions - all in one 
place! http://maps.live.com/?wip=69FORM=MGAC01


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



Re: [PHP] Job Opportunity: PHP Developer

2007-07-31 Thread Michael Preslar
Dont know if this would be of any use to anyone but.. meh..

I interviewed with a company called The Selling Source, based out of
Las Vegas, for a PHP position.. Was told They are always hiring PHP
developers.. The recruiter I had been working with made it sound like
TSS had a huge turn over rate.

I ended up find a job locally, so didnt have to move to Sin City..

On 7/31/07, tedd [EMAIL PROTECTED] wrote:
 At 12:11 PM -0400 7/31/07, Denice Fitzgerald wrote:
   The company is a technology innovator
 and are known for being the top technology company in Las Vegas.

 And this technology innovator requires people on-site to program?
 Sounds like typical technology to me.

 Why can't one of these technology innovator companies move next door to me?

 Cheers,

 tedd
 --
 ---
 http://sperling.com  http://ancientstones.com  http://earthstones.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