php-general Digest 27 Feb 2006 21:13:43 -0000 Issue 3988
Topics (messages 231127 through 231157):
Secure input
231127 by: emil.vanster.nu
231129 by: Greg Schnippel
231138 by: tedd
URL output query
231128 by: Chris
Re: RSS / XML
231130 by: John Nichel
Re: PHP Manual in PDF format
231131 by: John Nichel
classes and return values
231132 by: Jason Gerfen
231155 by: Jochem Maas
Re: Linux distributions and tools for Linux/Apache/PHP/MySQL dev
231133 by: John Nichel
231134 by: David Tulloh
231154 by: Curt Zirzow
Expiring other resources with HTTP headers
231135 by: William Lovaton
231136 by: Barry
231137 by: David Tulloh
231141 by: William Lovaton
231142 by: tedd
231143 by: William Lovaton
231148 by: William Lovaton
231149 by: Stut
231151 by: tedd
Sr. PHP Salary North Carolina
231139 by: Beau Gould
231145 by: Barry
231146 by: Beau Gould
231147 by: jblanchard.pocket.com
231150 by: John Nichel
Class calling Class returning 'object'
231140 by: Jason Gerfen
Optional pass-by-reference parameters?
231144 by: TomS
231156 by: Jochem Maas
move_uploaded_file and CPU wait state (IO)
231152 by: phpmaillist.skodric.com
231153 by: Aaron Koning
Strange slowdowns in PHP
231157 by: William Lovaton
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
php-general@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Hi,
What shall one do to avoid people that trys to manipulate my server?
I mysql_real_escape_string() all input from GET and POST.
A long time ago I think I used addslashes or something like that too, so people
couldn't insert php code in their input. Is that still something I should do,
or does mysql_real_escape_string() take care of that too? And is it even
possible for a user to execute there own php code if I not output the input via
the eval() function?
When users input is displayed for others then themself I try to filter out html
tags too.
Anything else I should think of?
Sorry if this has been asked a million times before. Thanks for your time
/Regards Emil
--- End Message ---
--- Begin Message ---
On 2/27/06 6:20 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> When users input is displayed for others then themself I try to filter out
> html tags too.
I type cast all relevant variables before processing them as one last check.
Type casting forces the variable to be of the type you expect. For example,
if you are expecting two integers: $id1 and $id2 but you get the following
user input:
$_GET["id1"] = 1234;
$_GET["id2"] = "evil hakor code";
if you type cast these as:
$id1 = (int)$_GET["id1"];
$id2 = (int)$_GET["id2"];
the output of print "$id1, $id2" would be:
1234, 0
Possible types you can use (not all relevant to $_GET):
(int), (integer) - cast to integer
(bool), (boolean) - cast to boolean
(float), (double), (real) - cast to float
(string) - cast to string
(array) - cast to array
(object) - cast to object
- schnippy
--- End Message ---
--- Begin Message ---
Hi,
What shall one do to avoid people that trys to manipulate my server?
I mysql_real_escape_string() all input from GET and POST.
A long time ago I think I used addslashes or something like that
too, so people couldn't insert php code in their input. Is that
still something I should do, or does mysql_real_escape_string() take
care of that too? And is it even possible for a user to execute
there own php code if I not output the input via the eval() function?
When users input is displayed for others then themself I try to
filter out html tags too.
Anything else I should think of?
Sorry if this has been asked a million times before. Thanks for your time
/Regards Emil
Emil:
I use the following as an include on all my form and cookie processing:
function stripFormSlashes($arr)
{
if (!is_array($arr))
{
return stripslashes($arr);
}
else
{
return array_map('stripFormSlashes', $arr);
}
}
if (get_magic_quotes_gpc())
{
$_GET = stripFormSlashes($_GET);
$_POST = stripFormSlashes($_POST);
}
If anyone see's a reason why I shouldn't, please clue me.
tedd
--
--------------------------------------------------------------------------------
http://sperling.com
--- End Message ---
--- Begin Message ---
Greetings PHP folks,
Which PHP function do I use if I want to achieve the following :
http://www.somesite.com/gallery/pics.php is the url...how do I get it to
read only http://www.somesite.com in the browser address bar without the
rest of the directory and filename appearing ?
Regards
--
Chris Blake
Cell: 082 775 1492
Work: +27 11 880 2825
Fax : +27 11 782 0841
Mail: [EMAIL PROTECTED]
I do not care if half the league strikes. Those who do will encounter
quick retribution. All will be suspended, and I don't care if it wrecks
the National League for five years. This is the United States of America
and one citizen has as much right to play as another. -- Ford Frick,
National League President, reacting to a threatened strike by some
Cardinal players in 1947 if Jackie Robinson took the field against St.
Louis. The Cardinals backed down and played.
--- End Message ---
--- Begin Message ---
Gustav Wiberg wrote:
Hi there guys!
Where is a good startpoint for learning XML Reader on a very, very basic
level? (I appreciate links)
Is RSS a technique for retrieving XML? I can't clue the pieces together...
/G
Please turn off your mail client's request for read receipts when
sending to a mailing list.
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
ÃmìtVërmå wrote:
<snip>
Please turn off your mail client's request for read receipts when
sending to a mailing list.
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I am attempting to work up a class and because I am unfamiliar with some
of the code flow I am only able to get a return value of 'object'. How
can I pull the data out of a class?
Any help, or pointers on what I am doing wrong is appreciated.
class myAuth
{
var $user;
var $pass;
var $lvl;
var $id;
function login( $user, $pass ) {
require 'templates/auth.tmplte.php';
global $defined, $error_message;
if( ( empty( $user ) ) || ( empty( $pass ) ) ) {
if( $_SESSION['count']++ >= 1 ) {
$errors = "<img src=\"images/error.jpg\"> <b>You need to
provide a user name and password!</b><br><br>";
}
$data = new myAuthTmplte();
$data->auth_template( 1, NULL, NULL, NULL, $errors );
logs( $error_message['str_chk'] );
}
}
}
--
Jason Gerfen
Student Computing Labs, University Of Utah
[EMAIL PROTECTED]
J. Willard Marriott Library
295 S 1500 E, Salt Lake City, UT 84112-0860
801-585-9810
"When asked what love is:
Love is the Jager talking."
~Craig Baldo
--- End Message ---
--- Begin Message ---
Jason Gerfen wrote:
I am attempting to work up a class and because I am unfamiliar with some
of the code flow I am only able to get a return value of 'object'. How
can I pull the data out of a class?
which data? It doesn't seem as if anyone knows what your trying to do.
(try to explain it again)
there is a difference between class and object - it's quite fundamental
to the whole OO concept.
<?
// the following is a [php4] class
class Test {
var $foo = "bar";
function getData() { return $this->foo; }
}
// $t is an object (assuming an error doesn't occur when instantiating it)
$t = new Test;
// this is an echo statement that outputs the return val from a method call
echo $t->getData(),"\n";
Any help, or pointers on what I am doing wrong is appreciated.
class myAuth
{
var $user;
var $pass;
var $lvl;
var $id;
function login( $user, $pass ) {
require 'templates/auth.tmplte.php';
global $defined, $error_message;
if( ( empty( $user ) ) || ( empty( $pass ) ) ) {
if( $_SESSION['count']++ >= 1 ) {
$errors = "<img src=\"images/error.jpg\"> <b>You need to
provide a user name and password!</b><br><br>";
}
$data = new myAuthTmplte();
$data->auth_template( 1, NULL, NULL, NULL, $errors );
logs( $error_message['str_chk'] );
}
}
}
--- End Message ---
--- Begin Message ---
Chris Lott wrote:
I'm making the switch from Windows to Linux for mydesktop and
development environment and would greatly appreciate suggestions for
development tools on this platform. Ubuntu seems to be getting all the
press, but suggestions about Linux distributions are welcome as well!
c
User preference. Find what you like. I'm a Red Hat guy, but really
only because that's the Linux version I cut my teeth on in '96. Over
the years, I've used vi, Quanta, Bluefish, Kate and Zend. Today I just
use Zend or vi.
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Curt Zirzow wrote:
> On Sat, Feb 25, 2006 at 01:41:06PM -0900, Chris Lott wrote:
>
>>I'm making the switch from Windows to Linux for mydesktop and
>>development environment and would greatly appreciate suggestions for
>>development tools on this platform. Ubuntu seems to be getting all the
>>press, but suggestions about Linux distributions are welcome as well!
>
Basically what everyone else has said... they all work basically the
same, it's just personal preference. I've tried a few and personally
find Debian the best, I run screaming from anything that uses rpms.
>
> Before I get into what distib to use there are a few things i'd
> like to point out:
>
> 1) Avoid using the packaging system the OS provides for the
> developement server. If you do, you will be under the control
> of the OS for your choice of versions of webserver, db server,
> php, or any dependency that is needed for those.
>
I would consider the above to be the worst advice you could possibly
give someone starting out in Linux land. The easiest, nastiest and most
confusing way to screw up your linux install is to start manually
installing packages. I killed my first install and nearly my second
before I learnt my lesson.
Dependancy hell is the reason why package management systems exist, to
compile php5 on a fairly clean debian install I would need to install
roughly 130 packages, there is no way that I'm going to try to do that
by hand.
When one of my friends starts using linux I give tell them to never do a
manual install. You stick with the packages supplied or go with
unofficial packages like debian backports.
Compiling packages has it's place, many of my computers have a manually
compiled PHP, but it's definantly not something to do on a first date.
I also use the package manager to get all the dependancies (apt-get
build-dep php5) and all the related programs such as apache and postgres.
David
--- End Message ---
--- Begin Message ---
On Tue, Feb 28, 2006 at 02:13:15AM +1100, David Tulloh wrote:
> Curt Zirzow wrote:
>
> >
> > Before I get into what distib to use there are a few things i'd
> > like to point out:
> >
> > 1) Avoid using the packaging system the OS provides for the
> > developement server. If you do, you will be under the control
> > of the OS for your choice of versions of webserver, db server,
> > php, or any dependency that is needed for those.
> >
>
> I would consider the above to be the worst advice you could possibly
> give someone starting out in Linux land. The easiest, nastiest and most
> confusing way to screw up your linux install is to start manually
> installing packages. I killed my first install and nearly my second
> before I learnt my lesson.
Yeah, i guess you're correct that this isn't very good advise. I
guess my point is more on the fact that you are limited on what
version of application you have available within the distros
package system.
>
> Dependancy hell is the reason why package management systems exist, to
> compile php5 on a fairly clean debian install I would need to install
> roughly 130 packages, there is no way that I'm going to try to do that
> by hand.
> ...
>
> Compiling packages has it's place, many of my computers have a manually
> compiled PHP, but it's definantly not something to do on a first date.
> I also use the package manager to get all the dependancies (apt-get
> build-dep php5) and all the related programs such as apache and postgres.
Very much agreed.
Thanks for this pointing out, i guess my mindset wasn't focused on
a new user of linux.
Curt.
--
cat .signature: No such file or directory
--- End Message ---
--- Begin Message ---
Hello everybody,
I write here to find out if this is possible:
I want to expire an static file in the web browser through an HTTP
header (Expires, Cache-Control or something else) sent from a PHP
program. The usual thing is that those headers apply only to the
program or file sending those headers, what I want is that a program
sends those headers to affect a different file in the browser cache.
In more detail, My web app generates a JavaScript file from the
information stored in the database, that file represents the user menu
and it is what the user sees in the web browser. Now, through an apache
directive I set expiration times for several kinds of static resources
so the web server doesn't get slash dotted with lots of unnecessary
requests (this is a web app with lots of traffic).
Although the JavaScript files are generated from PHP, it is seen as
static content from the web browser POV. Right now I have set the
expiration time for the menu files to 20 minutes. But let's say an
admin user change the permissions of a user and the affected user hits a
link that says "Regenerate menu". What will happen is that the
JavaScript file will be regenerated on the web server but there is a
chance that the browser won't see the change because the file is still
valid in the cache.
I know I could reduce the expiration time to reduce this problem but
most of the time those files do not change. What can I do to notify the
web browser that the file in the cache is no longer valid?
I hope there is enough information here and that somebody can give me a
hint in the right direction.
Thanks,
-William
--- End Message ---
--- Begin Message ---
William Lovaton wrote:
Hello everybody,
I write here to find out if this is possible:
I want to expire an static file in the web browser through an HTTP
header (Expires, Cache-Control or something else) sent from a PHP
program. The usual thing is that those headers apply only to the
program or file sending those headers, what I want is that a program
sends those headers to affect a different file in the browser cache.
In more detail, My web app generates a JavaScript file from the
information stored in the database, that file represents the user menu
and it is what the user sees in the web browser. Now, through an apache
directive I set expiration times for several kinds of static resources
so the web server doesn't get slash dotted with lots of unnecessary
requests (this is a web app with lots of traffic).
Although the JavaScript files are generated from PHP, it is seen as
static content from the web browser POV. Right now I have set the
expiration time for the menu files to 20 minutes. But let's say an
admin user change the permissions of a user and the affected user hits a
link that says "Regenerate menu". What will happen is that the
JavaScript file will be regenerated on the web server but there is a
chance that the browser won't see the change because the file is still
valid in the cache.
I know I could reduce the expiration time to reduce this problem but
most of the time those files do not change. What can I do to notify the
web browser that the file in the cache is no longer valid?
I hope there is enough information here and that somebody can give me a
hint in the right direction.
Thanks,
-William
Set the HTML expire to yesterday.
Therfore the browser will reload the whole page.
Barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--- End Message ---
--- Begin Message ---
I don't think you can expire another file, I would consider any ability
to do so a bug in the browser. Someone with too much time on their
hands could possibly turn something like that into a security risk.
I would solve the changing javascript problem by subtly altering the
pages that use the javascript file. A web browser will recognise
menu.js, menu.js?ver=1 and menu.js?ver=2 as different pages. You can
use this for your application by including menu.js?ver=$ver in each of
your pages. When the menu is modified and regenerated, increment $ver.
Every client will refetch menu.js as it views it as a different file.
David
William Lovaton wrote:
> Hello everybody,
>
> I write here to find out if this is possible:
>
> I want to expire an static file in the web browser through an HTTP
> header (Expires, Cache-Control or something else) sent from a PHP
> program. The usual thing is that those headers apply only to the
> program or file sending those headers, what I want is that a program
> sends those headers to affect a different file in the browser cache.
>
> In more detail, My web app generates a JavaScript file from the
> information stored in the database, that file represents the user menu
> and it is what the user sees in the web browser. Now, through an apache
> directive I set expiration times for several kinds of static resources
> so the web server doesn't get slash dotted with lots of unnecessary
> requests (this is a web app with lots of traffic).
>
> Although the JavaScript files are generated from PHP, it is seen as
> static content from the web browser POV. Right now I have set the
> expiration time for the menu files to 20 minutes. But let's say an
> admin user change the permissions of a user and the affected user hits a
> link that says "Regenerate menu". What will happen is that the
> JavaScript file will be regenerated on the web server but there is a
> chance that the browser won't see the change because the file is still
> valid in the cache.
>
> I know I could reduce the expiration time to reduce this problem but
> most of the time those files do not change. What can I do to notify the
> web browser that the file in the cache is no longer valid?
>
> I hope there is enough information here and that somebody can give me a
> hint in the right direction.
>
> Thanks,
>
> -William
>
--- End Message ---
--- Begin Message ---
Nice idea... thanks.
I agree with you that the ability to expire another file would be
somewhat risky but I fail to see how this could be exploited. May be
the browser should allow this kind of operations from pages coming from
the same server. But again, I don't think this is posible to begin
with, I just wanted to make sure about that.
Thanks again,
-William
El mar, 28-02-2006 a las 02:35 +1100, David Tulloh escribió:
> I don't think you can expire another file, I would consider any ability
> to do so a bug in the browser. Someone with too much time on their
> hands could possibly turn something like that into a security risk.
>
> I would solve the changing javascript problem by subtly altering the
> pages that use the javascript file. A web browser will recognise
> menu.js, menu.js?ver=1 and menu.js?ver=2 as different pages. You can
> use this for your application by including menu.js?ver=$ver in each of
> your pages. When the menu is modified and regenerated, increment $ver.
> Every client will refetch menu.js as it views it as a different file.
>
>
> David
>
> William Lovaton wrote:
> > Hello everybody,
> >
> > I write here to find out if this is possible:
> >
> > I want to expire an static file in the web browser through an HTTP
> > header (Expires, Cache-Control or something else) sent from a PHP
> > program. The usual thing is that those headers apply only to the
> > program or file sending those headers, what I want is that a program
> > sends those headers to affect a different file in the browser cache.
> >
> > In more detail, My web app generates a JavaScript file from the
> > information stored in the database, that file represents the user menu
> > and it is what the user sees in the web browser. Now, through an apache
> > directive I set expiration times for several kinds of static resources
> > so the web server doesn't get slash dotted with lots of unnecessary
> > requests (this is a web app with lots of traffic).
> >
> > Although the JavaScript files are generated from PHP, it is seen as
> > static content from the web browser POV. Right now I have set the
> > expiration time for the menu files to 20 minutes. But let's say an
> > admin user change the permissions of a user and the affected user hits a
> > link that says "Regenerate menu". What will happen is that the
> > JavaScript file will be regenerated on the web server but there is a
> > chance that the browser won't see the change because the file is still
> > valid in the cache.
> >
> > I know I could reduce the expiration time to reduce this problem but
> > most of the time those files do not change. What can I do to notify the
> > web browser that the file in the cache is no longer valid?
> >
> > I hope there is enough information here and that somebody can give me a
> > hint in the right direction.
> >
> > Thanks,
> >
> > -William
> >
>
--- End Message ---
--- Begin Message ---
I know I could reduce the expiration time to reduce this problem but
most of the time those files do not change. What can I do to notify the
web browser that the file in the cache is no longer valid?
-William
William:
Include this:
<?php # nocache.php
// this script prevents all caching
// expires on any past date
header ("Expires: Mon, 26 Jul 1997 05:00: GMT");
// last modified at current date and time
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
// for HTTP 1.1:
header ("Cache-Control: no-store, no-cache, must-revalidate");
header ("Cache-Control: post-check=0, pre-check=0", false);
// for HTTP 1.0
header ("Pragma: no-cache");
?>
HTH's
tedd
--
--------------------------------------------------------------------------------
http://sperling.com
--- End Message ---
--- Begin Message ---
El lun, 27-02-2006 a las 16:21 +0100, Barry escribió:
> Set the HTML expire to yesterday.
> Therfore the browser will reload the whole page.
>
> Barry
Hi Barry,
I don't think this would work, this should refresh the HTML page only
but the link pointing to the javascript file will be taken from the
cache I think.
-William
--- End Message ---
--- Begin Message ---
Hi Tedd,
That's not exactly what I am looking for. That would cause the
JavaScript file to be requested to the web server every single time. I
just want the browser to request the file only when it have been
modified on the server.
Let's say that by default, those JavaScript files expires every 4 hours
and that when a PHP program regenerates the file in the server it
should, somehow, notify the web browser that the file changed and that
it should request that file the next time it reloads the page or else
the user will be seeing an outdated menu.
I am almost sure this is not posible using HTTP headers. The only way I
see this could be achieved is by sending some random parameter to the JS
file so that the browser thinks it is a different file. This was
suggested by David Tulloh in a previous email.
Thanks again,
-William
El lun, 27-02-2006 a las 11:12 -0500, tedd escribió:
> >I know I could reduce the expiration time to reduce this problem but
> >most of the time those files do not change. What can I do to notify the
> >web browser that the file in the cache is no longer valid?
> >
> >-William
>
> William:
>
> Include this:
>
> <?php # nocache.php
> // this script prevents all caching
>
> // expires on any past date
> header ("Expires: Mon, 26 Jul 1997 05:00: GMT");
>
> // last modified at current date and time
> header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
>
> // for HTTP 1.1:
> header ("Cache-Control: no-store, no-cache, must-revalidate");
> header ("Cache-Control: post-check=0, pre-check=0", false);
>
> // for HTTP 1.0
> header ("Pragma: no-cache");
> ?>
>
> HTH's
>
> tedd
> --
> --------------------------------------------------------------------------------
> http://sperling.com
>
--- End Message ---
--- Begin Message ---
William Lovaton wrote:
Let's say that by default, those JavaScript files expires every 4 hours
and that when a PHP program regenerates the file in the server it
should, somehow, notify the web browser that the file changed and that
it should request that file the next time it reloads the page or else
the user will be seeing an outdated menu.
I am almost sure this is not posible using HTTP headers. The only way I
see this could be achieved is by sending some random parameter to the JS
file so that the browser thinks it is a different file. This was
suggested by David Tulloh in a previous email.
The best way I've found to do this is to put the file modification time
in the querystring for the JS file. Set the expiry for that file to 365
days (or whatever) using Apache. That way you don't need to do anything
when you update the JS file for it to be rolled out and the only cost
per request is looking up the file modification time.
Another way to do it is to store the version number actually in the JS
filename itself. This would have the added benefit of being able to
quickly rollback to a previous version if needed.
Hope that helps.
-Stut
--- End Message ---
--- Begin Message ---
William said:
That's not exactly what I am looking for. That would cause the
JavaScript file to be requested to the web server every single time. I
just want the browser to request the file only when it have been
modified on the server.
Let's say that by default, those JavaScript files expires every 4 hours
and that when a PHP program regenerates the file in the server it
should, somehow, notify the web browser that the file changed and that
it should request that file the next time it reloads the page or else
the user will be seeing an outdated menu.
I am almost sure this is not posible using HTTP headers. The only way I
see this could be achieved is by sending some random parameter to the JS
file so that the browser thinks it is a different file. This was
suggested by David Tulloh in a previous email.
William:
I may not understand what you're trying to do -- but, perhaps using
something like:
<?php echo "Last modified: " . date ("F d Y H:i:s.", getlastmod());?>
In concert with what I suggested might work.
tedd
ps: your email address has generated a couple of bounced blog stuff thus far.
> William:
Include this:
<?php # nocache.php
// this script prevents all caching
// expires on any past date
header ("Expires: Mon, 26 Jul 1997 05:00: GMT");
// last modified at current date and time
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
// for HTTP 1.1:
header ("Cache-Control: no-store, no-cache, must-revalidate");
header ("Cache-Control: post-check=0, pre-check=0", false);
// for HTTP 1.0
header ("Pragma: no-cache");
?>
HTH's
tedd
--
--------------------------------------------------------------------------------
http://sperling.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
--------------------------------------------------------------------------------
http://sperling.com
--- End Message ---
--- Begin Message ---
Can anyone possibly tell me what the salary range is for a Sr. PHP/MySQL
Developer in North Carolina?
Thanks
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.1.0/269 - Release Date: 2/24/2006
--- End Message ---
--- Begin Message ---
Beau Gould wrote:
Can anyone possibly tell me what the salary range is for a Sr. PHP/MySQL Developer in North Carolina?
Thanks
Depends on the workspace and what kind of work somone has to do.
Is it a monitoring position, or a leading one.
More infos would probably help though.
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--- End Message ---
--- Begin Message ---
No I haven't. Thanks for the lead.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, February 27, 2006 11:18 AM
To: [EMAIL PROTECTED]; php-general@lists.php.net
Subject: RE: [PHP] Sr. PHP Salary North Carolina
[snip]
Can anyone possibly tell me what the salary range is for a Sr. PHP/MySQL
Developer in North Carolina? [/snip]
Have you tried looking at salary.com ?
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.1.0/269 - Release Date: 2/24/2006
--- End Message ---
--- Begin Message ---
[snip]
Can anyone possibly tell me what the salary range is for a Sr. PHP/MySQL
Developer in North Carolina? [/snip]
Have you tried looking at salary.com ?
--- End Message ---
--- Begin Message ---
Beau Gould wrote:
Can anyone possibly tell me what the salary range is for a Sr. PHP/MySQL Developer in North Carolina?
Thanks
http://wwww.salary.com
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I am in need of some assistance working with classes. I have a function
(X) which calls a class (A), that class calls another class (B) and
returns the results. At this point I think I am doing everything
correctly within' class A because if I echo the results of Class A
calling Class B the data is displayed. However, when I use 'return
$data' from function X (ex. $data = $ClassA->function( $var1, $var2 );
) the word 'object' is being displayed in the browser.
Here is the code; any help, tips, pointers is appreciated.
// function 'chooser' calls class 'myAuth' and returns $data
function chooser( $level, $page, $user, $pass ) {
if( $page == "auth" ) {
require 'auth.inc.php';
$data = new myAuth;
$data = $data->login( $_POST['user'], $_POST['pass'] );
} else {
$data = "error";
}
return $data;
}
// myAuth class
class myAuth
{
var $data;
function login( $user, $pass ) {
if( ( empty( $user ) ) || ( empty( $pass ) ) ) {
$data = new myAuthTmplte();
$data = $data->AuthTemplate( 1, NULL, NULL, NULL, $errors );
} else {
$data = "error";
}
return $data; // If I do echo $data I can see the results of calling
the myAuthTmplte Class
}
// myAuthTmplte class
class myAuthTmplte
{
var $data;
function AuthTemplate( $cmd, $args, $num, $message, $errors ) {
$data = "I should be seeing this text right here"; // This data should
be displayed but I am only seeing the word 'object' in the browser
return $data;
}
--
Jason Gerfen
"When asked what love is:
Love is the Jager talking."
~Craig Baldo
--- End Message ---
--- Begin Message ---
I would like to have an optional pass-by-reference. i.e. you can call the
function w/o the variable. Basically, like how you don't need to pass
$matches to the preg_match function. I've tried, function some_func(&$var =
null) and this doesn't work. func_get_args only gets copies, does anyone
have any other solutions?
--- End Message ---
--- Begin Message ---
TomS wrote:
I would like to have an optional pass-by-reference. i.e. you can call the
function w/o the variable. Basically, like how you don't need to pass
$matches to the preg_match function. I've tried, function some_func(&$var =
null) and this doesn't work. func_get_args only gets copies, does anyone
have any other solutions?
use php5. the following is from a method that has worked since php5beta3:
static function findRange(
$className,
$order = null,
$first = null,
$skip = null,
$f = null,
&$totalcount = null,
$trans = false,
$autocommit = false,
$minimal = false) { /**/ }
--- End Message ---
--- Begin Message ---
Hi,
My first mailing, if I'm in wrong group or such, let me know ;)
Here comes my question. I have implemented file uploads to my server. At the
end of upload, file is
beeing moved from /tmp to permanent directory. However, whenever this happens,
CPU goes berzerk and
waits for disk to finish moving file. As allowed files may be up to 100 MB per
file, having more
then 3 users makes complete server freeze. Meantime, server load reaches
skyhigh 40+. After file is
moved, server resumes normal operation, however while moving file server is
completely not
responding.
Is there a work around? I am not so good with linux (yet ^^), so I do not know
if there is place
for improvement on OS itself. I asked this question on Debian forum, but am
trying here as well.
If someone has same problem and prefferably solution, or even sugestions - all
is welcome! :)
Server P4 2.0
512 MB RAM (will be 2 GB by the end of the week)
2 x 80 GB IDE HDD
Thank you!
Regards,
Aleksandar
--- End Message ---
--- Begin Message ---
Are you sure its the move_uploaded_file() function that is causing the
delay? It could be the actual upload of the file itself. If it is the
function causing the delay than try the rename() function instead. Also, I
have used the copy() and unlink() functions and they work fast.
Aaron
On 2/27/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> My first mailing, if I'm in wrong group or such, let me know ;)
>
> Here comes my question. I have implemented file uploads to my server. At
> the end of upload, file is
> beeing moved from /tmp to permanent directory. However, whenever this
> happens, CPU goes berzerk and
> waits for disk to finish moving file. As allowed files may be up to 100 MB
> per file, having more
> then 3 users makes complete server freeze. Meantime, server load reaches
> skyhigh 40+. After file is
> moved, server resumes normal operation, however while moving file server
> is completely not
> responding.
>
> Is there a work around? I am not so good with linux (yet ^^), so I do not
> know if there is place
> for improvement on OS itself. I asked this question on Debian forum, but
> am trying here as well.
>
> If someone has same problem and prefferably solution, or even sugestions -
> all is welcome! :)
>
> Server P4 2.0
> 512 MB RAM (will be 2 GB by the end of the week)
> 2 x 80 GB IDE HDD
>
> Thank you!
>
> Regards,
> Aleksandar
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
+--------------------------------------------
| Aaron Koning
| Information Technologist
| Prince George, BC, Canada.
+--------------------------------------------
| http://datashare.gis.unbc.ca/fist/
| http://datashare.gis.unbc.ca/gctp-js/
+--------------------------------------------
--- End Message ---
--- Begin Message ---
Hi there,
I just setted up some changes to the Apache configuration and made some
programming in PHP to log a request (and information about that request)
when it is taking a lot of time to finish (let's say > 20 secs). In the
logs, there have been lots of useful information and I already improved
the performance on several pages, specially related to database queries.
But from time to time there are pages in the log that shouldn't be slow
but still they take 20 or 30 secs to complete.
The strategy I used is the following:
1. Configure Apache to register the request time in the request headers
RequestHeader set requestTime %t
2. Create a function an register it with register_shutdown_function() so
it is executed after PHP ends the execution of every script.
3. This function will take the requestTime and calculate the difference
with the current time (time stamp).
4. If the difference (execution time) is less than 20 seconds it exits
normally, else, it logs the information about this request in a file.
5. The registered information includes: $_REQUEST data and $_SESSION
data at the time of execution. And finally a profile of some critical
functions. This functions are often the ones that goes to the database
and they are likely to be slow.
The page I am talking about doesn't execute any database query. It just
generates an image from the data that is stored in the session. I
however, profile some function that are not database queries but they
are the only "critical" path in the script.
Looking at the log I get the following information:
- Execution time: 29.3 secs
- Request started at: 11:08:06 AM
- Request ended at: 11:08:35 AM
- The functions that got executed were (time, class::method, duration):
- 11:08:06, GraficoMaterno::alturaUterina, 0.009499
- 11:08:06, GraficoAlturaUterina::session_start, 0.001259
- 11:08:06, GraficoAlturaUterina::session_write_close, 0.001613
- 11:08:06, GraficoAlturaUterina::sendImage, 0.029186
The last record in the profile (GraficoAlturaUterina::sendImage)
corresponds to the last couple of lines of code in the script which are:
imagepng($image);
imagedestroy($image);
As you can see they took only 0.029186 seconds which is very fast. the
other thing that you can see in the profile is that the last line of
code got executed exactly in the very same second in which the request
started. This means that the script is very fast and that something is
taking a lot of time after the last line of execution.
Note that I open and close the user session to update some data in a
safe manner that might be being accessed at the same time by other
apache processes. And as you can see it is very fast too... that was
the only suspect I had. :(
Finally, I don't think this is a problem of the function that logs the
execution time and that is executed automatically at shutdown. I was
seeing the sporadic slowdown even before implementing this
instrumentation and the function implementation is so simple that it is
very unlikely that the delay is in there.
For further information I am using PHP 4.3.11 and Apache 2, all of them
are official packages from a Fedora Core 3 system with the latest
updates. Is there a known bug in PHP that might be causing this
sporadic slowdowns? In general our web app is very fast but this are
the corner cases.
Any ideas about this?
Thanks in advance,
-William
--- End Message ---