RE: [PHP] Friday's Question

2013-09-20 Thread Jeff Burcher
 -Original Message-
 From: Tedd Sperling [mailto:t...@sperling.com]
 Sent: Friday, September 20, 2013 12:52 PM
 To: php-general@lists.php.net
 Subject: [PHP] Friday's Question
 
 Hi gang:
 
 Do you use a Mousepad?
 
 My reason for asking is that I've used a Mousepad ever since mice first
came
 out (back when they had one ball).
 
 Now that mice are optical (no balls), Mousepads are not really needed --
or
 so I'll told by the college -- you see, they don't provide Mousepads for
their
 student's computers.
 
 As such, I wondered what's the percentage of programmers still using a
 Mousepad?
 
 Secondly, are Mousepads used primarily by older programmers (like me)
 while younger programmers don't use Mousepads, or what?
 
 So -- please respond with:
 
 Age: *
 Mousepad: Yes/No
 
 Thank you,
 
 tedd
 
 PS: * If you don't want to provide your actual age, then indicate your age
by
 stating young, middle-age, old-age, ancient, or whatever term
 describes your age.
 
 Alternate -- I claim that you can tell a man's age by ten-times the number
of
 personal products he routinely uses, for example:
 
 Years Old - Personal Products
 10Toothpaste
 20Toothpaste, Deodorant
 30Toothpaste, Deodorant, Aftershave
 40Toothpaste, Deodorant, Aftershave, Minoxidil
 50Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H
 60Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag
 Bomb
 70Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag
 Bomb, Fixodent
 
 So, you could indicate age by stating Bag Bomb like me.
 
 ___
 tedd sperling
 t...@sperling.com
 
 
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
 http://www.php.net/unsub.php
 

 Age: 54
 Mousepad: Yes

Laser mice don't like reflective surfaces so much and if I don't carve out
desk space for my mouse with a mousepad, I find that moving my mouse over
multiple sheets of paper, paperclips, and whatnot is not very effective and
somewhat frustrating.

Jeff




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



RE: [PHP] how old is this version of PHP?

2013-08-19 Thread Jeff Burcher

I apologize if this is off topic, but this raises a question for me. Why
can't new versions be backwards compatible? Is it really that difficult to
accomplish? This has been a complaint of mine for years with Windows ever
since we went from 95 to 98. I am an AS400 programmer and I have legacy
programs written in RPG II, which died 20 years ago, and they still run fine
on the newest version of AS400 or iSeries or Power System or whatever the
heck it is called now. I also have PHP scripts that are many years old that
work just fine the way they are, if a new version doesn't come along and
make me have to reprogram for no reason just because it can't handle older
code. Really, have Do loops and data calls changed that much over the years?
I mean, all you do is set a condition, use a variable key field, and voila,
data is pulled and processed, no big deal. Yeah, you can get fancy with it,
but the core basics are still the same. I have been programming for over 35
years and like to think that once a program is built it should run forever.
Do we just accept that we have to rewrite every program we ever wrote every
time a new version comes out? A little extreme, but you get my point.
Comments? Suggestions?

(I am also the kind of guy who thinks quality made hand tools from the 1800s
are superior to many purchased today at Lowes or Home Depot.)

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping Works
Making Metal Parts since 1946.


 -Original Message-
 From: Lester Caine [mailto:les...@lsces.co.uk]
 Sent: Monday, August 19, 2013 6:24 AM
 To: php-general@lists.php.net
 Subject: Re: [PHP] how old is this version of PHP?
 
 Larry Garfield wrote:
  5.2.9 was released in February of 2009.  5.2 is completely retired and
  out of support.  5.3 is on security-only life-support.  5.4 is the
legacy stable
 release.
 
  Yes, 5.2.9 IS that old. :-)  Really, get a host that has made it into
  this decade.  (GoDaddy apparently doesn't meet that qualification.)
  You're doing clients a disservice by allowing them to run such an
  ancient and unsupported version.
 
 While the statements are correct, many users are not in a position to move
 from their currently working systems to even 5.3 let alone 5.4. There is
still a
 lot of legacy code that unless a few more people step up and help bring it
 forward for the many - non programming - users who are stuck with legacy
 applications, they will remain requiring 5.2 to run. ISPs got caught out
when
 they arbitrarily moved accounts forward, and GoDaddy have even been
 caught by that, so maintaining a LTS version of PHP5.2 is the lesser evil
...
 Windows 2000 is supposed to be dead, but *I* still have sites reliant on
it
 because the code and hardware is unsupported in even XP. Saying
 something is dead only works if there is an affordable way of moving
forward
 ;)
 
 --
 Lester Caine - G8HFL
 -
 Contact - http://lsces.co.uk/wiki/?page=contact
 L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve -
 http://enquirysolve.com/ Model Engineers Digital Workshop -
 http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
 
 --
 PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
 http://www.php.net/unsub.php
 



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



[PHP] select function

2012-10-25 Thread Jeff Burcher
Hi,

 

I can't remember if this is the PHP list for RPG programmers or not, so
apologize if this is the wrong one.

 

Is there an equivalent command in PHP for the SELECT statement in RPG? I see
switch, which is a little similar, but far from how it actually functions.

 

For those not familiar with the SELECT statement here is how I envision it
working in a PHP format similar to switch:

 

SELECT {

WHEN $Auth = 0:

WHEN $A = 1:

echo('$Aprint_list');

WHEN $B = 1:

echo('$Bprint_list');

WHEN $A = 2:

echo('$Aprint_list');

echo('$Aprint_list');

WHEN $B = 2:

echo('$Bprint_list');

echo('$Bprint_list');

DEFAULT:

}

 

The syntax may be a little off, but you get the picture. No breaks are
needed because it only performs the first match it comes to, then exits the
SELECT statement when finished the commands under that match. Putting a WHEN
statement with nothing to perform means exactly that, if this matches, do
nothing, then exit the SELECT statement. I hope that makes sense. The big
difference is you can put anything behind each WHEN statement as opposed to
looking at only the one variable like with switch. I am thinking I just need
to get creative with the switch or elseif commands, but thought I would ask
the list first if they had any better suggestions.

 

 

Thanks,

 

Jeff Burcher - IT Dept

Allred Metal Stamping

PO Box 2566

High Point, NC 27261

(336)886-5221 x229

j...@allredmetal.com

 



RE: [PHP] Bounce messages

2012-09-21 Thread Jeff Burcher
Hi,

I don't know if this is specifically what he is referring to when he says, the 
'reply to sender' email handling camp , but I know that when I just click 
Reply it goes to the individual whose post I am commenting on. I need to click 
on Reply All and several emails are in the blanks and I need to delete them all 
and move the list email address from the CC: box to the TO: box. If I am not 
paying attention and don't do this little email musical chairs process, 
sometimes I will get out of office replies from some of the email addresses in 
the reply. Is this 'bouncing'?

Jeff

 -Original Message-
 From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
 Sent: Friday, September 21, 2012 2:56 PM
 To: Jim Lucas
 Cc: Lester Caine; php-general@lists.php.net
 Subject: Re: [PHP] Bounce messages
 
 On Fri, 2012-09-21 at 09:56 -0700, Jim Lucas wrote:
 
  On 09/21/2012 12:40 AM, Lester Caine wrote:
   I know that the php list are one of the 'reply to sender' email
   handling camp rather than reply to list. I can cope with that now
   and handle the multiple reply address problem this end so I ONLY
   reply to list. BUT is there no way of cleaning up the bounce emails
   we all get when posting to the list(s)?
  
   ( Waits to delete all the bounce messages for this post :) )
  
 
  Doing a little checking on your IP address, I have found that your
  mail server IP is listed on a black list.  Check the link below.
 
  http://mxtoolbox.com/SuperTool.aspx?action=blacklist%3a213.123.20.127
 
  This could be the source of your bounce messages.
 
  --
  Jim Lucas
 
  http://www.cmsws.com/
  http://www.cmsws.com/examples/
 
 
 
 I sporadically get a lot of messages that appear as bounces where people on
 the list filter out replies and make you sign up to some web service to prove
 you're a real person. Is that the sort of bounce you're talking about?
 
 --
 Thanks,
 Ash
 http://www.ashleysheridan.co.uk
 





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



RE: [PHP] Re: Programmers and developers needed

2012-09-18 Thread Jeff Burcher
 -Original Message-
 From: Robert Cummings [mailto:rob...@interjinn.com]
 Sent: Tuesday, September 18, 2012 2:22 PM
 To: Matijn Woudt
 Cc: Daevid Vincent; PHP-General
 Subject: Re: [PHP] Re: Programmers and developers needed
 
 On 12-09-18 02:12 PM, Matijn Woudt wrote:
  On Tue, Sep 18, 2012 at 8:02 PM, Daevid Vincent dae...@daevid.com
 wrote:
  -Original Message-
  From: Matijn Woudt [mailto:tijn...@gmail.com]
 
  You're missing the most important aspect of social networks..
 Advertising.
 
  Please tell me that is said sarcastically. Advertising is the cancer of the
 internet. There was a time when there weren't ad banners, interstitials, pop-
 ups, pop-unders, spam, and all the other bullshit you have to sift through on
 a daily basis.
 
 
  No,  I was not meant to be sarcastic. You might find advertising to be
  the cancer of the internet, think again. The internet would be pretty
  much dead without ads, or would you rather pay $0.01 per Google search
  query? $0.01 for each e-mail send, $0.01 for each news article you
  want to read, etc, etc? (or more related, $0.01 for each facebook
  message you want to send/read?)
 
  In the end, good advertising means success, take the drop of facebook
  shares because of the investors being worried about facebooks'
  advertising possibilities.
 
 History suggests the internet would be here without advertising since it
 originated without advertising, originally grew without advertising, and 
 finally
 evolved into this mixed blessing we have today. There's plenty of greatness
 on the internet, there's also plenty of steaming piles of manure.
 
 Cheers,
 Rob.

Yeah, it grew out of government funding before advertising via educational 
institutions and the military. Would you rather have a free economy supported 
internet or a government controlled internet? Also, for those of us who are old 
enough to remember posting to text based bulletin boards, the influx of 
corporate money has greatly increased the infrastructure and functionality of 
the internet and has helped to make it a global phenomenon, which a government 
supported internet may have never become. Money makes all things possible. If 
you don't think so, try building a server farm and hooking up to a trunk line 
without it. My two cents. Now, I'm broke.

Jeff
 --
 E-Mail Disclaimer: Information contained in this message and any attached
 documents is considered confidential and legally protected.
 This message is intended solely for the addressee(s). Disclosure, copying,
 and distribution are prohibited unless authorized.
 
 --
 PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
 http://www.php.net/unsub.php
 





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



RE: [PHP] MS SQL server connection problem.

2012-09-05 Thread Jeff Burcher
Hi,

I am relatively new as well. I tried both of those methods with no luck. I
finally had success using odbc_connect(). See below:

$conn = odbc_connect(Driver={SQL
Server};Server=$server;Database=$database;, $user, $password);

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com

 -Original Message-
 From: Girish Talluru [mailto:girish.dev1...@gmail.com]
 Sent: Wednesday, September 05, 2012 5:57 AM
 To: php-general@lists.php.net
 Cc: rahu...@radiare.co.in
 Subject: [PHP] MS SQL server connection problem.
 
 Hi All,
 
 I'm having problem while connecting to MS SQL server from my php
 program.
 
 I tried downloading driver from Microsoft and changed php.ini file but it
is
 showing the following error.
 
 This statement I used to connect.
 $connect = mssql_connect(localhost, PC6, password);
 
 This is the error message I got
 Call to undefined function mssql_connect() in
 C:\wamp\www\Test\dbTest.php
 
 Then I tried other one as shown below:
 
 
 This statement I used to connect.
 $connect = sqlsrv_connect(localhost, PC6, password);
 
 This is the error message I got
 Array ( [0] = Array ( [0] = IMSSP [SQLSTATE] = IMSSP [1] = -49 [code]
= -
 49 [2] = This extension requires the Microsoft SQL Server 2012 Native
Client.
 Access the following URL to download the Microsoft SQL Server 2012 Native
 Client ODBC driver for x86:
 http://go.microsoft.com/fwlink/?LinkId=163712 [message] = This extension
 requires the Microsoft SQL Server 2012 Native Client. Access the following
 URL to download the Microsoft SQL Server 2012 Native Client ODBC driver
for
 x86: http://go.microsoft.com/fwlink/?LinkId=163712 ) [1] = Array ( [0] =
 IM002 [SQLSTATE] = IM002 [1] = 0 [code] = 0 [2] = [Microsoft][ODBC
 Driver Manager] Data source name not found and no default driver specified
 [message] = [Microsoft][ODBC Driver Manager] Data source name not
 found and no default driver specified ) )
 
 It is asking to download a native client. but i have already downloaded a
 driver at http://www.microsoft.com/en-in/download/details.aspx?id=20098
 named SQLSRV30.EXE
 
 why do I need a native client or ODBC driver when I already got this
driver
 installed in my system.
 
 Please help me out with this guys. I'm new to this.
 
 Thanks,
 Girish Talluru




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



RE: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-20 Thread Jeff Burcher
 -Original Message-
 From: Lester Caine [mailto:les...@lsces.co.uk]
 Sent: Friday, July 20, 2012 4:05 AM
 To: php-general@lists.php.net
 Subject: Re: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal
 
 Paul M Foster wrote:
  Here's another one: There are currently discussions in the U.S.
  Congress in favor of forcing internet vendors to charge sales tax
  on*all*  sales, regardless of whether the vendor has a presence in that
 state or not.
  Imagine having to file state sales tax returns in 50 states. This
  effort has rather significant bipartisan support. Now ask yourself
  what large corporation with brick and mortar stores *wouldn't* sign on
  to support this one? That's what you're up against. You've got
  Amazon.com on your side. Yay. You might want to get busy on that one.
 
 In Europe VAT is applied even on on-line sales. It is the likes of Amazon
 shipping bulk stock from overseas 'clients' into European warehouses and
 then supplying them without VAT added directly in Europe that is the
 problem! How can I compete with someone who is also giving next day
 delivery, but 20% cheaper ...
 American sellers are one of the problems here.
 
 There are two sides to every problem and simply fighting for one side is
as
 bad.
 What is needed is a reasoned debate rather than things like 'The Cat
Signal'
 which personally I find as objectionable as the laws it's complaining
about!
 
 --
 Lester Caine - G8HFL
 -
 Contact - http://lsces.co.uk/wiki/?page=contact
 L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve -
 http://enquirysolve.com/ Model Engineers Digital Workshop -
 http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

This sounds more like a business annoyance than an internet freedom problem,
but okay. Technically, in the US, I thought it is the end-consumer that
needs to pay a sales tax to the state where they live. Consumer retail
businesses are required to tack them on at the point of sale as a
convenience for both the consumer and the government, then pass the money
on. The seller only pays taxes, to the municipality(s) where their business
is physically located, based on their net profit. So the sales tax itself
does not come out of the company's pocket. The company bears the cost of
tracking, processing, and forwarding the taxes to the government(s)
involved, but that is a deductible expense. Sales taxes are a tedious, but
not costly, normal business expense.

Really, how hard is it for computer savvy people to sort their sales
transactions by customer's state and sum up the sales tax amounts paid so
they can write a check every quarter. Many businesses would be happy to have
to mail 50 checks every quarter, one to each state. That means they are
making sales in every state!  That sounds like a profitable business to me.
And as far as filling out 50 sales and use tax forms each quarter, they have
these things called computers now that make pulling in data and printing
forms happen at the touch of a button. Maybe some enterprising programmer
could write software to do just that and sell it on the internet.

We need to stop playing idealistic revolutionary and help shape real
solutions. The fact that you are allowed to run a business on the internet
is the internet freedom you are looking for. You have won the revolution!
Now, deal with the realities of running a business. Putting your business on
the internet should not be a magic pass to avoid the costs of doing
business. We need to admit we are part of the system and figure out a
streamlined way for internet businesses to pay their fair share. The Free
in free economy does not mean it doesn't cost money, time, effort, etc. to
do business.

The internet is not a magic cloud run by fairy dust. The internet was
created by military and higher educational systems, both tax supported
entities. Corporations and governments maintain the infrastructure that
keeps the internet working. Without governments and corporations there would
be no internet. They are the internet. The alternative is to go back to ham
radios. Sorry for the rant, this is a hot button topic for me.


Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com




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



RE: [PHP] What do you call the end-user?

2012-07-19 Thread Jeff Burcher
Hi,

I have always held that the opinion of the end-user/customer is the most
important goal in any systems development project, small or large,
regardless of the programming language/environment. The database structure,
programming, and interfaces are your product. If folks don't like it or
can't figure out how to use it or can't wait until something better comes
along, your product won't survive long in the marketplace. This attitude
should also be held for developers creating in-house solutions as well.
While management may have an overall goal for the purpose of the
programming, the people who will eventually be the ones typing/clicking
their way through your programs are the ones to ultimately satisfy. This
means more pro-active design work with the front line users is always
advisable to create long lasting programs/systems. I use mostly PHP to
create web-based interface screens for AS400 programs in a manufacturing
environment. I can spend all the time I want programming the next greatest
program, but if the guys in the plant don't/won't use it, I have completely
wasted my time. My two cents.


Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com

 -Original Message-
 From: Tedd Sperling [mailto:t...@sperling.com]
 Sent: Thursday, July 19, 2012 1:27 PM
 To: php-general@lists.php.net General
 Subject: [PHP] What do you call the end-user?
 
 Hi gang:
 
 I can't wait for tomorrow -- so here's my off-topic post today.
 
 First question:
 
 What do you call the people who ultimately use your code?
 
 I call them the end-user, but others have stated other terms, such as
 customer or user.
 
 Second question:
 
 Are you concerned with their (whomever) experience in using your code?
 
 This question transcends your code working correctly, accurately, and
 securely -- no need to comment on those aspects. But rather more
 specifically do you consider how easily your whomever can use your work
 efforts?
 
 As you may have guessed - I just attended a UX conference and they provide
 an interesting perspective on UX. I was wondering how php developers
 typically address the subject.
 
 Cheers,
 
 tedd
 
 
 t...@sperling.com
 http://sperling.com
 
 
 --
 PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
 http://www.php.net/unsub.php




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



RE: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-19 Thread Jeff Burcher
Hi,

I have been out of the loop and just did some quick skimming of SOPA/PIPA to
see what all the fuss was about. PIPA seems a little vague, but SOPA seems
pretty straight forward, stop piracy of copyrighted materials. I don't
understand what is wrong with that?

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com


 -Original Message-
 From: Kris Craig [mailto:kris.cr...@gmail.com]
 Sent: Thursday, July 19, 2012 3:40 PM
 To: Ferenc Kovacs
 Cc: Daniel Brown; php-webmas...@lists.php.net; php-general@lists.php.net
 Subject: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal
 
 On Thu, Jul 19, 2012 at 12:36 PM, Ferenc Kovacs tyr...@gmail.com wrote:
 
 
  2012.07.19. 20:21, Daniel Brown danbr...@php.net ezt írta:
 
  
   Forwarding to php-webmas...@lists.php.net, as it's not a
   general user issue where it pertains to php.net.
  
   On Thu, Jul 19, 2012 at 2:02 PM, Kris Craig kris.cr...@gmail.com
  wrote:
Hey guys,
   
I just became aware of this:
   
http://internetdefenseleague.org/
   
   
It's a site setup by Mozilla, Reddit, and others to defend
internet
  freedom
in the wake of recent legislative events in the U.S. and elsewhere
  (full
members list here:
 http://www.internetdefenseleague.org/members).
   
They've setup what they're calling the cat signal, an invisible
bit
  of
embeddable code you can put in your website that will activate
(and
  display
the afore-mentioned signal/link/etc) if/when the next
SOPA/PIPA/etc
  comes
along that threatens the open internet.
   
I'd like to propose that we integrate this into the PHP website.
This issue directly affects our community and we already staked a
claim in
  this
fight when we participated in the last great blackout.
   
In addition, I'd also l ike to propose that we officially join
this
  group
as a member.  I'm not sure if we'd do this by vote or something
  similar to
the RFC process  etc, but if you'll grant me permission, I'd be
happy
  to
do the legwork on this myself (make the HTML edits, contact the
organization on PHP's behalf, etc).
   
   
Thoughts?
   
--Kris
  
  
  
   --
   /Daniel P. Brown
   Network Infrastructure Manager
   http://www.php.net/
  
   --
   PHP Webmaster List Mailing List (http://www.php.net/) To
   unsubscribe, visit: http://www.php.net/unsub.php
  
 
   Btw. we were asked by the to join the league as we were a big traffic
  source on the black out day.
  I don't know if Rasmus is on the webmaster list or not, but we should
  cc him, as he was the driving force behind us joining the anti SOPA
 movement.
 
 I heard back from the webmaster saying that we're already participating
with
 the cat signal on our website.  Given this and no objections, I went ahead
and
 contacted them and asked that they list us on their participating members
 page.
 
 --Kris



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



RE: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-19 Thread Jeff Burcher
Hi,

I agree. My wife is from China and both copyright issues and government
enforcement of things have a whole new meaning there, so I understand the
concerns on both sides.

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com


 -Original Message-
 From: Lester Caine [mailto:les...@lsces.co.uk]
 Sent: Thursday, July 19, 2012 4:10 PM
 To: php-general@lists.php.net
 Subject: Re: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal
 
 Jeff Burcher wrote:
  I have been out of the loop and just did some quick skimming of
  SOPA/PIPA to see what all the fuss was about. PIPA seems a little
  vague, but SOPA seems pretty straight forward, stop piracy of
  copyrighted materials. I don't understand what is wrong with that?
 
 It depends on how heavy handed the solution is ... Currently I can't get
 torrent downloads of Linux distribution DVD's because torrent is blocked.
 Just because some people abuse a technology is no reason to kill that
 technology for legitimate uses?
 
 Action groups that just target one country are a little irritating to the
rest of
 us ... a world wide solution is needed.
 
 --
 Lester Caine - G8HFL
 -
 Contact - http://lsces.co.uk/wiki/?page=contact
 L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve -
 http://enquirysolve.com/ Model Engineers Digital Workshop -
 http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




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



[PHP] global array

2012-06-14 Thread Jeff Burcher
Hi,

 

I am running PHP 5.4 on IIs 6 on a Windows SBS 2003 server. Here is a
streamlined version of the code I am dealing with. I tried to trim as much
as possible to only show code that deals with my issue. The main issue I
think I am having is the global array statement within the function is not
working. From all of the articles I have read, I seem to be doing it
correctly, yet it does not recognize $InvReq as an array within the
function. The array works just fine outside of the function, though. Here
are the error messages:

 

Notice: Undefined variable: InvReq (line numbers point to inside the
function)

Warning: array_key_exists() expects parameter 2 to be array, null given
(line numbers point to inside the function)

 

If anyone could point out where I have incorrect syntax or something else
that would interfere with the global reference for the array within the
function, or tell me I can't do what I am doing using arrays, but assume I
don't have the ability to write to an external work table, which is why I am
trying to use an array in the first place. Thanks.


-

?php

$InvReq = array();

 

// there is some database action here and other programming, but the core
issue is writing to the array, so assume I have all of the necessary data

// data loop to gather inventory requests ---

$linetotal = ???;

$hldpartID = ?; //these variables are provided
by looping, so this check/write/update code snippet happens many times to
update/write to the array

 

if (array_key_exists($hldpartID, $InvReq)) {

$InvReq[$hldpartID] += $linetotal;
//if this line will create the array entry if it does not exist, then I
don't need the key_exists check, anyone??

} else {

$InvReq[$hldpartID] = $linetotal;

}

 

Part_BOM($hldpartID, $linetotal, 1);   //function is
called the first time to set up the BOM

// end loop ---

 

// after gathering all of the inventory requests, check for inventory on
hand

reset ($InvReq);

while (list($PartID,) = each($InvReq)) {

// data loop to get inventory on hand ---

$OnHandQty = ???; //these variables
are provided by looping, so this check/write/update code snippet happens
many times to update/add to the array

 

if (array_key_exists($PartID, $InvReq)) {

$InvReq[$PartID] -=
$OnHandQty;

} else {

$InvReq[$PartID] =
$OnHandQty;

}

Part_BOM($PartID, $OnHandQty, 2);
//function is called the second time to trim up BOM

// end loop ---

}

// print list

$display_block = h2Part Forecast/h2tabletrthPart
Number/ththAmount Needed/th/tr;

reset ($InvReq);

while (list($PartID,$need) = each($InvReq)) {

$needout = number_format($need);

$display_block .=
trtd$PartID/tdtd$needout/td/tr;

}

$display_block .= /table;

 

//---this function adds or subtracts inventory to/from the BOM materials for
the part passed.

//---it also can add parts that make parts with their inventory total for a
multiple level BOM

 

function Part_BOM($PartID, $need, $phase) {

 

global $Invreq;

 

$BOMreq = $need * $BOMQty; //$BOMQty 
$BOMPartID are pulled from a database keyed by $PartID

 

if ($phase == 1) {

if (array_key_exists($BOMPartID, $InvReq)) {

$InvReq[$BOMPartID] +=
$BOMreq;  //first time through adds to array item totals

} else {

$InvReq[$BOMPartID] =
$BOMreq;

}

} else {

if (array_key_exists($BOMPartID, $InvReq)) {

$InvReq[$BOMPartID] -=
$BOMreq;   //second time through subtracts from array item totals

}

}

 

if (--check for parts within other parts for multiple level
BOM--) {

Part_BOM($BOMPartID, $BOMreq, $phase);
//this calls itself and can refer/loop back to itself several times

}

}

?

html

head

/head

body

center

?php echo $display_block ?

/center

/body

/html


--

Thanks for your input,

 

Jeff Burcher - IT Dept

Allred Metal Stamping

PO Box 2566

High Point, NC 27261

(336)886-5221 x229

RE: [PHP] global array

2012-06-14 Thread Jeff Burcher
You're a genius!! Thank you. Uppercase 'R', sheesh. PHP is sooo picky. I worked 
for two days trying to figure that one out. Anyway, for future reference, you 
can pass the entire array as a variable like that?? and do you know if the '+=' 
statement will create an array entry if one doesn't exist?

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com


 -Original Message-
 From: ma...@behnke.biz [mailto:ma...@behnke.biz]
 Sent: Thursday, June 14, 2012 8:04 AM
 To: php-general@lists.php.net; j...@allredmetal.com
 Subject: Re: [PHP] global array
 
 
 
 
 Jeff Burcher j...@allredmetal.com hat am 14. Juni 2012 um 13:55
 geschrieben:
 
 
  function Part_BOM($PartID, $need, $phase) {
 
 
 
  global $Invreq;
 
 
 uppercase R !!!
 And much better is adding it as another parameter and inject it:
 
 function Part_BOM($PartID, $need, $phase, $InvReq) { 
 }
 
 // call it
 Part_BOM(..., ..., ..., $InvReq);
 
 And please read about foreach() and what you can do with it.
 
 --
 PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
 http://www.php.net/unsub.php




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



Re: [PHP] Differences between PHP on LAMP and PHP on Windows Servers

2012-05-31 Thread Gates, Jeff
From: Matijn Woudt tijn...@gmail.commailto:tijn...@gmail.com
Date: Wednesday, May 23, 2012 3:59 PM
To: a...@ashleysheridan.co.ukmailto:a...@ashleysheridan.co.uk 
a...@ashleysheridan.co.ukmailto:a...@ashleysheridan.co.uk
Cc: Jeff Gates gat...@si.edumailto:gat...@si.edu, 
php-general@lists.php.netmailto:php-general@lists.php.net 
php-general@lists.php.netmailto:php-general@lists.php.net
Subject: Re: [PHP] Differences between PHP on LAMP and PHP on Windows Servers



On Wed, May 23, 2012 at 9:35 PM, Ashley Sheridan 
a...@ashleysheridan.co.ukmailto:a...@ashleysheridan.co.uk wrote:
On Wed, 2012-05-23 at 20:54 +0200, Matijn Woudt wrote:

On Tue, May 22, 2012 at 8:15 PM, Gates, Jeff 
gat...@si.edumailto:gat...@si.edu wrote:
 Can anyone tell me what differences I might encounter by working with PHP on 
 a Unix server verses working with PHP on a Windows server. We use Windows 
 production servers here but many of us would like to get more LAMP 
 environments.

 So, I'm wondering if I can use the hive mind here to get a sense of the pros 
 and cons of each platform.

 Thanks.

 Jeff

Apart from all other suggestions, one of the most common errors are
because of different php.ini settings. If you can keep those settings
(mostly) equal, there will not be that many errors.

- Matijn



I would say that's not limited to the distinction between Windows and Linux but 
any server. I've seen what appears to be an identical setup (same version of 
PHP, MySQL, etc) fail only because of a small setting in the php.ini file, just 
because the default was slightly different on the second system; both were 
running Linux.


Yes, ofcourse, that comment was meant for any two systems.

- Matijn

Well, let me also add a related question: what types of problems might I 
encounter if I was trying to set up a Drupal or Wordpress instance on a Windows 
server running PHP as opposed to a Unix server?

Jeff

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



[PHP] Differences between PHP on LAMP and PHP on Windows Servers

2012-05-22 Thread Gates, Jeff
Can anyone tell me what differences I might encounter by working with PHP on a 
Unix server verses working with PHP on a Windows server. We use Windows 
production servers here but many of us would like to get more LAMP environments.

So, I'm wondering if I can use the hive mind here to get a sense of the pros 
and cons of each platform.

Thanks.

Jeff

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



[PHP] Google Search Appliance and PHP

2011-11-03 Thread Gates, Jeff
I am a newbie in PHP.

I need to create a search using Google's Search Appliance for a site I'm 
designing but don't have the slightest idea on how to do it. Because I want to 
incorporate the site's design into the search results page I can't use the 
GSA's simple page layout wizard.

Here's what I need to be able to learn how to do:


 1.  Create a search form and send it to our GSA (this is pretty easy).
 2.  Create a processing page to parse the XML
 3.  Create a results page using the header and footer of my site.

Can anyone help me with simple explanation on how to do steps 2 and 3?

Thanks,

Jeff

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



[PHP] Syntax Question

2011-08-03 Thread Gates, Jeff
I, too, am a super newbie. I have a beginning knowledge of being able to
read php and understand its syntax but I can¹t write it. This is a bit
complicated but here¹s my problem:

I want to create a variable in PHP that I can use to link to an image in our
museum's image website. We have done it with ColdFusion here but I need the
same thing for PHP because I¹m building a site using a php-based CMS called
Omeka.

In ColdFusion the variable is written:
cfset tmpImageDirectory = getToken(artwork.accessionNumber, 1, .)

Basically, it¹s saying find the image on our server by looking for its
accession number within the year directory. Since the first part of the
accession number is the year we got the artwork this variable is saying look
for the accession number in the year directory by first looking at the first
part of that accession number (the year), look in that year directory and
then use the entire accession number to find the image within that
directory.  An example of an accession number is 2011.15. That¹s saying that
artwork was the 15th artwork brought into our collection in 2011. On our
image server it will be found in a directory called 2011. (Am I making
sense?)

Then the Coldfusion call is:

a 
href=http://ids.si.edu/ids/dynamic?container.fullpageid=http://americanart
.si.edu/images/#tmpImageDirectory#/#artwork.accessionNumber#_1a.jpg (the
1a.jpg is simply the size image we want to call).

I need to be able to do the same thing with PHP but have no idea how.

More information: within my site I¹m housing the accession number in a mySQL
database. I¹ve gotten a bit of help on this already (but not enough, that¹s
why I¹m turning to you).

I was told I need to create two variables [('Dublin Core','Identifier') is
the name of the field that houses the accession number):

$accessionNumber =  item('Dublin Core','Identifier');
$tmpImageDirectory = strtok($accessionNumber,.);

And then create a third variable to create a url variable

$url = 
http://ids.si.edu/ids/dynamic?container.fullpageid=http://americanart.si.e
du/images/ 
http://ids.si.edu/ids/dynamic?container.fullpageid=http://americanart.si.e
du/images/$tmpImageDirectory/$artwork.accessionNumber_1a.jpg  +
$tmpImageDirectory + / + $accessionNumber + _1ajpg;

That's as far as I've gotten. I don't know how to put all of these together
using proper PHP syntax. Can someone help me with this? Thanks.

Best, Jeff



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



Re: [PHP] Syntax Question

2011-08-03 Thread Gates, Jeff
On 8/3/11 10:41 AM, ad...@buskirkgraphics.com ad...@buskirkgraphics.com
wrote:

 -Original Message-
 From: Gates, Jeff [mailto:gat...@si.edu]
 Sent: Wednesday, August 03, 2011 10:23 AM
 To: php-general@lists.php.net
 Subject: [PHP] Syntax Question
 
 I, too, am a super newbie. I have a beginning knowledge of being able
 to
 read php and understand its syntax but I can¹t write it. This is a
 bit
 complicated but here¹s my problem:
 
 I want to create a variable in PHP that I can use to link to an image
 in our
 museum's image website. We have done it with ColdFusion here but I need
 the
 same thing for PHP because I¹m building a site using a php-based CMS
 called
 Omeka.
 
 In ColdFusion the variable is written:
 cfset tmpImageDirectory = getToken(artwork.accessionNumber, 1, .)
 
 Basically, it¹s saying find the image on our server by looking for its
 accession number within the year directory. Since the first part of the
 accession number is the year we got the artwork this variable is saying
 look
 for the accession number in the year directory by first looking at the
 first
 part of that accession number (the year), look in that year directory
 and
 then use the entire accession number to find the image within that
 directory.  An example of an accession number is 2011.15. That¹s saying
 that
 artwork was the 15th artwork brought into our collection in 2011. On
 our
 image server it will be found in a directory called 2011. (Am I making
 sense?)
 
 Then the Coldfusion call is:
 
 a
 href=http://ids.si.edu/ids/dynamic?container.fullpageid=http://americ
 anart
 .si.edu/images/#tmpImageDirectory#/#artwork.accessionNumber#_1a.jpg
 (the
 1a.jpg is simply the size image we want to call).
 
 I need to be able to do the same thing with PHP but have no idea how.
 
 More information: within my site I¹m housing the accession number in a
 mySQL
 database. I¹ve gotten a bit of help on this already (but not enough,
 that¹s
 why I¹m turning to you).
 
 I was told I need to create two variables [('Dublin Core','Identifier')
 is
 the name of the field that houses the accession number):
 
 $accessionNumber =  item('Dublin Core','Identifier');
 $tmpImageDirectory = strtok($accessionNumber,.);
 
 And then create a third variable to create a url variable
 
 $url =
 http://ids.si.edu/ids/dynamic?container.fullpageid=http://americanart
 .si.e
 du/images/
 http://ids.si.edu/ids/dynamic?container.fullpageid=http://americanart
 .si.e
 du/images/$tmpImageDirectory/$artwork.accessionNumber_1a.jpg  +
 $tmpImageDirectory + / + $accessionNumber + _1ajpg;
 
 That's as far as I've gotten. I don't know how to put all of these
 together
 using proper PHP syntax. Can someone help me with this? Thanks.
 
 Best, Jeff
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 $url =
 http://ids.si.edu/ids/dynamic?container.fullpageid=http://americanart.si.e
 du/images/
 http://ids.si.edu/ids/dynamic?container.fullpageid=http://americanart.si.e
 du/images/. $tmpImageDirectory ./. $artwork .accessionNumber_1a.jpg .
 $tmpImageDirectory ./. $accessionNumber ._1ajpg;
 
 I am not sure I agree with the way you are setting the $url it looks like
 you have mashed and a url hyperlink partially into 1.
 Like you are trying to set the $url as a image with a link are you trying to
 set a link or an image as the $url?
 
 If you are trying to set a image as the $url do this.
 
 $url = image
 src=http://ids.si.edu/ids/dynamic?container.fullpageid=http://americanart.s
 i.edu/images/. $tmpImageDirectory ./. $accessionNumber ._1ajpg ALT='';
 
 Sorry if this is not correct for what you are trying to do. I just do not
 understand the intent.
 

To be honest with you, I'm not sure what that $url is supposed to do. This
is the info (albeit without any explanation) someone told me to use. But he
didn't tell me how to use it.

Basically, I need to be able to link to an image on our web server
dynamically. The structure of the web server is as I described: each image
has an accession number and each image is housed in a directory on that
server that is named the year that artwork was accessioned. We can retrieve
the accession number that is stored in the data field ('Dublin
Core','Identifier')

An example of an actual (non-dynamic) link to the image server might look
like this: 
http://ids.si.edu/ids/dynamic?container.fullpageid=http://americanart.si.ed
u/images/2011/2011.15_1a.jpg

I just need to be able to build that link dynamically for each artwork on
the site. (Personally, I'm not wedded to the code I posted earlier if
someone can find a better way of doing it. This is just what I was told to
use. Again, I'm a newbie.)


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



Re: [PHP] Invoice Software

2010-06-23 Thread Jeff MacDonald
freshbooks.com

On 2010-06-23, at 11:44 AM, Paul M Foster wrote:

 On Wed, Jun 23, 2010 at 09:52:21AM -0400, Floyd Resler wrote:
 
 Now that I'm finally landing some freelance PHP work, I am in need of some 
 software that I can add clients, enter estimates, keep track of hours, and 
 create invoices with.  I'd like it to be Web-based.  I could write my own, 
 of course, but why do it if it's already done?!  Does anyone know of such a 
 package?
 
 
 Let me know if you don't find what you need. I've built such a system
 over the last few years, used internally by my company. As it's for our
 use internally, I'd have to package it up for your use. But it'd be free
 and FOSS-licensed. (But check what's available first, because packaging
 it up for you would take some work.)
 
 Paul
 
 -- 
 Paul M. Foster
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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



Re: [PHP] Unknown error with imagecreatefromjpeg() on specific GD/PHP versions.

2010-06-16 Thread Jeff MacDonald

On 2010-06-16, at 11:37 AM, Richard Quadling wrote:

 On 16 June 2010 15:26, Jeff MacDonald j...@bignose.ca wrote:
 Hi Everyone,
 
 One of my developers is reporting a problem on our Live server but not our 
 devel server.
 
 Specifically when someon uploads a photo taken by a KODAK EASYSHARE C813, 
 and that image gets processed by imagecreatefromjpeg(), the function returns 
 false.
 
 Our Devel Server Info [this works fine]
PHP Version : 5.2.6-3
GD Version: 2.0 or higher.
EXIF Version: 1.4
 
 Our Live Server Info [this one is the one that fails]
PHP Version: 5.2.13
GD Version : 2.0.34 compatible
EXIF Version : 1.4
 
 To see an example of this in action,
 
 Working function : http://www.equipmentsearch.com/~jeff/tmp/image.php?i=w
 Not working function : http://www.equipmentsearch.com/~jeff/tmp/image.php?i=n
 
 http://www.equipmentsearch.com/~jeff/tmp/image.php.txt is the code.
 
 Does anyone have any ideas or suggestions of where to look next?
 
 Jeff.
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 The @ is suppressing this notice ...
 
 Notice: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error:
 Corrupt JPEG data: 31 extraneous bytes before marker 0xd9

Thanks!

I guess I'm wondering why this works on the Devel server but not the live?

Jeff.


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



Re: [PHP] Unknown error with imagecreatefromjpeg() on specific GD/PHP versions.

2010-06-16 Thread Jeff MacDonald

On 2010-06-16, at 11:44 AM, Richard Quadling wrote:

 On 16 June 2010 15:37, Richard Quadling rquadl...@gmail.com wrote:
 On 16 June 2010 15:26, Jeff MacDonald j...@bignose.ca wrote:
 Hi Everyone,
 
 One of my developers is reporting a problem on our Live server but not our 
 devel server.
 
 Specifically when someon uploads a photo taken by a KODAK EASYSHARE C813, 
 and that image gets processed by imagecreatefromjpeg(), the function 
 returns false.
 
 Our Devel Server Info [this works fine]
PHP Version : 5.2.6-3
GD Version: 2.0 or higher.
EXIF Version: 1.4
 
 Our Live Server Info [this one is the one that fails]
PHP Version: 5.2.13
GD Version : 2.0.34 compatible
EXIF Version : 1.4
 
 To see an example of this in action,
 
 Working function : http://www.equipmentsearch.com/~jeff/tmp/image.php?i=w
 Not working function : 
 http://www.equipmentsearch.com/~jeff/tmp/image.php?i=n
 
 http://www.equipmentsearch.com/~jeff/tmp/image.php.txt is the code.
 
 Does anyone have any ideas or suggestions of where to look next?
 
 Jeff.
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 The @ is suppressing this notice ...
 
 Notice: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error:
 Corrupt JPEG data: 31 extraneous bytes before marker 0xd9
 
It would seem our Devel server has GD 2.0.36

Our Live server has GD 2.0.34

So Presumably if i upgrade live it should work. 

Jeff.

 
 -- 
 -
 Richard Quadling
 Standing on the shoulders of some very clever giants!
 EE : http://www.experts-exchange.com/M_248814.html
 EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
 Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
 ZOPA : http://uk.zopa.com/member/RQuadling


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



[PHP] Re: POST without POSTing

2009-10-01 Thread Jeff Brown

Paul M Foster wrote:

I'm sure this has been covered before, but I'm not even sure how to
search in the archives for it.

I have a form that collects certain info via POST. It is re-entrant, so
when the user hits the submit button, it checks the input and does
whatever sanity checks it needs to. If all is okay, it must now pass
some of that info to another URL (offsite) via POST. Normally, the
information would be passed via a series of GET variables or SESSION
variables. But in this case the site the user is being directed to must
receive the information via POST.

I'm not sure how to do this. Please no exotic external libraries my
shared hosting provider doesn't include. RTFM will be fine; just tell me
which Fine Manual to Read.

Paul



Answering in general to a lot of the above responses.

You don't need to care if the 'foreign' host supports fsockopen or curl,
only if your form hosting host does.  (Boy that looks more confusing in 
re-read than it felt writing it ;D ...  )


To the foreign redirect target, both curl and fsockopen are supposed to 
look like a browser hitting the site.


So if your site allows curl or fsockopen, then you're golden.

jeff

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



Re: [PHP] How to stop E_DEPRECATED messages in the PHP log?

2009-07-07 Thread Jeff Weinberger

On Jul 7, 2009, at 5:50 AM, Richard Quadling wrote:


2009/7/6 Jeff Weinberger j...@jeffweinberger.com:

Hi:

I am hoping someone can help me figure this out

I've just upgraded my PHP installation to 5.3.0. Now I am receiving
thousands of log messages of the form PHP Deprecated: 

I know I have a number of scripts that use now-deprecated  
functions, etc.

and I now know what those are, thanks to all the messages.

However, this is now growing to (literally) gigabytes of log  
entries, so I'd

like to stop the messages until I have the time to re-write all the
offending scripts.

I have tried the following error.reporting lines in php.ini:

error_reporting = E_ALL  ~E_DEPRECATED  E_ERROR  E_WARNING   
E_PARSE 
E_NOTICE  E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING   
E_USER_NOTICE 

E_COMPILE_ERROR  E_COMPILE_WARNING

error_reporting = ~E_DEPRECATED  E_ALL  E_ERROR  E_WARNING   
E_PARSE 
E_NOTICE  E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING   
E_USER_NOTICE 

E_COMPILE_ERROR  E_COMPILE_WARNING

error_reporting =  E_ALL  E_ERROR  E_WARNING  E_PARSE  E_NOTICE 
E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING  E_USER_NOTICE 
E_COMPILE_ERROR  E_COMPILE_WARNING  ~E_DEPRECATED

error_reporting = E_ERROR  E_CORE_ERROR  E_USER_ERROR   
E_COMPILE_ERROR 

E_COMPILE_WARNING  ~E_DEPRECATED

error_reporting = ~E_DEPRECATED  E_ERROR  E_CORE_ERROR   
E_USER_ERROR 

E_COMPILE_ERROR  E_COMPILE_WARNING

(as you can tell, I prefer verbose logs, but not that verbose...).

None of these combinations have stopped the  PHP Deprecated: ...  
messages.


System info: Mac OS/X 10.5.7 Client version, PHP 5.3.0 running as a  
CGI
under Apache 2.2.11 and as a CLI. Please let me know if there's any  
other

info that might help.

php_info() reports error.reporting as 0

Any help or guidance is appreciated!!

Thanks,

--Jeff



No one ever achieved greatness by playing it safe. -Harry Gray


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




Try ...

error_reporting = 22527


--
-
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
Standing on the shoulders of some very clever giants!
I need a car : http://snipurl.com/l4pih
ZOPA : http://uk.zopa.com/member/RQuadling


Richard (and Tom):

This seemed like it would be the perfect solution...but alas it did  
not work. 22527 seems right, but after changing php.ini to that and  
restarting php and apache, I am still getting Deprecated... messages.


:(

I'll keep trying...and any other suggestions are much appreciated!

Thanks!




A wise man will make more opportunities than he finds. -Francis Bacon


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



Re: [PHP] How to stop E_DEPRECATED messages in the PHP log?

2009-07-07 Thread Jeff Weinberger

On Jul 7, 2009, at 8:38 AM, Daniel Brown wrote:

On Tue, Jul 7, 2009 at 11:03, Jeff  
Weinbergerj...@jeffweinberger.com wrote:


This seemed like it would be the perfect solution...but alas it did  
not
work. 22527 seems right, but after changing php.ini to that and  
restarting

php and apache, I am still getting Deprecated... messages.


   Dumb question, Jeff: are you sure you're editing the correct  
php.ini file?


--
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig

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


Daniel:

Not a dumb question at all! I check every time (php_info()) to make  
sure the loaded configuration file is the one I'm editing. So, as  
far as I can tell, yes.


Should I be looking at something else to be sure?

Thanks!

--Jeff







UNIX is the Klingon of cyberspace. -from The Cluetrain Manifesto


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



Re: [PHP] How to stop E_DEPRECATED messages in the PHP log?

2009-07-07 Thread Jeff Weinberger

On Jul 7, 2009, at 12:30 PM, Tom Worster wrote:


On 7/7/09 12:17 PM, Jeff Weinberger j...@jeffweinberger.com wrote:


On Jul 7, 2009, at 8:38 AM, Daniel Brown wrote:


On Tue, Jul 7, 2009 at 11:03, Jeff
Weinbergerj...@jeffweinberger.com wrote:


This seemed like it would be the perfect solution...but alas it did
not
work. 22527 seems right, but after changing php.ini to that and
restarting
php and apache, I am still getting Deprecated... messages.


  Dumb question, Jeff: are you sure you're editing the correct
php.ini file?

--  
/Daniel P. Brown

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig

--  
PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php


Daniel:

Not a dumb question at all! I check every time (php_info()) to make
sure the loaded configuration file is the one I'm editing. So, as
far as I can tell, yes.

Should I be looking at something else to be sure?


i've now had a look at http://www.php.net/manual/en/errorfunc.constants.php

in your shoes i'd try out 2047 (with is everything up to and including
E_USER_NOTICE) and possibly 6143 (=2047+4096) if you have your own  
error

handler.

if still no luck i can't think of anything else to suggest but work
backwards:

check the value returned by error_reporting() is the value you set in
php.ini.

binary decode it to double check.

if it sill makes no sense, check the php bugs db. and if nothing,  
maybe

report it.



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


Tom:

thanks - I'll try those and report back, and will keep playing with  
various combinations until I get it to work or prove it doesn't :)


One question - that I for some reason have not found - is there a list  
of the numerical values of the E_* constants somewhere?


Thanks for your help!

--Jeff







Real love is a pilgrimage. It happens when there is no strategy, but it is very 
rare because most people are strategists. -Anita Brookner


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



[PHP] How to stop E_DEPRECATED messages in the PHP log?

2009-07-06 Thread Jeff Weinberger

Hi:

I am hoping someone can help me figure this out

I've just upgraded my PHP installation to 5.3.0. Now I am receiving  
thousands of log messages of the form PHP Deprecated: 


I know I have a number of scripts that use now-deprecated functions,  
etc. and I now know what those are, thanks to all the messages.


However, this is now growing to (literally) gigabytes of log entries,  
so I'd like to stop the messages until I have the time to re-write all  
the offending scripts.


I have tried the following error.reporting lines in php.ini:

error_reporting = E_ALL  ~E_DEPRECATED  E_ERROR  E_WARNING   
E_PARSE  E_NOTICE  E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING   
E_USER_NOTICE  E_COMPILE_ERROR  E_COMPILE_WARNING


error_reporting = ~E_DEPRECATED  E_ALL  E_ERROR  E_WARNING   
E_PARSE  E_NOTICE  E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING   
E_USER_NOTICE  E_COMPILE_ERROR  E_COMPILE_WARNING


error_reporting =  E_ALL  E_ERROR  E_WARNING  E_PARSE  E_NOTICE   
E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING  E_USER_NOTICE   
E_COMPILE_ERROR  E_COMPILE_WARNING  ~E_DEPRECATED


error_reporting = E_ERROR  E_CORE_ERROR  E_USER_ERROR   
E_COMPILE_ERROR  E_COMPILE_WARNING  ~E_DEPRECATED


error_reporting = ~E_DEPRECATED  E_ERROR  E_CORE_ERROR   
E_USER_ERROR  E_COMPILE_ERROR  E_COMPILE_WARNING


(as you can tell, I prefer verbose logs, but not that verbose...).

None of these combinations have stopped the  PHP Deprecated: ...  
messages.


System info: Mac OS/X 10.5.7 Client version, PHP 5.3.0 running as a  
CGI under Apache 2.2.11 and as a CLI. Please let me know if there's  
any other info that might help.


php_info() reports error.reporting as 0

Any help or guidance is appreciated!!

Thanks,

--Jeff



No one ever achieved greatness by playing it safe. -Harry Gray


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



Re: [PHP] How to stop E_DEPRECATED messages in the PHP log?

2009-07-06 Thread Jeff Weinberger

On Jul 6, 2009, at 7:47 PM, Paul M Foster wrote:


On Mon, Jul 06, 2009 at 02:16:09PM -0700, Jeff Weinberger wrote:


Hi:

I am hoping someone can help me figure this out

I've just upgraded my PHP installation to 5.3.0. Now I am receiving
thousands of log messages of the form PHP Deprecated: 

I know I have a number of scripts that use now-deprecated functions,
etc. and I now know what those are, thanks to all the messages.

However, this is now growing to (literally) gigabytes of log entries,
so I'd like to stop the messages until I have the time to re-write  
all

the offending scripts.

I have tried the following error.reporting lines in php.ini:

error_reporting = E_ALL  ~E_DEPRECATED  E_ERROR  E_WARNING 
E_PARSE  E_NOTICE  E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING 
E_USER_NOTICE  E_COMPILE_ERROR  E_COMPILE_WARNING

error_reporting = ~E_DEPRECATED  E_ALL  E_ERROR  E_WARNING 
E_PARSE  E_NOTICE  E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING 
E_USER_NOTICE  E_COMPILE_ERROR  E_COMPILE_WARNING

error_reporting =  E_ALL  E_ERROR  E_WARNING  E_PARSE  E_NOTICE 
E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING  E_USER_NOTICE 
E_COMPILE_ERROR  E_COMPILE_WARNING  ~E_DEPRECATED

error_reporting = E_ERROR  E_CORE_ERROR  E_USER_ERROR 
E_COMPILE_ERROR  E_COMPILE_WARNING  ~E_DEPRECATED

error_reporting = ~E_DEPRECATED  E_ERROR  E_CORE_ERROR 
E_USER_ERROR  E_COMPILE_ERROR  E_COMPILE_WARNING

(as you can tell, I prefer verbose logs, but not that verbose...).

None of these combinations have stopped the  PHP Deprecated: ...
messages.

System info: Mac OS/X 10.5.7 Client version, PHP 5.3.0 running as a
CGI under Apache 2.2.11 and as a CLI. Please let me know if there's
any other info that might help.

php_info() reports error.reporting as 0

Any help or guidance is appreciated!!


Try

error_reporting(E_ALL ^ E_DEPRECATED);

See http://us2.php.net/manual/en/function.error-reporting.php for more
info and examples.

Paul

--
Paul M. Foster

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



Paul:

Thanks for your suggestion - it would work nicely, except that that is  
a runtime function that is called within a script.


I am trying to get the php.ini setting correct to avoid the Deprecated  
messages.


I tried error_reporting=E_ALL  ~E_DEPRECATED (which I think is the  
php.ini analogy to your suggestion) to no avail - it failed also.


leaving me still confused

--Jeff



The achievements of an organization are the results of the combined effort of each 
individual. -Vincent Thomas Vince Lombardi


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



[PHP] Re: PHP (under httpd) reading a file outside DocumentRoot?

2008-12-27 Thread Jeff Weinberger

On Dec 26, 2008, at 1:52 PM, Nathan Rixham wrote:


Jeff Weinberger wrote:
I don't know if this is an Apache (httpd) or a PHP issue (I suspect  
PHP, but I may be doing something wrong with mod_suexec), so I hope  
this is the right place to ask. I certainly appreciate any help  
anyone can offer!
I am trying to get a PHP script to read a file that's outside the  
DocumentRoot of a VirtualHost, in fact well outside the parent  
directory of all of my virtual hosts.
I have successfully managed to get Apache httpd to run the script  
as the correct user and group (matching the target file's  
ownership) using SuexecUserGroup. I tested this by having the  
script create/write a test file, which had owner and group set  
correctly.
However, when I run the script, at the file(/path/to/target/file)  
command, PHP tells me it can't open the file - permission is denied.

In php.ini safe_mode is off and open_basedir is not set.
I am not sure where else to look for a solution - any help is very  
much appreciated!
FYI: PHP 5.2.6, Apache httpd 2.2.11, mod_ssl/2.2.11, OpenSSL/0.9.7l  
on Mac OS/X 10.5.5. I'm reaching the script over an SSL (https)  
connection if that matters).

Thanks!


do what it takes to make it work (ie chmod 777 or similar) then put  
things back to how they presently are one by one to find the cause  
of the error. :)


Nathan: Thanks for your suggestion - a good debugging step - but the  
permissions on the file I want the script to read have been -rw-rw-rw-  
the entire time.


This leads me to suspect that the issue is not the permissions  
themselves, but rather something about my PHP configuration or script  
(or, possibly, as I noted, my Apache httpd configuration) that is  
causing PHP to report a permission error on reading the file.


I don't know where else to look for this issue, so I hope that someone  
has at least some pointers or suggestions on what might be happening  
here.


Thank you very much for any help!

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



[PHP] PHP (under httpd) reading a file outside DocumentRoot?

2008-12-26 Thread Jeff Weinberger
I don't know if this is an Apache (httpd) or a PHP issue (I suspect  
PHP, but I may be doing something wrong with mod_suexec), so I hope  
this is the right place to ask. I certainly appreciate any help anyone  
can offer!


I am trying to get a PHP script to read a file that's outside the  
DocumentRoot of a VirtualHost, in fact well outside the parent  
directory of all of my virtual hosts.


I have successfully managed to get Apache httpd to run the script as  
the correct user and group (matching the target file's ownership)  
using SuexecUserGroup. I tested this by having the script create/write  
a test file, which had owner and group set correctly.


However, when I run the script, at the file(/path/to/target/file)  
command, PHP tells me it can't open the file - permission is denied.


In php.ini safe_mode is off and open_basedir is not set.

I am not sure where else to look for a solution - any help is very  
much appreciated!


FYI: PHP 5.2.6, Apache httpd 2.2.11, mod_ssl/2.2.11, OpenSSL/0.9.7l on  
Mac OS/X 10.5.5. I'm reaching the script over an SSL (https)  
connection if that matters).


Thanks!

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



Re: [PHP] PHP4 vs PHP5 classes

2008-07-29 Thread jeff . mills


 Since the Players method is a constructor, it's more about how you set
 the object(s) up.

 What does the loop look like before you create a new object?


Well see here is where it gets messy! This is not my code - I've ported a
phpnuke module over to dragonflycms.

The $players object is created before the loop:
$players = new Players($lid);

The loop is quite big, but here is the important part:

-SNIP-
while (list($pid, $name, $gsid, $stat) = $players-fetchSelectData()) {
  if (DEBUG_LEAGUE == YES) echo trtd colspan=\22\\$maxcol =
$maxcol | \$pid = $pid | \$name = $name | \$gsid = $gsid | \$stat =
$stat/td/tr\$
  $noplayer=0;
  if ($prevgsid != $gsid) {
 $prevgsid = $gsid;
 $players-selectHeaders($gsid);
 if (DEBUG_LEAGUE == YES) var_dump($players);
 displayPlayerSetupRow($players,
.getlink($module).amp;file=indexamp;mode=$modeamp;lid=$lidamp;sid=$sidamp;gsid=$gsid,
$order);
  }
-SNIP-

function displayPlayerSetupRow is also very big, but here it is up to the
troublesome $players-max call:

-SNIP-
function displayPlayerSetupRow($players, $go=, $prevorder=0) {
   global $bgcolor2;

   if ($prevorder==)
  $prevorder=0;

   $urlstart=;
   $urlend=;
   $max = $players-max();

-SNIP-

Then we enter class Players as previously mentioned:

-SNIP-
class Players extends dynamicTable {
   var $setup;
   var $lid;
   var $size;
   var $max;
   var $data;
   var $data_result;
   var $data_index;
   var $player_stats_result;
   var $player_stats_data;
   var $player_stats_index;
   var $player_stats_start;
   var $player_type_result;

   function Players($lid) {
  global $prefix, $db;

  /*
   * Find max size of rows
   */

  $this-lid = $lid;
  $this-max=0;
  $result = $db-sql_query(select * from  . $prefix .
_league_games_setup where lid = $lid);
  while (($rows = $db-sql_fetchrow($result))) {
 $c=0;
 for ($i=3; $i  23; $i++) {
  if ($rows[$i] != )
 $c++;
 }
 if ($c  $this-max)
$this-max = $c;
  }

  $this-index = 3;
   }

   function name() {
  return ($this-setup['name']);
   }

   function max() {
return ($this-max);
   }
-SNIP-






 --
 Postgresql  php tutorials
 http://www.designmagick.com/

 --
 This email has been scanned for viruses and dangerous content by
 Sydney Technology Solutions MailMaster Email Protection Services.

 For more information please visit http://www.sydneytech.com.au
 :Scanned by MailMaster1:





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



Re: [PHP] PHP4 vs PHP5 classes

2008-07-29 Thread jeff . mills


 The $players object is created before the loop:
 $players = new Players($lid);

 snip

 Which means the code is only executed once since it's in the
 constructor. It's not changing per loop because you're not calling the
 code.

 Maybe setting $this-max should be done in

 fetchSelectData

 since that's what is causing/creating your loop.

Thanks Chris, I will give that a shot.
Just to confirm, this script works just fine in php4, so do we put that
down to pure luck, or has there been a change in php5 that will be causing
it?




 --
 Postgresql  php tutorials
 http://www.designmagick.com/

 --
 This email has been scanned for viruses and dangerous content by
 Sydney Technology Solutions MailMaster Email Protection Services.

 For more information please visit http://www.sydneytech.com.au
 :Scanned by MailMaster1:





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



Re: [PHP] PHP4 vs PHP5 classes

2008-07-29 Thread jeff . mills

 Maybe setting $this-max should be done in

 fetchSelectData

 since that's what is causing/creating your loop.


Thanks Chris, I copied the code into the fetchSelectData function and it
seems to be working fine now!
Just need to test removing the code from the constructor to make sure its
still working, and also test that php4 is still working.

I'm just concerned that the code might also be called from somewhere else.

You've cured my headache!


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



[PHP] PHP4 vs PHP5 classes

2008-07-28 Thread jeff . mills
I have the following code in part of a loop:
$max = $players-max();

Important parts of players class:
class Players extends dynamicTable {
   var $setup;
   var $lid;
   var $size;
   var $max;
   var $data;
   var $data_result;
   var $data_index;
   var $player_stats_result;
   var $player_stats_data;
   var $player_stats_index;
   var $player_stats_start;
   var $player_type_result;

   function Players($lid) {
  global $prefix, $db;

  /*
   * Find max size of rows
   */

  $this-lid = $lid;
  $this-max=0;
echo $this-index;
  $result = $db-sql_query(select * from  . $prefix .
_league_games_setup where lid = $lid);
  while (($rows = $db-sql_fetchrow($result))) {
 $c=0;
 for ($i=3; $i  23; $i++) {
  if ($rows[$i] != )
 $c++;
 }
 if ($c  $this-max)
$this-max = $c;
  }

  $this-index = 3;
   }


   function max() {
return ($this-max);


The most important part of this code to me is:
$this-index = 3;
It is important that this is reset to 3 for the rest of the loop to work
properly.
In PHP4, $this-index is reset to 3 each time the loop happens, but in
PHP5 it is not.
It appears that after the first loop, PHP5 seems to remember the value
of $this-max and therefore does not enter the Players function to set
$this-index = 3. I have run through the script with a debugger, and sure
enough, we only enter function Players once.

Is this normal behaviour for PHP5 vs PHP4?
Is there a way for me to force $this-max to be calculated each time
function max is called?


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



[PHP] Weird issue with PHP5

2008-07-23 Thread jeff . mills

I have a module originally written for PHP-Nuke that I have ported to
CPG-Nuke/DragonFlyCMS.

In PHP4, the page I'm displaying works fine.
In PHP5, it doesn't.

The following link is a screenshot of the page using PHP4:
http://nukeleaguedf.winsto.net/working-php4.jpg

And a screenshot from PHP5:
http://nukeleaguedf.winsto.net/broken-php5.jpg

You can see that the stat lines for the first group (Batters) displays
properly. However, the stat lines for the following groups do not.

I have copied the three offending files into text files:
http://nukeleaguedf.winsto.net/modules/League/index.txt
http://nukeleaguedf.winsto.net/modules/League/util.txt
http://nukeleaguedf.winsto.net/modules/League/classes.txt

Line 1119 of index.txt is where is all begins.
I have tested that the while loop is actually looping 3 times as it should
(once for each group).
Doing a var_dump of $players shows all of the required information.

Line 1126 is the actual line that displays the fields.

I have scoured the code with my limited PHP knowledge, but I can't for the
life of me see why its not working in PHP5.
Perhaps part of the code is incompatible with PHP5, or perhaps its a bug
in PHP5.
Is anyone able to help?








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



Re: [PHP] Weird issue with PHP5

2008-07-23 Thread jeff . mills


 thats a decent bit of code to pick through, jeff.  glancing at index.txt,
 the code looks pretty straight forward, and by that i mean that it doesnt
 look like theres anything that shouldnt work in php5.

 if i were to guess, i would suspect an environmental issue.  you should
 ensure that all the extensions you had in php4 are there in php5.  you can
 do this by writing a simple script, phpinfo.php

 ?php
 die(phpinfo());

 you should run this in both the php4, and php5 environments and make sure
 things look essentially identical.  as well, there are a few things that
 changed in php5, here is a helpful reference from the manual that will
 give
 you things to look out for,

 http://www.php.net/manual/en/faq.migration5.php

 another thing i would recommend to weed out any environmental issues is to
 configure error_reporting to show everything.  so (depending on your
 version
 of php5) if youre using the latest version, your php.ini file should have
 something like this

 display_errors = On
 error_reporting = E_ALL

 on older versions of php5, you would have to tweak the error reporting to
 also display E_STRICT errors, i doubt thats your problem, but i thought to
 mention it.

 something else that might be helpful would be setting up a debugger, such
 as
 xdebug + protoeditor.  i can help you through the configuration if you
 want.  this will allow you to set breakpoints and step through the code,
 line-by-line if you wish, which could also help you isolate the problem
 more
 quickly.

 -nathan


Hi Nathan,
it sure is a lot of code to work through. Its been driving me insane for
the last couple of days.
phpinfo on the same server when switching from php4 to php5 shows only a
few differences.
There is one different module in each version:
PHP Version 4.4.8_pre20070816-pl0-gentoo
- sapi_apache2
PHP Version 5.2.6RC4-pl0-gentoo
- mod_php5

I've saved the phpinfo pages.
http://nukeleaguedf.winsto.net/phpinfo/phpinfov4.htm
http://nukeleaguedf.winsto.net/phpinfo/phpinfov5.htm

I'm currently installing xdebug, but I don't see protoeditor in my Linux
distro. Is it available for download?
Configuration help would be great, thank you.






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



RE: [PHP] cookie encoding/decoding

2008-07-11 Thread Jeff Demel
Anyone have any ideas on this at all?

-Original Message-
From: Jeff Demel [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 10, 2008 10:50 AM
To: php-general@lists.php.net
Subject: [PHP] cookie encoding/decoding

I have a situation where a cookie is being set elsewhere on a site by
ASP.NET, and I want to read it in my PHP.  However, when getting a cookie in
PHP, it does an automatic urldecode (or some kind of decoding).  Since the
cookie is entered in its pure form, with no encoding, on the ASP.NET side,
PHP is actually converting/decoding correct characters that don't need
decoding.  So, for example a plus sign would become a blank space.  This, of
course, means I'm getting incorrect info from the cookie.

Is there a way to turn off this PHP feature?  Perhaps a flag in the .ini
file?

-Jeff



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



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



[PHP] cookie encoding/decoding

2008-07-10 Thread Jeff Demel
I have a situation where a cookie is being set elsewhere on a site by
ASP.NET, and I want to read it in my PHP.  However, when getting a cookie in
PHP, it does an automatic urldecode (or some kind of decoding).  Since the
cookie is entered in its pure form, with no encoding, on the ASP.NET side,
PHP is actually converting/decoding correct characters that don't need
decoding.  So, for example a plus sign would become a blank space.  This, of
course, means I'm getting incorrect info from the cookie.

Is there a way to turn off this PHP feature?  Perhaps a flag in the .ini
file?

-Jeff



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



[PHP] Text Color

2008-02-28 Thread Jeff
Please, can anyone tell me how to produce colored text? For instance if I 
wanted to following code to be printed as red text what would I need to add 
to they code? Thanks in advance.

echo 
TRTD.$myrow[char_name].TD.$myrow[char_level].TD.$class[class].TD.$myrow[kara].TD.$myrow[karateam].TD.$myrow[karasub];
 

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



[PHP] Fatal error: Class 'DOMDocument' not found

2007-12-16 Thread Jeff Schwartz
I'm attempting to run the sample script on the PHP site:
   
  ?php
$dom = new DOMDocument('1.0', 'iso-8859-1');
echo $dom-saveXML(); /* ?xml version=1.0 encoding=iso-8859-1? */
?
   
  but get the error:
   
  Fatal error: Class 'DOMDocument' not found in /var/www/html/ajax/dom.php on 
line 2
   
  I'm running ver. 5.1.6 and my config appears to be set up for xml:
   
  './configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' 
'--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' 
'--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' 
'--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' 
'--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' 
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man' 
'--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' 
'--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' 
'--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' 
'--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' 
'--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' 
'--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' 
'--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' 
'--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif'
 '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' 
'--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' 
'--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' 
'--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' 
'--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' 
'--with-mime-magic=/etc/httpd/conf/magic' '--without-sqlite' 
'--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs' 
'--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' 
'--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' 
'--disable-xmlwriter'  
   
  Has anyone else run into this?
   
  Thanks,
   
  Jeff


[PHP] Re: Newbie asks about multi-lingual website strategies

2007-11-28 Thread Jeff Benetti
Wow! I love this group, ask and you shall receive.  Thanks everyone for the
comments and suggestions. 

 

The following snippet from Andrés Robinet would actually suit my current
project..

 

define('DEFAULT_LANG_ID', 'en');

 

function getLanguageId() {

  // Allow for language id override in $_GET, $_POST and $_COOKIE

  $req_lang_id = $_REQUEST['lang_id'];

  // Retrieve the one stored in the session if any

  $sess_lang_id = $_SESSION['lang_id'];

  // $lang_id will contain the lang id retrieved from request (overrides
session),

  // or from session or a default one

  $lang_id = isset($req_lang_id) ? $req_lang_id : (isset($sess_lang_id) ?

$sess_lang_id : DEFAULT_LANG_ID);

  // Save it for next time

  $_SESSION['lang_id'] = $lang_id;

  return $lang_id;

}

 

but the idea of getting a preferred language from the browser is also a
great strategy ( I didn’t know you could do that, I’m such a noob) so I
think that I will investgate that further. 

 

The problem with IP address is that usually it is not tied to one particular
user so I will scrap that idea.  

 

Am I correct that if two people are logged on using two different languages
that the session var will keep track of the different users (by IP I assume)
and the server won’t mess up?

 

Anyway thanks everyone for all the great help, I’m on a nearly vertical
learning curve here and it’s great to have this community to draw on.  I’m
pretty much working in a vacuum otherwise.

 

Jeff



[PHP] Newbie asks about multi-lingual website strategies

2007-11-27 Thread Jeff Benetti
I'm a noob so keep the comments to a noob's level please.

I am doing a website and my client wants the bulk of the text to be
bilingual (French and English).  The last site I did used php and mysql so I
am getting comfortable with that technology.  Typically I am using a single
php file and my menu constantly points to the same file with different id
options example index.php?id=30 and I want to use the same idea to choose
a language example index.php?lang=frid=30.  Pretty straight forward for
many of you folks but before I start reinventing the wheel I wondered if
anyone could offer any suggestions.  I have a couple of approaches in mind.

1: Session vars, I have never used this but it seems straight forward.
Drawbacks?
2: Cookies again not too big a deal, never used cookies either but it
doesn't seem to be mystifying however the fact that the user can turn
cookies off makes me not want to go this route.
3: Use the mysql database and log each ip address and record the preference
and maybe the last time on the site.  I am leaning in this direction because
I think it is the most robust but will it be slow?  First I have to get the
ip then I have to check to see if it is in my data base and then get the
language preference.  It would be great to have a standardized function that
I could use on all of my sites.  I live in a bilingual country (Canada) so
this could be a real selling point for my services.

Any any and all comments are welcome, it will be a learning curve no matter
which route I take so a little advice on the best direction pros cons would
be great.

And of course knowing that I will have many many thousands of people on my
site (hee hee) which option will perform best once I start accumulating
vistors.  That's one problem I see with the mysql solution, I think it may
start to be slow unless I start purging vistors who have not shown up in a
while or limit the number of entries.

Thanks,
Jeff

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



[PHP] strange error

2007-10-25 Thread Jeff Mckeon
I'm getting this error on a php based ticket system we have.  I don't see
this on the old server running php4.  This new server is running php5.

PHP_Fatal_error:__Cannot_use_object_of_type_PEAR_Error_as_array_in_/srv/www/
virtual/support/mailparser.php_on_line_300/

The code in that section looks like this...

  function firstemail($addrs)
  {
$name=;
$structure = Mail_RFC822::parseAddressList($addrs);
$ret= $structure[0]-mailbox.@.$structure[0]-host;  ### line 300 is
here...
if ($ret==@localhost) $ret=;
else $name=$structure[0]-personal;
return array($ret,$name);
  }

Any idea what may be the issue here?

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



[PHP] libmm.so.14

2007-10-23 Thread Jeff Mckeon
Hey all,

Setting up a php based ticket system on a new OpenSuse 10.3 64bit system.

The ticket sys requires qmail so I had to uninstall postfix and install
qmail.

Qmail injects emails into this ticket sys with the following line... 

/usr/bin/php -q /srv/www/virtual/support/mailpipe.php

I now get this error however:

/usr/bin/php: error while loading shared libraries: libmm.so.14: cannot open
shared object file: No such file or directory

Libmm.so.14 is installed in:

/usr/lib64/libmm.so.14

Any idea what it is I'm missing?

Version PHP5

Thanks,

jeff

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



RE: [PHP] libmm.so.14

2007-10-23 Thread Jeff Mckeon
 -Original Message-
 From: Daniel Brown [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, October 23, 2007 10:47 AM
 To: Jeff Mckeon
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] libmm.so.14
 
 On 10/23/07, Jeff Mckeon [EMAIL PROTECTED] wrote:
  Hey all,
 
  Setting up a php based ticket system on a new OpenSuse 10.3 64bit
 system.
 
  The ticket sys requires qmail so I had to uninstall postfix and
 install
  qmail.
 
  Qmail injects emails into this ticket sys with the following line...
 
  /usr/bin/php -q /srv/www/virtual/support/mailpipe.php
 
  I now get this error however:
 
  /usr/bin/php: error while loading shared libraries: libmm.so.14:
 cannot open
  shared object file: No such file or directory
 
  Libmm.so.14 is installed in:
 
  /usr/lib64/libmm.so.14
 
  Any idea what it is I'm missing?
 
  Version PHP5
 
  Thanks,
 
  jeff
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 Check to see where PHP is searching for the extensions.  Chances
 are, all you'll need to do is symlink it from the /usr/lib64/
 directory to wherever PHP is expecting to find it.
 
 Also, be sure it really is still there.  When's the last time you
 did a `locate -u` on your server (if that's the method you used)?  It
 could be showing an old slocatedb.
 
 --
 Daniel P. Brown
 [office] (570-) 587-7080 Ext. 272
 [mobile] (570-) 766-8107
 
 Give a man a fish, he'll eat for a day.  Then you'll find out he was
 allergic and is hospitalized.  See?  No good deed goes unpunished

Tried that,

I did a simlink to /usr/lib but it complained that:

/usr/bin/php: error while loading shared libraries: libmm.so.14: wrong ELF
class: ELFCLASS64



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



RE: [PHP] libmm.so.14

2007-10-23 Thread Jeff Mckeon
 -Original Message-
 From: Jeff Mckeon [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, October 23, 2007 10:52 AM
 To: 'Daniel Brown'
 Cc: php-general@lists.php.net
 Subject: RE: [PHP] libmm.so.14
 
  -Original Message-
  From: Daniel Brown [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, October 23, 2007 10:47 AM
  To: Jeff Mckeon
  Cc: php-general@lists.php.net
  Subject: Re: [PHP] libmm.so.14
 
  On 10/23/07, Jeff Mckeon [EMAIL PROTECTED] wrote:
   Hey all,
  
   Setting up a php based ticket system on a new OpenSuse 10.3 64bit
  system.
  
   The ticket sys requires qmail so I had to uninstall postfix and
  install
   qmail.
  
   Qmail injects emails into this ticket sys with the following
 line...
  
   /usr/bin/php -q /srv/www/virtual/support/mailpipe.php
  
   I now get this error however:
  
   /usr/bin/php: error while loading shared libraries: libmm.so.14:
  cannot open
   shared object file: No such file or directory
  
   Libmm.so.14 is installed in:
  
   /usr/lib64/libmm.so.14
  
   Any idea what it is I'm missing?
  
   Version PHP5
  
   Thanks,
  
   jeff
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
  Check to see where PHP is searching for the extensions.  Chances
  are, all you'll need to do is symlink it from the /usr/lib64/
  directory to wherever PHP is expecting to find it.
 
  Also, be sure it really is still there.  When's the last time you
  did a `locate -u` on your server (if that's the method you used)?  It
  could be showing an old slocatedb.
 
  --
  Daniel P. Brown
  [office] (570-) 587-7080 Ext. 272
  [mobile] (570-) 766-8107
 
  Give a man a fish, he'll eat for a day.  Then you'll find out he was
  allergic and is hospitalized.  See?  No good deed goes unpunished
 
 Tried that,
 
 I did a simlink to /usr/lib but it complained that:
 
 /usr/bin/php: error while loading shared libraries: libmm.so.14: wrong
 ELF
 class: ELFCLASS64
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

Ok, removed php and libmm14 and re-installed.  Now command line php works
but Apache2 is no longer serving php pages.

Re-installed apache2 checked all the config files but I can't seem to make
it work.  When you go to the site with a  php page it offers it as a
download instead of handing the file off to php to process... UGH!!!

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



RE: [PHP] libmm.so.14 SOLVED

2007-10-23 Thread Jeff Mckeon
 -Original Message-
 From: Daniel Brown [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, October 23, 2007 4:10 PM
 To: Jeff Mckeon
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] libmm.so.14
 
 On 10/23/07, Jeff Mckeon [EMAIL PROTECTED] wrote:
   -Original Message-
   From: Jeff Mckeon [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, October 23, 2007 10:52 AM
   To: 'Daniel Brown'
   Cc: php-general@lists.php.net
   Subject: RE: [PHP] libmm.so.14
  
-Original Message-
From: Daniel Brown [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 23, 2007 10:47 AM
To: Jeff Mckeon
Cc: php-general@lists.php.net
Subject: Re: [PHP] libmm.so.14
   
On 10/23/07, Jeff Mckeon [EMAIL PROTECTED] wrote:
 Hey all,

 Setting up a php based ticket system on a new OpenSuse 10.3
 64bit
system.

 The ticket sys requires qmail so I had to uninstall postfix and
install
 qmail.

 Qmail injects emails into this ticket sys with the following
   line...

 /usr/bin/php -q /srv/www/virtual/support/mailpipe.php

 I now get this error however:

 /usr/bin/php: error while loading shared libraries:
 libmm.so.14:
cannot open
 shared object file: No such file or directory

 Libmm.so.14 is installed in:

 /usr/lib64/libmm.so.14

 Any idea what it is I'm missing?

 Version PHP5

 Thanks,

 jeff

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


   
Check to see where PHP is searching for the extensions.
 Chances
are, all you'll need to do is symlink it from the /usr/lib64/
directory to wherever PHP is expecting to find it.
   
Also, be sure it really is still there.  When's the last time
 you
did a `locate -u` on your server (if that's the method you used)?
 It
could be showing an old slocatedb.
   
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
   
Give a man a fish, he'll eat for a day.  Then you'll find out he
 was
allergic and is hospitalized.  See?  No good deed goes
 unpunished
  
   Tried that,
  
   I did a simlink to /usr/lib but it complained that:
  
   /usr/bin/php: error while loading shared libraries: libmm.so.14:
 wrong
   ELF
   class: ELFCLASS64
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
 
  Ok, removed php and libmm14 and re-installed.  Now command line php
 works
  but Apache2 is no longer serving php pages.
 
  Re-installed apache2 checked all the config files but I can't seem to
 make
  it work.  When you go to the site with a  php page it offers it as a
  download instead of handing the file off to php to process... UGH!!!
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 1.) What parameters did you run ./configure with when building PHP
 (or did you build automatically with cPanel, etc.)?
 2.) Did you add/uncomment the module entry in httpd.conf?
 3.) Did you restart Apache after everything else was done?
 4.) When attempting to restart Apache, are there any errors?
 
 --
 Daniel P. Brown
 [office] (570-) 587-7080 Ext. 272
 [mobile] (570-) 766-8107
 
 Give a man a fish, he'll eat for a day.  Then you'll find out he was
 allergic and is hospitalized.  See?  No good deed goes unpunished
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


/etc/sysconfig/apache2 was missing php5 init's module list...

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



[PHP] Php session settings

2007-10-06 Thread Jeff Benetti
Hi all, I am new to PHP this is my second post to this group.

I have tried using the following CMS systems on my web server (remote)
Joomla
CMS made simple
Phpwebsite

And more recently
Coppermine photo album

All of these apps use PHP heavily.

None of these apps seem to run very well and they all require constantly
refreshing the browser.  When I installed CMS made simple (nice install
program) it checked for MySQL database, permissions etc. everything passed
the test but it flagged low memory allocation as a possible problem.  The
install succeeded but the program indicated that performance would be poor
or crippled.

My hosting service allows me to add a customized php.ini in the same folder
as the app.  I know nothing about php.ini so I was hoping someone could
point me to which of the many settings would be best to tweak.

Any help would be much appreciated

Thanks,
Jeff

Quick recap: constantly refreshing browser, could tweak php.ini, total
newbie, no hair left to pull out.

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



RE: [PHP] Php session settings

2007-10-06 Thread Jeff Benetti
SERVER_SOFTWARE  Apache/1.3.34 (Unix) 
 
I have attached the output from phpinfo()
 
I cc'd the php-general group but I am not sure how an attachment will be
dealt with there.
 
Thanks,
Jeff
 


  _  

From: Nathan Nobbe [mailto:[EMAIL PROTECTED] 
Sent: October 6, 2007 9:08 AM
To: Jeff Benetti
Cc: php-general@lists.php.net
Subject: Re: [PHP] Php session settings


Jeff,

is  http://docs.php.net/manual/en/ini.core.php#ini.memory-limit
memory_limit the one youre looking for ?
that sounds strange; im sure the default would be appropriate.
i would recommend you create a script to show the current values
of the php.ini settings before you start changing them.

?php
echo phpinfo();
?

-nathan 

System  FreeBSD cgi20 4.10-RELEASE-p21 FreeBSD 4.10-RELEASE-p21 #0: Mo i386  
Build Date  Mar 22 2007 23:48:30  
Configure Command  ./configure --prefix=/usr/local/nf/php5 
--exec-prefix=/usr/local/nf/php5 --enable-exif --enable-dbase --enable-mbstring 
--with-mysql=/usr/local/nf --enable-discard-path 
--with-config-file-path=/usr/local/nf/php5/etc --with-zlib-dir=/usr/local/nf 
--with-iconv=/usr/local/nf --with-libxml-dir=/usr/local/nf 
--with-png-dir=/usr/local/nf --with-jpeg-dir=/usr/local/nf 
--with-imagick=/usr/local/nf --with-gd --with-curl=/usr/local/nf 
--with-openssl=/usr/local/nf --without-xpm --without-freetype 
--with-libxml-dir=/usr/local/nf --with-mcrypt=/usr/local/nf  
Server API  CGI  
Virtual Directory Support  disabled  
Configuration File (php.ini) Path  /usr/local/nf/php5/etc/php.ini  
PHP API  20041225  
PHP Extension  20060613  
Zend Extension  220060519  
Debug Build  no  
Thread Safety  disabled  
Zend Memory Manager  enabled  
IPv6 Support  enabled  
Registered PHP Streams  php, file, data, http, ftp, compress.zlib, https, ftps  
Registered Stream Socket Transports  tcp, udp, unix, udg, ssl, sslv3, sslv2, 
tls  
Registered Stream Filters  string.rot13, string.toupper, string.tolower, 
string.strip_tags, convert.*, consumed, convert.iconv.*, zlib.*  

 This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
with the ionCube PHP Loader v3.1.28, Copyright (c) 2002-2007, by ionCube 
Ltd.
 




PHP Credits



Configuration
PHP Core
Directive Local Value Master Value 
allow_call_time_pass_reference On On 
allow_url_fopen On On 
allow_url_include Off Off 
always_populate_raw_post_data Off Off 
arg_separator.input   
arg_separator.output   
asp_tags Off Off 
auto_append_file no value no value 
auto_globals_jit On On 
auto_prepend_file no value no value 
browscap no value no value 
default_charset no value no value 
default_mimetype text/html text/html 
define_syslog_variables Off Off 
disable_classes no value no value 
disable_functions no value no value 
display_errors On On 
display_startup_errors Off Off 
doc_root no value no value 
docref_ext no value no value 
docref_root no value no value 
enable_dl On On 
error_append_string no value no value 
error_log no value no value 
error_prepend_string no value no value 
error_reporting no value no value 
expose_php On On 
extension_dir /usr/local/nf/php5/lib/php/extensions/no-debug-non-zts-20060613 
/usr/local/nf/php5/lib/php/extensions/no-debug-non-zts-20060613 
file_uploads On On 
highlight.bg #FF #FF 
highlight.comment #FF8000 #FF8000 
highlight.default #BB #BB 
highlight.html #00 #00 
highlight.keyword #007700 #007700 
highlight.string #DD #DD 
html_errors On On 
ignore_repeated_errors Off Off 
ignore_repeated_source Off Off 
ignore_user_abort Off Off 
implicit_flush Off Off 
include_path .:/usr/local/nf/php5/lib/php .:/usr/local/nf/php5/lib/php 
log_errors Off Off 
log_errors_max_len 1024 1024 
magic_quotes_gpc On On 
magic_quotes_runtime Off Off 
magic_quotes_sybase Off Off 
mail.force_extra_parameters no value no value 
max_execution_time 30 30 
max_input_time -1 -1 
open_basedir no value no value 
output_buffering 0 0 
output_handler no value no value 
post_max_size 8M 8M 
precision 14 14 
realpath_cache_size 16K 16K 
realpath_cache_ttl 120 120 
register_argc_argv On On 
register_globals On On 
register_long_arrays On On 
report_memleaks On On 
report_zend_debug On On 
safe_mode Off Off 
safe_mode_exec_dir /usr/local/php/bin /usr/local/php/bin 
safe_mode_gid Off Off 
safe_mode_include_dir no value no value 
sendmail_from no value no value 
sendmail_path /usr/sbin/sendmail -t -i  /usr/sbin/sendmail -t -i  
serialize_precision 100 100 
short_open_tag On On 
SMTP localhost localhost 
smtp_port 25 25 
sql.safe_mode Off Off 
track_errors Off Off 
unserialize_callback_func no value no value 
upload_max_filesize 2000 2000 
upload_tmp_dir /tmp/ /tmp/ 
user_dir no value no value 
variables_order EGPCS EGPCS 
xmlrpc_error_number 0 0 
xmlrpc_errors Off Off 
y2k_compliance

RE: [PHP] Php session settings

2007-10-06 Thread Jeff Benetti
Thanks,
I added a one line file called php.ini with the following line 
memory_limit = 16M
 
so far CMS made simple seems to run better (faster, no need for page
refresh)
 
Yes I will check out drupal
Jeff

  _  

From: Tom Friedhof [mailto:[EMAIL PROTECTED] 
Sent: October 6, 2007 11:18 AM
To: Jeff Benetti
Cc: php-general@lists.php.net
Subject: Re: [PHP] Php session settings


I almost always up the memory_limit in the php.ini.  Set the memory limit to
16M, or 32M (the default is 8M).  You want a higher memory_limit if you're
working with big file uploads or creating images with php or anything else
that takes a lot of memory. 

Also, if you're still researching which CMS to use, don't forget to check
out Drupal at http://drupal.org.  You can learn a lot about PHP by diving
into a well written project.  The Drupal code is very clean and organized. 

Tom Friedhof


On 10/6/07, Jeff Benetti [EMAIL PROTECTED] wrote: 

SERVER_SOFTWARE  Apache/1.3.34 (Unix) 
 
I have attached the output from phpinfo()
 
I cc'd the php-general group but I am not sure how an attachment will be
dealt with there.
 
Thanks,
Jeff
 


  _  

From: Nathan Nobbe [mailto:[EMAIL PROTECTED] 
Sent: October 6, 2007 9:08 AM
To: Jeff Benetti
Cc: php-general@lists.php.net
Subject: Re: [PHP] Php session settings


Jeff,

is  http://docs.php.net/manual/en/ini.core.php#ini.memory-limit
memory_limit the one youre looking for ?
that sounds strange; im sure the default would be appropriate.
i would recommend you create a script to show the current values
of the php.ini settings before you start changing them.

?php
echo phpinfo();
?

-nathan 

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






[PHP] Re: Sending lots of emails - 2 choices - choose the best one

2007-10-06 Thread Jeff Cohan
Martin Zvarík wrote:
 Hello--
 I want to send email to 100+ recipients. Two choices I 
 thought of:
 
 1) once call mail() and use BCC, but the negative of this 
 method is that every recipient in BCC has header To 
 same (so I used to put my email in here - not email of 
 one of the recipients).
 
 2) several calls to mail() function with each recipient's emal

I like #2, within a loop.

E.g.,

// variables defined:
$subject = 'My weekly newsletter';
$headers = [your mail headers here]
$message = Blah blah \n .
and furthermore yada yada \n .
and finally so on;

while ( $record = mysql_query('SELECT email from clients etc') )
{
  $to = $record[email];
  mail($to, $subject, $message, $headers);
}

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



Re: [PHP] Alternate Colors in Rows ($r=!$r)

2007-10-05 Thread Jeff Cohan
Daevid Vincent wrote:
 TR class=?php echo ($r = !$r) ? dataRow1 : dataRow2; ? 

I love the simplicity, and very cool. 

But why does the ($r=!$r) ternary condition work?. (I understand
that it DOES but not WHY.)

TIA,
Jeff

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



Re: [PHP] Alternate Colors in Rows ($r=!$r)

2007-10-05 Thread Jeff Cohan
Nathan Nobbe wrote:
 personally, i wont argue w/ the compact nature of the 
 statement; its nice. 

I agree. Very elegant. Thanks for the clarifications, folks.

 its mysterious statements like this that make code fragile, 
 imho. i prefer the modulus approach.

I would have agreed before reading the clarification. Not so sure
now...

At the risk of semantic nitpicking, and only because I find this
discussion stimulating (pity us poor geeks), I might call ($r=!$r)
esoteric rather than mysterious, even though I'm the one who asked
the question, suggesting it was a mystery to me.

Garsh: In the early days, I thought I had to write:
if ( strval($somevar)  0 )
or
if ( $somevar ) === true )

and found:
if ( strval($somevar) )
and
if ( $somevar )
mysterious.
!

I suppose my point is that some things start out as mysterious
simply because they are a bit esoteric, further down in the manual.

But I agree with you, Nathan, in principle, about mysterious code
making things fragile. When I first got comfortable with the ternary
operator, I went crazy trying to write cool one-liner conditional
statements with it. Then, months (or even days) later, when I needed
to make changes to those one-liners, I had to scratch my head a lot
to figure out what was what. I've since decided that sometimes, in
the interest of de-mystifying my own code, there's nothing like a
good old IF loop.

My $0.02.

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



[PHP] Beginner Tutorials for using CLASSES in PHP4

2007-09-29 Thread Jeff Cohan
Yes, I know how to Google, and I've been Googling...

But I would appreciate advice about good beginner tutorials using
classes in PHP4 based on your actual experiences. I.e., have some of
you found tutorials that really unlocked the doors for you?

Ideally, such tutorials would have somewhat realistic examples. (I
already know how to output Hello, World using a class, and I tend
to find examples like those unhelpful. Maybe it's just me.)

My main challenge is modularizing yer basic BREAD/CRUD operations
with MySQL databases. 

I've made some strides in creating increasingly modular functions to
present browse lists, edit forms and add forms; to perform
field-level and form-level validations; and to perform inserts,
updates and deletes. My approach is to utilize multidimensional
arrays which define the column names, column labels (for forms),
form control types (input, select, checkbox, etc.) and other
attributes of the form controls. I've got a library of validation
routines with error messages that appear on the form under the
culprit form control.

But I think taking the next step to use classes is going to make my
life much easier.

TIA for any guidance you might be able to offer.

Jeff

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



Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-09-29 Thread Jeff Cohan
Greg -

Greg Maruszeczka wrote:
 Jeff:
 The following books really helped me get my head around basic 
 OOP and design patterns in PHP, especially the first one 
 which directly addresses both PHP4 and PHP5:
 
 1. PHP Architect's Guide to PHP Design Patterns, Jason E. 
 Sweat, PHP Architect Nanobooks, 2005
 2. PHP 5 Objects, Patterns and Practice, Matt Zandstra, 
 Apress, 2004
 
 It also seems like you might be wanting some direction on 
 things like ORM and database abstraction. Have you looked into 
 what some of the PHP-based frameworks are doing in this regard? 
 I know they're PHP5-only but studying projects like Symfony 
 and the new Zend Framework have really helped my understanding 
 quite a bit.
 Of course, the usual disclaimers apply.
 HTH,
 GM
 Greg Maruszeczka
 Websage Solutions
 http://websage.ca
 skype: websage.ca

Thanks very much for the reply and suggestions. My local BN just
set aside their last copy of Jason Sweat's book for me to pick up.

As for database abstraction and frameworks, well... that's a big
maybe for me right now. Maybe later.

My main goal is to write smarter code that I can (a) find quickly
when I need to fix something and (2) re-use. Today's post was
prompted by my desire to prototype yet another suite of
browse-read-edit-add-delete functions for someone.

Best regards,
JC

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



Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-09-29 Thread Jeff Cohan
Nathan Nobbe wrote:
 
 although some people believe differently than i; i would argue
 trying to learn how to design w/ the classes that php4 provides
 is a waste of time.  most books you will find regarding object oriented
 design assume the language has the basic constructs.  ppp mainly.
 also, there are other important facilities php4 lacks like abstract classes
 and interfaces, not to mention you have to explicitly assign objects by
 reference in php4. (if you dont want a copy created).
 unless you are bound to php4 by work or something
 i suggest you start working w/ php5.  also, if your looking for some design
 techniques i recommend studying design patterns.  the heads first book
 is a great starting point.
 actually if you want a solid reference thats free on the web look at
 phpPatterns http://www.phppatterns.com/docs/start
 the code is mostly php4 i believe.
 
 -nathan

Thanks, Nathan. I have been moving toward the conclusion you suggest
(i.e., don't bother with OOP in php4). Yes, I'm bound to php4
currently.

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



Re: [PHP] Beginner Tutorials for using CLASSES in PHP4

2007-09-29 Thread Jeff Cohan
Instruct ICC wrote:
  From: [EMAIL PROTECTED]
  Today's post was
  prompted by my desire to prototype yet another suite of
  browse-read-edit-add-delete functions for someone.
 
 I was just going to ask you what is BREAD.  Cool, basically a 
 Web-based CRUD?  I can't find anything on it, can you point 
 me to some sites?

Being a carbo-freak, I just prefer the BREAD acronym to CRUD. I
think I found the BREAD reference first in Wikipedia. (I know, I
know...)

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



Re: [PHP] MAX_FILE_SIZE not working with file uploads

2007-09-23 Thread Jeff Cohan
Thank you, all who replied. This helps me understand. I might give a
try to the workarounds some suggested.

Great newsgroup.

Jeff

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



Re: [PHP] MAX_FILE_SIZE not working with file uploads

2007-09-22 Thread Jeff Cohan
Chris wrote:
 [error] = 2
 And also gives you an error code.

Yes, I know and knew that. That's why the upload ultimately fails
(which is okay).

My point is that when a file's size exceeds the MAX_FILE_SIZE value,
I want the browser to (a) detect that it's too large BEFORE
attempting to upload it and (b) report the file size back to the
user. That's what's not happening.

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



Re: [PHP] MAX_FILE_SIZE not working with file uploads

2007-09-22 Thread Jeff Cohan


Dan Parry wrote:
 I might be wrong but this would be classed as 
 'exploitable'... Webservers should not be allowed 
 to read from or write to clients... Of course there 
 is ActiveX...

I think we're off the point.

My script is simply interrogating the value of the
$_FILES[userfile][size] array element. It's coming up as ZERO if it
exceeds the MAX_FILE_SIZE. That seems odd to me. But maybe that's
the way it's SUPPOSED to work. That's why I started this thread out
with What am I missing?.

Said another way:

It seems that the server had to know the size of the file in order
to know it exceeded MAX_FILE_SIZE. So how can my script find out the
size?

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



[PHP] MAX_FILE_SIZE not working with file uploads

2007-09-20 Thread Jeff Cohan
The punchline question is: What am I missing?

Now for the details.

I have a form through which a user uploads image files. In the event
the chosen file exceeds the MAX_FILE_SIZE (which I have included as
a hidden form field immediately after the form tag), I want to abort
the upload process and display an appropriate error message to the
user, including the size of the file s/he attempted to upload.

But that doesn't seem to be working.

Instead, the computer chugs along and then properly refuses to
perform the upload, but not immediately. 

And here is the dump of the $_FILES array (which, notably, reports
zero as the size):

[code]
Array
(
[userfile] = Array
(
[name] = beach_iStock_00112348_L2.jpg
[type] = 
[tmp_name] = 
[error] = 2
[size] = 0
)

)
[/code]

The file (about 1.2MB) DOES upload when I increase the MAX_FILE_SIZE
value to 200.

This, from PHP.net:
[quote]
The MAX_FILE_SIZE hidden field (measured in bytes) must precede the
file input field, and its value is the maximum filesize accepted by
PHP. Fooling this setting on the browser side is quite easy, so
never rely on files with a greater size being blocked by this
feature. The PHP settings for maximum-size, however, cannot be
fooled. This form element should always be used as it saves users
the trouble of waiting for a big file being transferred only to find
that it was too big and the transfer failed.
[/quote]


Here is the form code:

[code]
form action=__URL__?action=sent method=post
enctype=multipart/form-data name=upload id=upload 
input type=hidden name=MAX_FILE_SIZE value=1024000 
Filename on your PC:
input name=userfile type=file size=45 
Please click ONCE and be patient:
input name=Submit type=submit id=Submit value=Upload File 
/form
[/code]



Pertinent php.ini settings:
version = 4.3.10
file_uploads = on
upload_max_filesize = 2M
post_max_size = 8M

Any guidance would be appreciated.

Jeff

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



[PHP] Using a variable for include statement

2007-09-11 Thread Jeff Benetti
Sorry if this is a noob question, I have used PERL, TCL and VB but I am just
getting into PHP.  If there is a better place to ask noobie questions then
let me know.

I want to use the include statement but I want to pass the name of the file
rather than hard code it.  It seems that PHP needs the file to be in its
defined PATH in order to do this (or am I wrong?).

My code works OK if I use hard coding

Example (works)

include ('somefile.php')

Example (doesn't work)

$TheFile = somefile.php

include ($TheFile)

Am I trying to do  something that is impossible?

If it is a path problem then how do I get around this, I can control my
local server config but I only have a local server for development.

Thanks,
Jeff

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



[PHP] Background Image

2007-08-28 Thread Jeff
body background=../images/bkgrnds/shot04.JPG link=#00FF00 
vlink=#00 alink=#00

is how I am displaying my background image. This is creating problems for 
different screen resolutions.

What would be the appropriate way to display this code so the image would 
not scroll, resize to the users current screen resolutions and just the page 
content would scroll?

TYIA! 

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



[PHP] Problem compile 5.2.3 souce under SUSE 10.1

2007-07-23 Thread Jeff Lanzarotta
Hello,

I am not sure if this is the right mailing list or not, but here goes...

I am attempting to compile php 5.2.3 from source under SUSE 10.1. The compile 
is fine, it is the 'make test' that is failing...

When I run 'make test' I am getting:

=
FAILED TEST SUMMARY
-
double to string conversion tests [Zend/tests/double_to_string.phpt]
Bug #16069 (ICONV transliteration failure) [ext/iconv/tests/bug16069.phpt]
iconv stream filter [ext/iconv/tests/iconv_stream_filter.phpt]
strripos() offset integer overflow 
[ext/standard/tests/strings/strripos_offset.phpt]
=


I have sent the automatic report, but have not heard anything back.

Does anyone have any ideas on how to fix this?

Regards,

Jeff



Re: [PHP] Re: Problem compile 5.2.3 souce under SUSE 10.1

2007-07-23 Thread Jeff Lanzarotta
Oh, OK, thanks.

- Original Message 
From: M. Sokolewicz [EMAIL PROTECTED]
To: Jeff Lanzarotta [EMAIL PROTECTED]
Cc: PHP General List php-general@lists.php.net
Sent: Monday, July 23, 2007 11:32:17 AM
Subject: [PHP] Re: Problem compile 5.2.3 souce under SUSE 10.1

Jeff Lanzarotta wrote:
 Hello,
 
 I am not sure if this is the right mailing list or not, but here goes...
 
 I am attempting to compile php 5.2.3 from source under SUSE 10.1. The compile 
 is fine, it is the 'make test' that is failing...
 
 When I run 'make test' I am getting:
 
 =
 FAILED TEST SUMMARY
 -
 double to string conversion tests [Zend/tests/double_to_string.phpt]
 Bug #16069 (ICONV transliteration failure) [ext/iconv/tests/bug16069.phpt]
 iconv stream filter [ext/iconv/tests/iconv_stream_filter.phpt]
 strripos() offset integer overflow 
 [ext/standard/tests/strings/strripos_offset.phpt]
 =
 
There are (almost) always _some_ tests that fail. It's normal :)
 
 I have sent the automatic report, but have not heard anything back.
And you won't hear anything back, the report is sent to the QA 
mailinglist, collected there and if there are enough reports to warrant 
an investigation into what the cause of this problem is, it will be 
investigated. You won't hear anything back though.
 
 Does anyone have any ideas on how to fix this?
 
 Regards,
 
 Jeff
There is nothing to fix, they are tests, they check if everything 
works as expected. Apparently a few tests failed (ie. did not return 
_exactly_ what was expected), this doesn't mean your php install isn't 
functioning, because (certainly in this case) it should work just fine. 
Ignore these few testresults.

- Tul

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







[PHP] phpinfo displays blank page

2007-06-20 Thread Jeff Schwartz
When I run phpinfo() nothing is displayed. It used to work. I recently upgraded 
to 5.2.1 but I can't be sure that's exactly when phpinfo stopped working. Has 
anyone else run into this?
   
  Thanks,
  Jeff

   
-
Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel 
and lay it on us.

Re: [PHP] phpinfo displays blank page

2007-06-20 Thread Jeff Schwartz
Thanks for getting back to me so quickly. 
   
  I checked the archives and viewed the source before I posted the problem. The 
source is empty except for the junk IE puts into it. Is there a specific log or 
error file I should check? 
   
  I upgraded from 4.x. I also ran php phpinfo.php (phpinfo.php is a script 
containing only the phpinfo command) at a server prompt but nothing was 
displayed.


Jochem Maas [EMAIL PROTECTED] wrote:
  Daniel Brown wrote:
 On 6/20/07, Jeff Schwartz wrote:
 When I run phpinfo() nothing is displayed. It used to work. I recently
 upgraded to 5.2.1 but I can't be sure that's exactly when phpinfo
 stopped working. Has anyone else run into this?

lots of people :-)

what did you upgrade from?
do what Dan said - only I'd run through his points in the following order 2,3,1

you may have php setup to log elsewhere than the apache error log - if so check 
there also.

lastly I sometimes find it useful to try running the cmdline version php - 
sometimes
I screw things up and the cmdline is helpful in that it [sometimes]
spits out a bunch of errors (usually related to extensions that could not be 
loaded)


 Thanks,
 Jeff


 -
 Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user
 panel and lay it on us.
 
 1.) Search the archives.
 2.) Try to view the source of the page. If you see the PHP
 source, it's not working properly.
 3.) Check the Apache error logs.
 
 See what you come up with after trying all three of the above and
 post your results. It'll give everyone here a better idea of what
 your particular problem may be.
 



   
-
Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, 
when. 

Re: [PHP] phpinfo displays blank page

2007-06-20 Thread Jeff Schwartz
You're right, that works. So why doesn't my script work? All it contains is:
   
  ?php 
phpinfo();
?

Tijnema [EMAIL PROTECTED] wrote:
  On 6/20/07, Jeff Schwartz wrote:
 Thanks for getting back to me so quickly.

 I checked the archives and viewed the source before I posted the problem. The 
 source is empty except for the junk IE puts into it. Is there a specific log 
 or error file I should check?

 I upgraded from 4.x. I also ran php phpinfo.php (phpinfo.php is a script 
 containing only the phpinfo command) at a server prompt but nothing was 
 displayed.

What happens if you run this on the command line:
php -r phpinfo();

That should work :)

Tijnema


 Jochem Maas wrote:
 Daniel Brown wrote:
  On 6/20/07, Jeff Schwartz wrote:
  When I run phpinfo() nothing is displayed. It used to work. I recently
  upgraded to 5.2.1 but I can't be sure that's exactly when phpinfo
  stopped working. Has anyone else run into this?

 lots of people :-)

 what did you upgrade from?
 do what Dan said - only I'd run through his points in the following order 
 2,3,1

 you may have php setup to log elsewhere than the apache error log - if so 
 check there also.

 lastly I sometimes find it useful to try running the cmdline version php - 
 sometimes
 I screw things up and the cmdline is helpful in that it [sometimes]
 spits out a bunch of errors (usually related to extensions that could not be 
 loaded)

 
  Thanks,
  Jeff
 
 
  -
  Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user
  panel and lay it on us.
 
  1.) Search the archives.
  2.) Try to view the source of the page. If you see the PHP
  source, it's not working properly.
  3.) Check the Apache error logs.
 
  See what you come up with after trying all three of the above and
  post your results. It'll give everyone here a better idea of what
  your particular problem may be.
 




 -
 Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, 
 when.


 
-
Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.

[PHP] Passing variables

2007-03-21 Thread Jeff
I want to thank you all for clearing me up on setting the register_globals 
to ON issue!! I have refrained from doing so and my code is running great 
with the $_GET.

I am having NO trouble passing my single variable to the next page using..

echo A href=\char_edit_form.php?charid=$charid\Edit/A;

as when the next page that load actually shows the character info, so 
basically you can see you are dealing with the correct record.

NOW.

I want to pass two variables to a delete page. The charid and the char name. 
Here is what I have but it will only pass the 1st variable ?charid

echo A href=\delete_char.php?charid=$charid 
?char=.$myrow[char_name].\Delete/A;

I get the 1st variable using the $charid = (int)$_GET['charid']; (on the 
next page)

I do however NOT get

$charname = $_GET[char] to pull the name out. (on the next page)

I've tried putting a comma, a , a % between the variables ie..

echo A href=\delete_char.php?charid=$charid  
?char=.$myrow[char_name].\Delete/A;

but it just won't let me pull the $_GET[char]

I have even tried $_GET['char'] but am under the impression '_' are for 
integers and _ are for text? Anyway, can someone please let me know the 
PROPER way to pass the two or more variables?

Thanks WAY in advance!! 

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



Re: [PHP] Passing variables

2007-03-21 Thread Jeff
Thank you Chris!

Chris [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Jeff wrote:
 I want to thank you all for clearing me up on setting the 
 register_globals to ON issue!! I have refrained from doing so and my code 
 is running great with the $_GET.

 I am having NO trouble passing my single variable to the next page 
 using..

 echo A href=\char_edit_form.php?charid=$charid\Edit/A;

 as when the next page that load actually shows the character info, so 
 basically you can see you are dealing with the correct record.

 NOW.

 I want to pass two variables to a delete page. The charid and the char 
 name. Here is what I have but it will only pass the 1st variable ?charid

 echo A href=\delete_char.php?charid=$charid 
 ?char=.$myrow[char_name].\Delete/A;

 The first one is preceded by a ?

 Subsequent ones are with an ''.

 See http://en.wikipedia.org/wiki/Query_string

 -- 
 Postgresql  php tutorials
 http://www.designmagick.com/ 

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



[PHP] working with class inheritance

2007-03-20 Thread Jeff Taylor
Hey all, got a slight problem, where for some reasons my variables dont seem
to be getting stored in the child class:

e.g

class Parent
{
  $private type;

  public function __construct()
  {
  }

   public function GetType()
   {
  return $this-type;
  }
}

class Child implements Parent
{
$public function __construct()


  $this-type= 'Child';
  }
}

$Child= new Child();
echo $Child-getType;

Can u see any reason why the type would return null?

Thanks,

Jeff


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



[PHP] Re: working with class inheritance

2007-03-20 Thread Jeff Taylor
OOPS!... typo

Please replace implements with extends:

class Child extends Parent

Sorry about that
Jeff Taylor [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hey all, got a slight problem, where for some reasons my variables dont
seem
 to be getting stored in the child class:

 e.g

 class Parent
 {
   $private type;

   public function __construct()
   {
   }

public function GetType()
{
   return $this-type;
   }
 }

 class Child implements Parent
 {
 $public function __construct()


   $this-type= 'Child';
   }
 }

 $Child= new Child();
 echo $Child-getType;

 Can u see any reason why the type would return null?

 Thanks,

 Jeff


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



[PHP] Re: working with class inheritance

2007-03-20 Thread Jeff Taylor
I forgot to mention that I have some __construct operations in the parent
class, and I want to add to those (and overwrite sometimes) in the child
class __construct

 i.e Parent class __construct
$this-foo = 'Bar';
$this-foo2 = '10';

Child class __construct
  $this-foo.='Bar';
  $this-foo2 .= rand(1,6);
  $this-type = 'Child';

Outputs of variables foo == Bar Bar
   foo2 == 11-16
type == Child

Thanks :)



Jeff Taylor [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 OOPS!... typo

 Please replace implements with extends:

 class Child extends Parent

 Sorry about that
 Jeff Taylor [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hey all, got a slight problem, where for some reasons my variables dont
 seem
  to be getting stored in the child class:
 
  e.g
 
  class Parent
  {
$private type;
 
public function __construct()
{
}
 
 public function GetType()
 {
return $this-type;
}
  }
 
  class Child implements Parent
  {
  $public function __construct()
 
 
$this-type= 'Child';
}
  }
 
  $Child= new Child();
  echo $Child-getType;
 
  Can u see any reason why the type would return null?
 
  Thanks,
 
  Jeff
 

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



Re: [PHP] working with class inheritance

2007-03-20 Thread Jeff Taylor
Thanks everyone,

Gave me a much better understanding of it

Jim Lucas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Jim Lucas wrote:
  Jeff Taylor wrote:
  Hey all, got a slight problem, where for some reasons my variables
  dont seem
  to be getting stored in the child class:
 
  e.g
 
  class Parent
  At least in PHP 5.2.1 on windows xp (for testing only), the class name
  Parent is a reserved class name, you cannot define a class by that name.
 
  {
$private type;
 
public function __construct()
{
}
 
 public function GetType()
 {
return $this-type;
}
  }
 
  class Child implements Parent
  {
  $public function __construct()
  public should not be prefixed with '$'
  you are missing your open '{' for this method
 
 
  You need to call
  parent::__construct();
 
 
$this-type= 'Child';
}
  }
 
  $Child= new Child();
  echo $Child-getType;
  also, you are calling a method, not accessing a property.
 
  it should be
  echo $Child-getType();
 
 
  Can u see any reason why the type would return null?
 
  Thanks,
 
  Jeff
 
 
  well, for starters, I think it is incorrect to have public and private
  prefixed with a '$'.  But then you have it on some, but not all of
  them.
 
  Besides that, does it give you an error?  What does it return if it
  doesn't return 'Child'??
 
  What version of PHP are you running on.  there is a differnet way the
  constuct() method gets called.
 
  public and private are not available in versions older than php 5
 
  in PHP version  5 you have to have a method named the same as the class
  that you are creating.
 
  Try this:
  ?php
 
  class myParent {
  #private $type;#--- With this, I cannot echo $type
 
  var $type;#--- With this, I CAN echo $type
 
  public function __construct() {
  }
 
  public function myParent() {
  $this-__construct();
  }
  public function getType() {
  echo $this-type;
  }
  }
 
  class myChild extends myParent {
  public function __construct() {
  parent::__construct();
  $this-type = 'Child';
  }
  public function myChild() {
  $this-__construct();
  }
  }
 
  $Child = new myChild();
  echo $Child-getType();
 
  ?
 

 ok, responded too quickly.  Roman has it right with the settype method

 This now works.

 ?php

 class myParent {
 private $type;
 public function __construct() {
 return $this;
 }
 public function myParent() {
 return $this-__construct();
 }
 public function setType($value='') {
 $this-type = $value;
 }
 public function getType() {
 return $this-type;
 }
 }

 class myChild extends myParent {
 public function __construct() {
 parent::__construct();
 $this-setType('Child');
 return $this;
 }
 public function myChild() {
 return $this-__construct();
 }
 }

 $Child = new myChild();
 echo $Child-getType();

 ?

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



[PHP] Getting last record ID created from DB

2007-03-16 Thread Jeff
Is there a way to get the last Record # created by the DB.

Example:

User_ID = auto_increment
f_name = varchar
l_name = varchar
e-mail = varchar
b_date = varchar
pic = varchar


Since user_id is an auto_inc field I submit it as a NULL, also I haven't 
started the code for a picture yet either so I have it set to NULL at this 
moment.
My code is:

$query = INSERT INTO `t_users` (`user_id`, `f_name`, `l_name`, `e_mail`, 
`b_date`, `pic`) VALUES ('', '$f_name', '$l_name', '$e_mail', '$b_date', 
'');
$result = mysql_query($query);
if(!$result)
{
die(Could not query the database: br/.mysql_error());
}
echo Your Player information has been stored OK.br /;

what code could I add here to make the following line work?

echo REMEMBER your USER ID# you will need it when creating Characters!! It 
is: $user_id; - I want to show the user_id just created here.

Thanks in advance! 

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



Re: [PHP] Passing a class through an array

2007-03-15 Thread Jeff Taylor
Ahh the problem was that I was using $name1-$name instead of $name1-name
to call the variable.

Thanks though :)

 If line 140 is the $name1-name part, then you probably haven't
 written your constructor correctly to cram 'Toon1' into the name
 field...


 On Thu, March 8, 2007 11:51 pm, Jeff Taylor wrote:
  Hey all,
  I'm very new to programming and PHP.
  I want to pass instances of a class through an array, and then use a
  foreach
  later to grab details of each class at once... but it returns a fatal
  error
 
  Code:
 
  $me = new Toon('Toon1','1')
  $him = new Toon('Toon2','0')
 
 $characterListing = array($me, $him);
 
 foreach ($characterListing as $name1)
 {
  if ($name1-GetIsPlayer())
  {
   echo bName: /b .$name1-$name;// etc etc etc
  }
 }
 
 
 
  the error I get is: Fatal error: Cannot access empty property in
  c:\Inetpub\wwwroot\MyProjects\SecondOffering\htmlFns.php on line 140
 
  Can anyone help?
 
  Thanks, Jeff
 
 
 
  --
  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 starving 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] register_globals and passing variables

2007-03-14 Thread Jeff
Ok, all I am new to PHP  MySQL. (please don't let this scare you off)

I had my site hosted with Gisol.com and due to their very poor service and 
tech support I left them for Lunarpages.com who so far have a better service 
and their tech support is excellent!! But my pages won't pass variables any 
more.

When I started I purchased two books MySQL and PHP  MySQL both published by 
O'Riely. So far the are excellent help and instructors. I wote some pages 
where I track users and their characters from an on-line game called World 
of Warcraft.

On the Gisol server they were working EXCELLENT!!

Once I moved to Lunarpages, the pages load ok but they don't pass the 
variables from one page to another.

The below code queries the db and list's the user's in a table, and has a 
hyperlink to the right of each, on Gisol I could click the link and it would 
load the view_char.php page and it listed their character and the info i 
needed, and gave options to delete and edit. Again it was working 
beautifully.


VIEW USERS PAGE CODE:
$sql=SELECT f_name, l_name, char_id, char_name, char_level FROM t_char, 
t_users where t_users.user_id = t_char.user_link ORDER BY char_name ASC;
mysql_select_db($db_select,$db);
$result = mysql_query($sql,$db);
echo TABLE border=2;
echoTRTDBCharacter Name/BTDBCharacter 
Level/BTDBOwner/B/TR;
while ($myrow = mysql_fetch_array($result))
{
echo 
TRTD.$myrow[char_name].TD.$myrow[char_level].TD.$myrow[f_name].
 
.$myrow[l_name];
echo TDA href=\view_char.php?charid=.$myrow[char_id].\View/A;
}
//$charid=[.$myrow[char_id].]; - I tried this line with no success. 
Possibly have it in the wrong place??
echo/TABLE;

VIEW_CHAR PAGE CODE
$sql = SELECT * FROM `t_char` WHERE `t_char`.`char_id` = '$charid'; --  
now all this does is produce a blank page... used to work great!
//$sql = SELECT * FROM `t_char` WHERE `t_char`.`char_id` = '21'; - i 
used this code to test the page w/o the $charid string and it works FINE!!
$result=mysql_query( $sql );
if (!$result)
{
die(Could not query the database: br /.mysql_error());
}

I wrote a help ticket to Lunarpages where I am now hosted and asked them to 
set the register_globals to ON thinking this was the problem based on what 
I've read and the wrote back and told me that they use suPHP to parse php 
files and I have the option of using custom php.ini files. That I could 
create a .htaccess file or put individual php.ini files in the folder that 
contains the files im running. In other words do it myself.


So I created this file:

[PHP]

register_globals = on

named it php.ini and dropped it in the folder with all of my files.

It didn't help any.

So I added this line to the first file
include ('php.ini');

all it does is add :[PHP] register_globals = on  as text at the top of my 
page now.

At this point im lost!! I don't know what to do to get my A 
href=\view_char.php?charid=.$myrow[char_id]. to equal $charid in the 
following pages.

Any help you could provide me would GREATLY be APPRECIATED!!!

Signed,
I'm trying 

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



[PHP] Passing Variables

2007-03-14 Thread Jeff
Ok, all I am new to PHP  MySQL. (please don't let this scare you off)

I had my site hosted with Gisol.com and due to their very poor service and
tech support I left them for Lunarpages.com who so far have a better service
and their tech support is excellent!! But my pages won't pass variables any
more.

When I started I purchased two books MySQL and PHP  MySQL both published by
O'Riely. So far the are excellent help and instructors. I wote some pages
where I track users and their characters from an on-line game called World
of Warcraft.

On the Gisol server they were working EXCELLENT!!

Once I moved to Lunarpages, the pages load ok but they don't pass the
variables from one page to another.

The below code queries the db and list's the user's in a table, and has a
hyperlink to the right of each, on Gisol I could click the link and it would
load the view_char.php page and it listed their character and the info i
needed, and gave options to delete and edit. Again it was working
beautifully.


VIEW USERS PAGE CODE:
$sql=SELECT f_name, l_name, char_id, char_name, char_level FROM t_char,
t_users where t_users.user_id = t_char.user_link ORDER BY char_name ASC;
mysql_select_db($db_select,$db);
$result = mysql_query($sql,$db);
echo TABLE border=2;
echoTRTDBCharacter Name/BTDBCharacter
Level/BTDBOwner/B/TR;
while ($myrow = mysql_fetch_array($result))
{
echo
TRTD.$myrow[char_name].TD.$myrow[char_level].TD.$myrow[f_name].
.$myrow[l_name];
echo TDA href=\view_char.php?charid=.$myrow[char_id].\View/A;
}
//$charid=[.$myrow[char_id].]; - I tried this line with no success.
Possibly have it in the wrong place??
echo/TABLE;

VIEW_CHAR PAGE CODE
$sql = SELECT * FROM `t_char` WHERE `t_char`.`char_id` = '$charid'; --
now all this does is produce a blank page... used to work great!
//$sql = SELECT * FROM `t_char` WHERE `t_char`.`char_id` = '21'; - i
used this code to test the page w/o the $charid string and it works FINE!!
$result=mysql_query( $sql );
if (!$result)
{
die(Could not query the database: br /.mysql_error());
}

I wrote a help ticket to Lunarpages where I am now hosted and asked them to
set the register_globals to ON thinking this was the problem based on what
I've read and the wrote back and told me that they use suPHP to parse php
files and I have the option of using custom php.ini files. That I could
create a .htaccess file or put individual php.ini files in the folder that
contains the files im running. In other words do it myself.

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



[PHP] Re: Troubles from the newb again

2007-03-09 Thread Jeff Taylor
Is it possible to just add a value to the existing? here is my current
script:

 foreach ($newarray as $name)
   {
$newarray[$name] = $name-currentInitiative =
rand(1,$name-GetInitiative()));
   }
   // sort array by ranking (initiative)
   sort($newarray,SORT_NUMERIC);

can I change the $newarray[$name] to something to represent the current
element and just add the value to it?

I might be able to work around it then

Jeff Taylor [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hey everyone,
 Newb back again - Im trying to populate my arrays, but getting this error
 again:
 Warning: Illegal offset type in
 c:\Inetpub\wwwroot\MyProjects\SecondOffering\myFuncs.php on line 242

 Code:
$newarray = array();
foreach ($array as $name)
{
 if ($name-currentHP 0)
 {
  $newarray[$name];
 }
}

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



Re: [PHP] Troubles from the newb again

2007-03-09 Thread Jeff Taylor
Yeah I have, but what I dont understand is that the value of $name is an
object, and was accepted in the original array as the index:

the original array was:

$me = new Toon(,xxx,xxx,,xxx,etc,etc,etc)
$him = new Toon(xxx,xx,x,etc,etc,etc,etc)


$array=array($me,$him)


So this new array, I want to isolate those toons still alive:

if alive then
add toon to new array

Is this possible in anyway?


The reason why I dont want it to put it in a value:

   foreach ($newarray as $name)
   {
if (in_array($name,$characters))
{
 $newarray[$name] = 1;
}
else
{
 $newarray[$name] = 2;
}
   }


Sorry for the spam everyone

Robert Cummings [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Sat, 2007-03-10 at 15:31 +1030, Jeff Taylor wrote:
  Hey everyone,
  Newb back again - Im trying to populate my arrays, but getting this
error
  again:
  Warning: Illegal offset type in

 This usually means that you are using a non-scalar value as an index.
 Use var_dump( $array ) to see what's in there. You will probably find
 one of the following: an array, and object, or the null value.

 Cheers,
 Rob.
 --
 ..
 | InterJinn Application Framework - http://www.interjinn.com |
 ::
 | An application and templating framework for PHP. Boasting  |
 | a powerful, scalable system for accessing system services  |
 | such as forms, properties, sessions, and caches. InterJinn |
 | also provides an extremely flexible architecture for   |
 | creating re-usable components quickly and easily.  |
 `'

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



[PHP] Passing a class through an array

2007-03-08 Thread Jeff Taylor
Hey all,
I'm very new to programming and PHP.
I want to pass instances of a class through an array, and then use a foreach
later to grab details of each class at once... but it returns a fatal error

Code:

$me = new Toon('Toon1','1')
$him = new Toon('Toon2','0')

   $characterListing = array($me, $him);

   foreach ($characterListing as $name1)
   {
if ($name1-GetIsPlayer())
{
 echo bName: /b .$name1-$name;// etc etc etc
}
   }



the error I get is: Fatal error: Cannot access empty property in
c:\Inetpub\wwwroot\MyProjects\SecondOffering\htmlFns.php on line 140

Can anyone help?

Thanks, Jeff



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



[PHP] Happy new year!

2007-01-01 Thread JMCS Niagara (Jeff)
Happy new year everyone :)

[PHP] New User Sign up Notification

2006-12-22 Thread JMCS Niagara \(Jeff\)
hi there. I'm looking to create a new user signup. So when someone signs up, it 
emails admin the Username, Real Name, and IP address.

I have this code called newusersignupnotification.php

?php
$to = '[EMAIL PROTECTED]'; // The email address you want the notification sent 
to
$subject = 'Member has registered on YoS'; // What do you want the subject line 
of your notification to be?
$memberSpecs = 
hr size=2 width=300 align=left.
bUsername:/b .$_SESSION['username'].
br.
bReal Name:/b .$_SESSION['firstname'].  .$_SESSION['lastname'].
br.
bDate/b .date('l dS \of F Y h:i:s A').
br. 
bIP address:/b .$_SERVER['REMOTE_ADDR'].
br.
bSystem Specs:/b .$_SERVER['HTTP_USER_AGENT'].
br;
$headers = Content-type: text/html \nFrom: [EMAIL PROTECTED];
$body = body
br
table cellspacing=1 cellpadding=2 align=center
tr
td
bfont face=arial size=2A new member has registered! /font/b

/td/tr
tr
td
font face=arial size=2 .$memberSpecs. /font
/td/tr/table
/body;
mail($to,$subject,$body,$headers);
?

When I place this in the join.php file .. When someone goes to join.php it 
automatically emails it .. and I get date, time, ip, etc etc everything except 
for the username and first name.. Obviously, because the person hasn't typed in 
anything.

When they filled out the sign up form, There's a button that says Sign Up .. 
Basically, when they click this button, NOW is when I want it to email me the 
details.

Any ideas?

Thanks guys

[PHP] GD, and GD JPEG

2006-11-25 Thread Jeff


 Hi there.
I installed a script but it requires GD and GD JPEG

I downloaded GD, and GD JPEG

But how the heck do I install it?

Thanks guys

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



[PHP] GD.. con't

2006-11-25 Thread Jeff

Do I have to compile it with a C program?

What programs do people suggest I use to make PHP Files?

Is there a simple C program that will create basically whatever you want to 
do, without knowing the language?


I recall studying it in school, vaguely recalling the code...

Thanks,
Jeff


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



[PHP] Coding...

2006-11-18 Thread Jeff
I am pretty new with PHP, but what I've learned in the last 3 weeks is 
pretty good I think so far!


What I'm looking to do is create a login script, and have people being able 
to login.


Now, I have pulled scripts from sites, and everything is working okay.
But the problem I have with pulling scripts from other sites, is that the 
mysql databases are all different.


How can I import from one database into the other, so basically all the 
databases are merged into one main?


I also know that each PHP file has to be re-done and look for the new 
database name, for instance if it was user_name, and the default (Main) 
database is username .. That I Have to rename all the php files that have 
user_name to simply username.


If anyone is willing to help out with the project I'm working on with 
another programmer? Hopefully being very cost effective .. or free :) :)


Thanks,

Jeff 


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



Re: [PHP] How does the Zend engine behave?

2006-10-26 Thread jeff . phplist



Jon Anderson wrote:
Take this with a grain of salt. I develop with PHP, but I am not an 
internals guy...


[EMAIL PROTECTED] wrote:
Are the include files only compiled when execution hits them, or are 
all include files compiled when the script is first compiled, which 
would mean a cascade through all statically linked include files. By 
statically linked files I mean ones like include ('bob.php') - i.e 
the filename isn't in a variable.
Compiled when execution hits them. You can prove this by trying to 
conditionally include a file with a syntax error: if (false) 
include('script_with_syntax_error.php'); won't cause an error.


Good idea.



Secondly, are include files that are referenced, but not used, loaded 
into memory? I.e Are statically included files automatically loaded 
into memory at the start of a request? (Of course those where the 
name is variable can only be loaded once the name has been 
determined.) And when are they loaded into memory? When the 
instruction pointer hits the include? Or when the script is initially 
loaded?
If your include file is actually included, it will use memory. If it 
is not included because of some condition, then it won't use memory.


I wonder if that's the same when a cache/optimiser is used. Probably. 
Maybe I'll check.


Are included files ever unloaded? For instance if I had 3 include 
files and no loops, once execution had passed from the first include 
file to the second, the engine might be able to unload the first 
file. Or at least the code, if not the data.
If you define a global variable in an included file and don't unset it 
anywhere, then it isn't automatically unloaded, nor are 
function/class definitions unloaded when execution is finished.


Once you include a file, it isn't unloaded later though - even 
included files that have just executed statements (no definitions 
saved for later) seem to eat a little memory once, but it's so minimal 
that you wouldn't run into problems unless you were including many 
thousand files. Including the same file again doesn't eat further 
memory. I assume the eaten memory is for something to do with 
compilation or caching in the ZE.
Thirdly, I understand that when a request arrives, the script it 
requests is compiled before execution. Now suppose a second request 
arrives for the same script, from a different requester, am I right 
in assuming that the uncompiled form is loaded? I.e the script is 
tokenized for each request, and the compiled version is not loaded 
unless you have engine level caching installed - e.g. MMCache or Zend 
Optimiser.
I think that's correct. If you don't have an opcode cache, the script 
is compiled again for every request, regardless of who requests it.


IMO, you're probably better off with PECL/APC or eAccelerator rather 
than MMCache or Zend Optimizer. I use APC personally, and find it 
exceptional - rock solid + fast. (eAccelerator had a slight 
performance edge for my app up until APC's most recent release, where 
APC now has a significant edge.)

Thanks - that's useful to know.


Fourthly, am I right in understanding that scripts do NOT share 
memory, even for the portions that are simply instructions? That is, 
when the second request arrives, the script is loaded again in full. 
(As opposed to each request sharing the executed/compiled code, but 
holding data separately.)

Yep, I think that's also correct.
Fifthly, if a script takes 4MB, given point 4, does the webserver 
demand 8MB if it is simultaneously servicing 2 requests?

Yep. More usually with webserver/PHP overhead.
Lastly, are there differences in these behaviors for PHP4 and PHP5? 
Significant differences between 4 and 5, but with regards to the 
above, I think they're more or less the same.


Thanks Jon. So in summary: use a cache if possible. Late load files to 
save memory. Buy more memory to handle more sessions. And it's 
conceivable that when caches are used, different rules may apply.


Jeff

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



Re: [PHP] How does the Zend engine behave?

2006-10-26 Thread jeff . phplist
 in this situation.

Thank you.

Jeff


This should be relatively easy to do, if you plan fairly carefully.

If a village idiot like me can write a PHP extension (albeit a
dirt-simple one) then anybody can. :-)

  


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



[PHP] How does the Zend engine behave?

2006-10-25 Thread jeff . phplist

Hi,

I'm using PHP 4.x and I'm trying to understand a bit about memory usage...

Firstly, when I say 'include files' below, I mean all forms, include, 
require and the _once versions.


That said, when a script runs and it's made of several include files, 
what happens?


Are the include files only compiled when execution hits them, or are all 
include files compiled when the script is first compiled, which would 
mean a cascade through all statically linked include files. By 
statically linked files I mean ones like include ('bob.php') - i.e the 
filename isn't in a variable.


Secondly, are include files that are referenced, but not used, loaded 
into memory? I.e Are statically included files automatically loaded into 
memory at the start of a request? (Of course those where the name is 
variable can only be loaded once the name has been determined.) And when 
are they loaded into memory? When the instruction pointer hits the 
include? Or when the script is initially loaded?


Are included files ever unloaded? For instance if I had 3 include files 
and no loops, once execution had passed from the first include file to 
the second, the engine might be able to unload the first file. Or at 
least the code, if not the data.


Thirdly, I understand that when a request arrives, the script it 
requests is compiled before execution. Now suppose a second request 
arrives for the same script, from a different requester, am I right in 
assuming that the uncompiled form is loaded? I.e the script is tokenized 
for each request, and the compiled version is not loaded unless you have 
engine level caching installed - e.g. MMCache or Zend Optimiser.


Fourthly, am I right in understanding that scripts do NOT share memory, 
even for the portions that are simply instructions? That is, when the 
second request arrives, the script is loaded again in full. (As opposed 
to each request sharing the executed/compiled code, but holding data 
separately.)


Fifthly, if a script takes 4MB, given point 4, does the webserver demand 
8MB if it is simultaneously servicing 2 requests?


Lastly, are there differences in these behaviors for PHP4 and PHP5?

Many thanks,

Jeff

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



[PHP] Socket communications question

2006-10-13 Thread Jeff Lanzarotta
Hello,

I am trying to get a php web page to communicate with a java
application with little success...

I can get the php page to send the request to the java application,
just fine. But when the java app sends the response back, the php page
does not seem to get it...

As a side note, the java app works just fine if the client is another
java app, or a C app. Everything is send and received just fine...

From what I can tell in the php page, the

while ($out = socket_read($socket, 2048, PHP_NORMAL_READ))
{
  echo $out;
}

never returns.

Any ideas?

-Jeff


-Jeff

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



[PHP] recv() socket question

2006-09-28 Thread Jeff Lanzarotta
Hello,

I am writing a web page that contains some php code the will
send/receive a message from a java application running on our server.

The php code successfully sends a message to the server but will not,
as far as I know, receive the message back. The only way I know this is
that I attempt to echo out the message that is received and nothing
prints...

I am very new to php so I am using 'class.ClientSocket.php' written by
Juan M. Hidalgo to do all the communications...

What is odd is that I receive no errors either from either side.

Any ideas would be greatly appreciated.

-Jeff

-Jeff

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



Re: [PHP] recv() socket question

2006-09-28 Thread Jeff Lanzarotta
OK, I will try and contact Juan. I wrote the Java server. I believe the
Java side is working because I can send/receive messages just fine
using other clients written in other languages, just not the php
client...

Regards,

-Jeff

--- Richard Lynch [EMAIL PROTECTED] wrote:

 On Thu, September 28, 2006 10:14 am, Jeff Lanzarotta wrote:
  I am writing a web page that contains some php code the will
  send/receive a message from a java application running on our
 server.
 
  The php code successfully sends a message to the server but will
 not,
  as far as I know, receive the message back. The only way I know
 this
  is
  that I attempt to echo out the message that is received and nothing
  prints...
 
  I am very new to php so I am using 'class.ClientSocket.php' written
 by
  Juan M. Hidalgo to do all the communications...
 
  What is odd is that I receive no errors either from either side.
 
  Any ideas would be greatly appreciated.
 
 You could try contacting Juan and/or the Java guy who wrote the
 code...
 
 You should also start reading class.ClientSocket.php and figuring out
 how it works and adding debugging statements to see what's going on.
 
 Ye Olde 'echo got here\n;' is often the best answer in this
 situation.
 
 -- 
 Like Music?
 http://l-i-e.com/artists.htm
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



[PHP] Replacing text with criteria

2006-06-15 Thread Jeff Lewis
I have been working on a script to parse a CSV file and in the process I
clean out a lot of the garbage not needed but I am a bit stumped on one
aspect of this file. It's a list of over 3000 contacts and I'm trying to
mask a lot of the information with *.
 
So as I loop through this list I am checking the array elements as if I find
a phone number (555) 555-1212 (I was searching for the (555)) I want to
convert it to (555) ***-
 
For fields not containing an area code, I wanted any text to be replaced by
an * except for the first and last letter in the element.
 
I'm stumped and was hoping that this may be something horribly simple I'm
overlooking that someone can point out for me.


[PHP] Avoiding user refresh of pages with forms

2006-05-03 Thread Jeff
Is there a way to prevent a re-posting of the form data when a user
pushes the refresh button on the browser?

I have a page that has a form to enter credit's or debit's to a user
account.  The top of the page displays the users account history and at
the bottom is a form to add an adjustment. I just had a situation where
a user came in complaining that the database is out of control every
time I REFRESH the page the credit I put in gets added again and
again!!  He also claimed he was getting no warning message about that
which was of course false, he just didn't read it.

In any event, I need to make this more user proof.

Thanks,

Jeff

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



[PHP] Preg_match() regex

2006-04-21 Thread Jeff
Hey all,

Regex pattern question here.  I need to match on Foo-F00, Foo-foo,
foo-Foo.  I know in perl you can use the /i to specify case
insensitive matching.  Is there any such switch that can be used in
preg_match() in PHP?

Thanks,

Jeff

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



[PHP] PHP CLI not present

2006-04-19 Thread Jeff
Hey all,

I'm running PHP Ver 4.4.1 on a redhat ES3 system.  It appears that the
CLI is not running or not present.  I thought it was installed by
default in versions = 4.3.x.  

If I run /usr/local/bin/php -v at the command line I get nothing.

How do I get the PHP CLI working?

Thanks,

Jeff

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



RE: [PHP] PHP CLI not present [SOLVED]

2006-04-19 Thread Jeff
 -Original Message-
 From: Jeff [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, April 19, 2006 16:02
 To: php-general@lists.php.net
 Subject: [PHP] PHP CLI not present
 
 
 Hey all,
 
 I'm running PHP Ver 4.4.1 on a redhat ES3 system.  It appears 
 that the CLI is not running or not present.  I thought it was 
 installed by default in versions = 4.3.x.  
 
 If I run /usr/local/bin/php -v at the command line I get nothing.
 
 How do I get the PHP CLI working?
 
 Thanks,
 
 Jeff

Nevermind.  Found it!

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



[PHP] Strange math results

2006-03-28 Thread Jeff
I've got a strange problem here.

I'm subtacting one variable from another, both of type double and if
they are the same, instead of getting a result of 0, I get something
like -9.99200722163E-016

Is this a bug or am I doing something wrong here?

Thanks,

Jeff

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



RE: [PHP] Strange math results

2006-03-28 Thread Jeff
 -Original Message-
 From: Satyam [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, March 28, 2006 17:23
 To: [EMAIL PROTECTED]; Jay Blanchard
 Cc: Jeff; php-general@lists.php.net
 Subject: Re: [PHP] Strange math results
 
 
 Indeed, when doing floating point math, you cannot  check the 
 values for 
 equality, they will rarely be, you have to check whether the 
 difference in 
 between them is less than the error you are willing to 
 accept.  Floating 
 point numbers are usually an approximation to the actual value and 
 intermediate operations might pile up errors in each approximation in 
 different ways.
 
 As an example,
 
 $third = 1/3;
 
 $third will contain 0.3 up to a certain number of digits, 
 but it won't 
 last forever, as it should, theoretically.
 
 Now,
 
 $third * 3 == 1
 
 will be false, but:
 
 define('MAXERR',0.001);
 abs($third * 3 - 1)  MAXERR
 
 will be true.
 
 MAXERR is the error you are willing to accept in your 
 calculations, for 
 example, if you are using cents, give it a couple of extra 
 positions so that 
 roundings don't creep up to significant cents, that is, use 
 MAXERR = 0.0001 
 or thereabouts.
 
 Satyam
 

That explains it.  Thanks!

Jeff

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



[PHP] Creating a unique index ID

2006-03-13 Thread Jeff
Hey all,

I've got a project where I'm taking form information from the user and
writing records to several tables in a MySQL database.

The problem I'm having is I need to write a unique number for the ID
column of the records.  Auto increment won't work because I could have
conflicts due to replication of the database servers.  Anyone have any
techique they use for creating unique ID field entries in a db table?

I was thinking maybe using a random 3 digit number and a unix timestamp?

Jeff

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



RE: [PHP] Creating a unique index ID

2006-03-13 Thread Jeff
 -Original Message-
 From: Jared Williams [mailto:[EMAIL PROTECTED] 
 Sent: Monday, March 13, 2006 10:16
 To: 'Jeff'; php-general@lists.php.net
 Subject: RE: [PHP] Creating a unique index ID
 
 
  
 
  Hey all,
  
  I've got a project where I'm taking form information from the
  user and writing records to several tables in a MySQL database.
  
  The problem I'm having is I need to write a unique number for
  the ID column of the records.  Auto increment won't work 
  because I could have conflicts due to replication of the 
  database servers.  Anyone have any techique they use for 
  creating unique ID field entries in a db table?
  
 
 Autoincrements can work in a replicated enviroment, lookup 
 mysql settings auto_increment_increment  auto_increment_offset.
 
 Each server gets its own unique auto_increment_offset, and 
 auto_increment_increment is set to the number of servers you have.
 
 Jared
 

Hmm, 

actually I'm using circular replication, so it's a bit different than
one way replication.

A replicates to B which replicates to A.

I've looked at the MySQL docs and can't find anything on how to make
Auto_Increment work in Circular Replication.

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



[PHP] Does this If statement make sense?

2006-02-21 Thread Jeff
I'm again working with someone else's code and I have a problem I
believe is in the section below.  The problem is, I can't seem to
understand what the IF conditions are saying here.  The problem I have
is with the second condition.  To me this reads in psudo code:

If( X and (if Y exists, then W otherwise Z))

Does this work?  If so how is it evaluated?

Here is the actual code.
code

if ($tostaf   ($reply-comment ? $config-send_comment_staf :
$config-send_emailreply_staf)) 
{
$to=array();
 
$vars[ticketurl]=$config-webpath.ticket.php?id=.$ticket-id;
if ($reply-comment) {
$condition= AND followups.employee'$reply-employee';
}

/code 

Thanks,

Jeff

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



  1   2   3   4   5   6   7   8   9   10   >