php-general Digest 13 Sep 2010 21:09:36 -0000 Issue 6939
Topics (messages 308014 through 308034):
Re: Standalone WebServer for PHP
308014 by: Dotan Cohen
308021 by: Steve Staples
308032 by: Bostjan Skufca
Re: 1984 (Big Brother)
308015 by: kranthi
308019 by: Richard Quadling
308022 by: Steve Staples
308023 by: Ashley Sheridan
308024 by: tedd
308025 by: tedd
308026 by: Bob McConnell
308027 by: Bob McConnell
308028 by: viraj
308029 by: Marc Guay
308030 by: tedd
308031 by: Paul M Foster
308034 by: Daevid Vincent
Counting Children!
308016 by: Sridhar Pandurangiah
Re: New to PHP and the list
308017 by: kranthi
Re: Disabling an extension on a perdir basis.
308018 by: Richard Quadling
Joke [WAS: Counting Children!]
308020 by: Michelle Konzack
Re: php cli question
308033 by: J Ravi Menon
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:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
On Sun, Sep 12, 2010 at 20:07, tedd <[email protected]> wrote:
> Forget modems or other such outside access -- everything would be done
> internally with computers and users being physically located within the
> office's physical location.
>
> So, could a server be set up in an office that would run web-languages such
> that users in the office could access their server and run scripts using
> browsers?
>
Just connect them to a router and don't connect the router to the WAN.
Each machine will get it's own IP address (assuming that the router is
running a DHCP server).
--
Dotan Cohen
http://gibberish.co.il
http://what-is-what.com
--- End Message ---
--- Begin Message ---
Wow... this thread SURE went WAY off my original topic...
All I was looking for, was a "webserver" that would serve "PHP" pages,
that was not "installed" on the machine. Now, if the machine was *nix
or Windose, it didn't matter.
I know in Python, you just have to install python, and then you can use
Cherrypy (but i dont know python, nor do i want to create the app i am
creating with a language i dont full know/understand).
Anyway, I spent a bit of time on the interwebs this weekend, and after
trying just about every one i could find, I am just going to go with
XAMPP, and remove all the stuff i dont need, and trim some fat, and
remove all the hard links to the /opt/lampp directory in linux, and
figure out what it is in windose later...
anyway, thanks for all the ideas.
Steve.
On Sun, 2010-09-12 at 22:37 -0400, Paul M Foster wrote:
> On Sun, Sep 12, 2010 at 02:07:12PM -0400, tedd wrote:
>
> > At 1:47 PM -0400 9/12/10, Jason Pruim wrote:
> > >>On Sep 12, 2010, at 1:33 PM, tedd wrote:
> > >>So, can I do what I do (i.e., programming) without having a host?
> > >>Can I install a local server at my clients location and interface
> > >>all their computers to use the server without them ever being
> > >>connected to the Internet?
> > >
> > >I may not know all the possibilities but the only way I can think of
> > >to accomplish that would be to have a server setup in their office
> > >with a bank of modems and have everyone call into the server.
> > >Basically like an old school internet provider.
> > >
> > >If the main server can be secured to your clients liking there are
> > >ways that it can be on the net and still as safe as possible... But
> > >obviously not as safe as hard lines being dialed in...
> > >
> > >You'ld also have to take into account possibly long distance charges
> > >if everyone wasn't local...
> >
> > Forget modems or other such outside access -- everything would be
> > done internally with computers and users being physically located
> > within the office's physical location.
> >
> > So, could a server be set up in an office that would run
> > web-languages such that users in the office could access their server
> > and run scripts using browsers?
>
> I just think I couldn't possibly be fully understanding what you're
> asking. But in case I *do* understand it, it would be like this:
>
> Set up a switch in the server room and connect everyone to it. Connect
> the switch to the internal webserver. Give the webserver an internal
> (non-routable) IP and hostname. Anyone can access it via
> http://internal_hostname/my_script.php
>
> No one outside the LAN can access it, something you can enforce with
> Apache or with iptables (Linux).
>
> I have one of these set up in my house/office.
>
> Hope this helps.
>
> Paul
>
> --
> Paul M. Foster
>
--- End Message ---
--- Begin Message ---
I would recommend using nanoserv, it looks more mature.
But personally I use my own, which I have developed because I wanted to know
how to do it. And because I needed it to do some specific tasks on linux
servers which I did not want to mix with apache configuration etc. Here:
http://github.com/bostjan/PHP-application-server
b.
On 13 September 2010 14:47, Steve Staples <[email protected]> wrote:
> Wow... this thread SURE went WAY off my original topic...
>
>
> All I was looking for, was a "webserver" that would serve "PHP" pages,
> that was not "installed" on the machine. Now, if the machine was *nix
> or Windose, it didn't matter.
>
> I know in Python, you just have to install python, and then you can use
> Cherrypy (but i dont know python, nor do i want to create the app i am
> creating with a language i dont full know/understand).
>
> Anyway, I spent a bit of time on the interwebs this weekend, and after
> trying just about every one i could find, I am just going to go with
> XAMPP, and remove all the stuff i dont need, and trim some fat, and
> remove all the hard links to the /opt/lampp directory in linux, and
> figure out what it is in windose later...
>
> anyway, thanks for all the ideas.
>
> Steve.
>
>
> On Sun, 2010-09-12 at 22:37 -0400, Paul M Foster wrote:
> > On Sun, Sep 12, 2010 at 02:07:12PM -0400, tedd wrote:
> >
> > > At 1:47 PM -0400 9/12/10, Jason Pruim wrote:
> > > >>On Sep 12, 2010, at 1:33 PM, tedd wrote:
> > > >>So, can I do what I do (i.e., programming) without having a host?
> > > >>Can I install a local server at my clients location and interface
> > > >>all their computers to use the server without them ever being
> > > >>connected to the Internet?
> > > >
> > > >I may not know all the possibilities but the only way I can think of
> > > >to accomplish that would be to have a server setup in their office
> > > >with a bank of modems and have everyone call into the server.
> > > >Basically like an old school internet provider.
> > > >
> > > >If the main server can be secured to your clients liking there are
> > > >ways that it can be on the net and still as safe as possible... But
> > > >obviously not as safe as hard lines being dialed in...
> > > >
> > > >You'ld also have to take into account possibly long distance charges
> > > >if everyone wasn't local...
> > >
> > > Forget modems or other such outside access -- everything would be
> > > done internally with computers and users being physically located
> > > within the office's physical location.
> > >
> > > So, could a server be set up in an office that would run
> > > web-languages such that users in the office could access their server
> > > and run scripts using browsers?
> >
> > I just think I couldn't possibly be fully understanding what you're
> > asking. But in case I *do* understand it, it would be like this:
> >
> > Set up a switch in the server room and connect everyone to it. Connect
> > the switch to the internal webserver. Give the webserver an internal
> > (non-routable) IP and hostname. Anyone can access it via
> > http://internal_hostname/my_script.php
> >
> > No one outside the LAN can access it, something you can enforce with
> > Apache or with iptables (Linux).
> >
> > I have one of these set up in my house/office.
> >
> > Hope this helps.
> >
> > Paul
> >
> > --
> > Paul M. Foster
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
i m not sure if i usderstood your question completely.
by database you mean something like phpmyadmin, right ?
i would save the latest session id of the boss in a file, and every
time an employee tries to log in, verify the time stamp of the session
file in the tmp folder.
and if the boss logs out... clear off the tmp folder to ensure that
the employees dosent have further access.
--- End Message ---
--- Begin Message ---
On 12 September 2010 17:32, tedd <[email protected]> wrote:
> Hi gang:
>
> I have a client who wants his employees' access to their online business
> database restricted to only times when he is logged on. (Don't ask why)
>
> In other words, when the boss is not logged on, then his employees cannot
> access the business database in any fashion whatsoever including checking to
> see if the boss is logged on, or not. No access whatsoever!
>
> Normally, I would just set up a field in the database and have that set to
> "yes" or "no" as to if the employees could access the database, or not. But
> in this case, the boss does not want even that type of access to the
> database permitted. Repeat -- No access whatsoever!
>
> I was thinking of the boss' script writing to a file that accomplished the
> "yes" or "no" thing, but if the boss did not log off properly then the file
> would remain in the "yes" state allowing employees undesired access. That
> would not be acceptable.
>
> So, what methods would you suggest?
>
> Cheers,
>
> tedd
What operating system is he using?
Does he (for example), log into his computer and logoff/shutdown when
he goes home?
If he is using Windows (and I'm sure there are many ways to achieve
this), then in the Startup folder, a small PHP script which sets a
flag "I'm here", would allow the DB to know he's at least logged in.
There are different ways to do this.
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_21195727.html
covers login/logout/startup/shutdown.
Do they have a clock card system for clocking in/out the building?
Could you read the database that the clockings are logged in? An odd
number for the day = he's in, even = he's out, missed clocking =
screwed/guess.
Ideally you want to "hook" into his normal activity if you can.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--- End Message ---
--- Begin Message ---
here's a silly idea...
put the database on his computer (or the entire app). that way, when
he's *there* he is logged in. if the computer is off, he's not there,
the app wont work (and the database).
Steve
On Mon, 2010-09-13 at 11:26 +0100, Richard Quadling wrote:
> On 12 September 2010 17:32, tedd <[email protected]> wrote:
> > Hi gang:
> >
> > I have a client who wants his employees' access to their online business
> > database restricted to only times when he is logged on. (Don't ask why)
> >
> > In other words, when the boss is not logged on, then his employees cannot
> > access the business database in any fashion whatsoever including checking to
> > see if the boss is logged on, or not. No access whatsoever!
> >
> > Normally, I would just set up a field in the database and have that set to
> > "yes" or "no" as to if the employees could access the database, or not. But
> > in this case, the boss does not want even that type of access to the
> > database permitted. Repeat -- No access whatsoever!
> >
> > I was thinking of the boss' script writing to a file that accomplished the
> > "yes" or "no" thing, but if the boss did not log off properly then the file
> > would remain in the "yes" state allowing employees undesired access. That
> > would not be acceptable.
> >
> > So, what methods would you suggest?
> >
> > Cheers,
> >
> > tedd
>
> What operating system is he using?
>
> Does he (for example), log into his computer and logoff/shutdown when
> he goes home?
>
> If he is using Windows (and I'm sure there are many ways to achieve
> this), then in the Startup folder, a small PHP script which sets a
> flag "I'm here", would allow the DB to know he's at least logged in.
>
> There are different ways to do this.
> http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_21195727.html
> covers login/logout/startup/shutdown.
>
>
> Do they have a clock card system for clocking in/out the building?
> Could you read the database that the clockings are logged in? An odd
> number for the day = he's in, even = he's out, missed clocking =
> screwed/guess.
>
> Ideally you want to "hook" into his normal activity if you can.
>
>
>
> --
> Richard Quadling
> Twitter : EE : Zend
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>
--- End Message ---
--- Begin Message ---
On Mon, 2010-09-13 at 09:10 -0400, Steve Staples wrote:
> here's a silly idea...
>
> put the database on his computer (or the entire app). that way, when
> he's *there* he is logged in. if the computer is off, he's not there,
> the app wont work (and the database).
>
> Steve
>
>
>
> On Mon, 2010-09-13 at 11:26 +0100, Richard Quadling wrote:
> > On 12 September 2010 17:32, tedd <[email protected]> wrote:
> > > Hi gang:
> > >
> > > I have a client who wants his employees' access to their online business
> > > database restricted to only times when he is logged on. (Don't ask why)
> > >
> > > In other words, when the boss is not logged on, then his employees cannot
> > > access the business database in any fashion whatsoever including checking
> > > to
> > > see if the boss is logged on, or not. No access whatsoever!
> > >
> > > Normally, I would just set up a field in the database and have that set to
> > > "yes" or "no" as to if the employees could access the database, or not.
> > > But
> > > in this case, the boss does not want even that type of access to the
> > > database permitted. Repeat -- No access whatsoever!
> > >
> > > I was thinking of the boss' script writing to a file that accomplished the
> > > "yes" or "no" thing, but if the boss did not log off properly then the
> > > file
> > > would remain in the "yes" state allowing employees undesired access. That
> > > would not be acceptable.
> > >
> > > So, what methods would you suggest?
> > >
> > > Cheers,
> > >
> > > tedd
> >
> > What operating system is he using?
> >
> > Does he (for example), log into his computer and logoff/shutdown when
> > he goes home?
> >
> > If he is using Windows (and I'm sure there are many ways to achieve
> > this), then in the Startup folder, a small PHP script which sets a
> > flag "I'm here", would allow the DB to know he's at least logged in.
> >
> > There are different ways to do this.
> > http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_21195727.html
> > covers login/logout/startup/shutdown.
> >
> >
> > Do they have a clock card system for clocking in/out the building?
> > Could you read the database that the clockings are logged in? An odd
> > number for the day = he's in, even = he's out, missed clocking =
> > screwed/guess.
> >
> > Ideally you want to "hook" into his normal activity if you can.
> >
> >
> >
> > --
> > Richard Quadling
> > Twitter : EE : Zend
> > @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
> >
>
>
>
That's a genius idea!
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
At 9:10 AM -0400 9/13/10, Steve Staples wrote:
here's a silly idea...
put the database on his computer (or the entire app). that way, when
he's *there* he is logged in. if the computer is off, he's not there,
the app wont work (and the database).
Steve
Silly or not, that *would* work.
Now I have to figure out how to do that.
Thanks,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
At 11:55 PM -0400 9/12/10, Paul M Foster wrote:
I hate to seem flippant, but here would be my conversation with this
customer:
Customer: "My employees got access to the database while I was gone
yesterday!"
Consultant: "Well, let's see. Oh, it appears you didn't properly log
out."
Customer: "Yes, but I was *gone*. They weren't supposed to be able to
access the database unless I'm *here*."
Consultant: "The only way we know that is if you log in and log out
properly. Now, if you like, we can put a nanny-cam in your office, and
whenever you're not there (like in the bathroom), the whole thing shuts
down. That will cost $x. Your choice. We've been working on the
mind-reading extension to PHP, but it's not finished yet."
Customer: Thanks for your opinion. We'll be in touch.
Customer to his secretary: Let's find someone who knows how to do this.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
From: tedd
> At 9:10 AM -0400 9/13/10, Steve Staples wrote:
>>here's a silly idea...
>>
>>put the database on his computer (or the entire app). that way, when
>>he's *there* he is logged in. if the computer is off, he's not there,
>>the app wont work (and the database).
>
> Silly or not, that *would* work.
>
> Now I have to figure out how to do that.
This may be the only way to do it, but it shouldn't be too hard to
figure out. If he turns off the computer every time he leaves his desk,
it can be installed anywhere, even as a service. But if he leaves the
computer on, it has to be on his desktop, probably with an entry in his
Start directory to start it when he logs in. But he has to actually log
out of the desktop to block access, not just leave it in the screen
saver.
Bob McConnell
--- End Message ---
--- Begin Message ---
From: tedd
> At 11:55 PM -0400 9/12/10, Paul M Foster wrote:
>>
>>I hate to seem flippant, but here would be my conversation with this
>>customer:
>>
>>Customer: "My employees got access to the database while I was gone
>>yesterday!"
>>
>>Consultant: "Well, let's see. Oh, it appears you didn't properly log
>>out."
>>
>>Customer: "Yes, but I was *gone*. They weren't supposed to be able to
>>access the database unless I'm *here*."
>>
>>Consultant: "The only way we know that is if you log in and log out
>>properly. Now, if you like, we can put a nanny-cam in your office, and
>>whenever you're not there (like in the bathroom), the whole thing
shuts
>>down. That will cost $x. Your choice. We've been working on the
>>mind-reading extension to PHP, but it's not finished yet."
>
> Customer: Thanks for your opinion. We'll be in touch.
>
> Customer to his secretary: Let's find someone who knows how to do
this.
Anybody that tells him it can be done is lying through their teeth and
will just be stealing his money. He probably deserves what he gets in
this case.
Bob McConnell
--- End Message ---
--- Begin Message ---
hi tedd,
if steve's idea is something doable.. why don't you consider setting
up the mysql data dir on some removable media (thumb/flash drive)?
so the boss can pull it off if he is going home. and it's easy to
detect this in code and display a message to system users, something
similar to that 'mysql server has gone away' message. (boss has gone
away) :)
~viraj
On Mon, Sep 13, 2010 at 7:13 PM, Bob McConnell <[email protected]> wrote:
> From: tedd
>
>> At 9:10 AM -0400 9/13/10, Steve Staples wrote:
>>>here's a silly idea...
>>>
>>>put the database on his computer (or the entire app). that way, when
>>>he's *there* he is logged in. if the computer is off, he's not there,
>>>the app wont work (and the database).
>>
>> Silly or not, that *would* work.
>>
>> Now I have to figure out how to do that.
>
> This may be the only way to do it, but it shouldn't be too hard to
> figure out. If he turns off the computer every time he leaves his desk,
> it can be installed anywhere, even as a service. But if he leaves the
> computer on, it has to be on his desktop, probably with an entry in his
> Start directory to start it when he logs in. But he has to actually log
> out of the desktop to block access, not just leave it in the screen
> saver.
>
> Bob McConnell
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
> if steve's idea is something doable.. why don't you consider setting
> up the mysql data dir on some removable media (thumb/flash drive)?
It seems to me that almost no matter what method you choose, you're
going to have to ask the client to do something manually - whether
that's logging out of the website, shutting down his computer,
removing a thumb drive, or whatever - so you might as well be upfront
about that and see how he responds. Provide the different options and
get them to choose one, at some point they'll need to take a bit of
personal responsibility for the management of this paranoid system.
Marc
--- End Message ---
--- Begin Message ---
At 12:39 PM -0400 9/13/10, Marc Guay wrote:
> if steve's idea is something doable.. why don't you consider setting
up the mysql data dir on some removable media (thumb/flash drive)?
It seems to me that almost no matter what method you choose, you're
going to have to ask the client to do something manually - whether
that's logging out of the website, shutting down his computer,
removing a thumb drive, or whatever - so you might as well be upfront
about that and see how he responds. Provide the different options and
get them to choose one, at some point they'll need to take a bit of
personal responsibility for the management of this paranoid system.
Marc
Marc:
What everyone has suggested, I have done. But the decision remains
the client's.
When I get rich enough to hire myself, then I'll tell myself what to
do. Until then, I'm just a worker bee and follow the hive.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
On Mon, Sep 13, 2010 at 12:47:24PM -0400, tedd wrote:
<snip>
> When I get rich enough to hire myself, then I'll tell myself what to
> do. Until then, I'm just a worker bee and follow the hive.
Oh, heck, you don't have to wait that long. We'll tell you what to do
for *free*! ;-}
Paul
--
Paul M. Foster
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: tedd [mailto:[email protected]]
> Sent: Sunday, September 12, 2010 9:32 AM
> To: PHP-General list
> Subject: [PHP] 1984 (Big Brother)
>
> Hi gang:
>
> I have a client who wants his employees' access to their online
> business database restricted to only times when he is logged on.
> (Don't ask why)
>
> In other words, when the boss is not logged on, then his employees
> cannot access the business database in any fashion whatsoever
> including checking to see if the boss is logged on, or not. No access
> whatsoever!
>
> Normally, I would just set up a field in the database and have that
> set to "yes" or "no" as to if the employees could access the
> database, or not. But in this case, the boss does not want even that
> type of access to the database permitted. Repeat -- No access
> whatsoever!
>
> I was thinking of the boss' script writing to a file that
> accomplished the "yes" or "no" thing, but if the boss did not log off
> properly then the file would remain in the "yes" state allowing
> employees undesired access. That would not be acceptable.
>
> So, what methods would you suggest?
>
> Cheers,
>
> tedd
You sure know how to pick'em Tedd.
This is the second "whacky" client you've posted about on the list...
This guy sounds like a real control-freak (read: tool).
One other thing I'll throw out is the use of a crontab to start/stop mysql
during "boss's hours". I don't have a complete solution for you as I just
don't care enough about helping this Dbag lord over his employees like
that, but I suspect you could have "/etc/init.d/mysql start" or "stop" at
some pre-determined times like 8am - noon. Then noon till 5pm. Or
something.
RDBMS are not really designed to be turned on and off like that.
Another option is to maybe use M$ Access instead (which does have a
multi-user mode). Use ODBC to connect via PHP to it. So then he would start
up the DB when he likes and shut it down when he likes. (note that a logout
of Windows will NOT prevent the ODBC connection as it is a service -- as
God intended RDBMS to be)
http://www.configure-all.com/php_access.php
This guy is making me angry just thinking about it!
d
--- End Message ---
--- Begin Message ---
Hi
I have an XML generated by another computer application. The format is
as below. (Don't worry about the data in the XML. Its the test
data).
I am able to locate the correct member bill using XPATH.
However I have hit a bottleneck. I am unable to echo all the <line>
elements. This is what happens
$row = simplexml_load_string($member->asXML());
echo $line->particular1;
echo $line->amount1;
echo $line->particular2;
echo $line->amount2;
Echoes the first <line> element of the member bill. If I add the same
set of statements it echoes the second <line> element and so on. But
then if I put the following code which I feel is correct
$row = simplexml_load_string($member->asXML());
foreach ($row->line as $line);
{
echo $line->particular1;
echo $line->amount1;
echo $line->particular2;
echo $line->amount2;
}
Echoes only the last <line> element of the member. Can someone tell me
what's wrong
-----------------The XML file
-------------------------------------------------
<bill>
<clubname>The Great Eastern Club</clubname>
<address>Anna Road</address>
<city>Madras</city>
<title>BILL</title>
<member>
<membernumber>A00000099</membernumber>
<billnumber>Bill no. : A00000099/APRIL 10</billnumber>
<membername>Raman C V</membername>
<billdate>Run date : 03/05/2010</billdate>
<memberaddress1>NO 33,MUGAPPAIR ROAD,</memberaddress1>
<memberaddress2>PADI,</memberaddress2>
<membercity>CHENNAI</membercity>
<memberpostalcode>600032</memberpostalcode>
<memberphonenumber>9840012345</memberphonenumber>
<preface>STATEMENT OF ACCOUNTS AND BILL FOR THE MONTH OF
APRIL-2010</preface>
<columnh1>Particulars</columnh1>
<columnh2>Debit</columnh2>
<columnh3>Receivables</columnh3>
<columnh4>Credit</columnh4>
<line>
<particular1>Opening Balance</particular1>
<amount1>275.14</amount1>
<particular2>-</particular2>
<amount2>0.00</amount2>
</line>
<line>
<particular1>CHARGES</particular1>
<amount1>33.09</amount1>
</line>
<line>
<particular1>MINIMUM USAGE</particular1>
<amount1>220.60</amount1>
</line>
<line>
<particular1>SUBSCRIPTION CHARGES</particular1>
<amount1>220.60</amount1>
</line>
<line>
<particular1>WATER CHARGE</particular1>
<amount1>22.06</amount1>
</line>
<line>
<particular1>Total Debit</particular1>
<amount1>771.49</amount1>
<particular2>Total Credit</particular2>
<amount2>0.00</amount2>
</line>
<line>
<particular1>Amount to be Received</particular1>
<amount1>771.49</amount1>
</line>
<note>Hereafter no reminders will be sent for payment of
monthly/Arrears bills.</note>
</member>
<member>
<membernumber>A00000100</membernumber>
<billnumber>Bill no. : A00000100/APRIL 10</billnumber>
<membername>Sandeep</membername>
<billdate>Run date : 03/05/2010</billdate>
<memberaddress1>NO 12,</memberaddress1>
<memberaddress2>TNAGAR,</memberaddress2>
<membercity>CHENNAI</membercity>
<memberpostalcode>600017</memberpostalcode>
<memberphonenumber>9840012365</memberphonenumber>
<preface>STATEMENT OF ACCOUNTS AND BILL FOR THE MONTH OF
APRIL-2010</preface>
<columnh1>Particulars</columnh1>
<columnh2>Debit</columnh2>
<columnh3>Receivables</columnh3>
<columnh4>Credit</columnh4>
<line>
<particular1>Opening Balance</particular1>
<amount1>496.38</amount1>
<particular2>-</particular2>
<amount2>0.00</amount2>
</line>
<line>
<particular1>ENTERTAINMENT CHARGES</particular1>
<amount1>33.09</amount1>
<particular2>17/06/2010 CASH
PCR/000544/10-11</particular2>
<amount2>124.00</amount2>
</line>
<line>
<particular1>MINIMUM USAGE</particular1>
<amount1>124.00</amount1>
</line>
<line>
<particular1>SUBSCRIPTION CHARGES</particular1>
<amount1>220.60</amount1>
</line>
<line>
<particular1>WATER CHARGE</particular1>
<amount1>22.06</amount1>
</line>
<line>
<particular1>Total Debit</particular1>
<amount1>896.13</amount1>
<particular2>Total Credit</particular2>
<amount2>124.00</amount2>
</line>
<line>
<particular1>Amount to be Received</particular1>
<amount1>772.13</amount1>
</line>
<note>Hereafter no reminders will be sent for payment of
monthly/Arrears bills.</note>
</member>
</bill>
--- End Message ---
--- Begin Message ---
> Is MAX_FILE_SIZE passed to PHP as $MAX_FILE_SIZE?
only if register_golbals is set to ON in php.ini. This is a very bad
practice and should be avoided. Use $_POST['MAX_FILE_SIZE'] instead.
But in this case dont use the post variable also. define a constant in
your configuration file and use that constant. The only use of
MAX_FILE_SIZE is to inform the browser that "dont allow the user to
upload files which are > MAX_FILE_SIZE".
> <?php
>
> $MAX_FILE_SIZE = 30000;
>
> echo <<<_END
> <form enctype="multipart/form-data" action="__URL__" method="POST">
> <!-- MAX_FILE_SIZE must precede the file input field -->
> <input type="hidden" name="MAX_FILE_SIZE" />
> <!-- Name of input element determines name in $_FILES array -->
> Send this file: <input name="userfile" type="file" />
> <input type="submit" value="Send File" />
> </form>
> <<<_END
Nope, you cant. You have to mention the value attribute of a hidden field
> I'm also concerned that in the first instance, a malicious user can
> modify the value and I will be hosed. Am I correct?
A malicious user can ALWAYS modify the data. You will have to always
validate every input field.
> echo <<<_END
> <form enctype="multipart/form-data" action="__URL__" method="POST">
> <!-- MAX_FILE_SIZE must precede the file input field -->
> <input type="hidden" name="<?php echo $max_file_size; ?>" />
> <!-- Name of input element determines name in $_FILES array -->
> Send this file: <input name="userfile" type="file" />
> <input type="submit" value="Send File" />
> </form>
> <<<_END
i did not understand this echo <<<_END means that you are in php so
why do you need a <?php echo $max_file_size; ?> ?
--- End Message ---
--- Begin Message ---
On 12 September 2010 09:19, David Robley <[email protected]> wrote:
> Richard Quadling wrote:
>
>> On 11 September 2010 20:24, Jim Lucas <[email protected]> wrote:
>>> As I thought, looking through the docs, it looks like the only way to set
>>> the options that are only settable via the php.ini file is to use a per
>>> directory php.ini file. But, the problem with that is, it only works
>>> with the CGI/FASTCGI SAPI version of php. It won't work with the apache
>>> mod version.
>>>
>>> So, I guess the question back to you is, what is your setup like? And if
>>> it isn't CGI/FASTCGI SAPI are you willing to change to that setup?
>>>
>>> Read More: http://www.php.net/manual/en/configuration.file.per-user.php
>>
>> Thanks for that. FastCGI. Will do some more work on it now.
>>
>>
> If you are wanting to disable parsing of php files on a per-directory basis,
> you can do this via .htaccess using
>
> php_flag engine 1|0 (or on|off if you prefer)
>
> http://php.net/manual/en/apache.configuration.php#ini.engine Rather well
> hidden - took me a few minutes to dig it out :-)
>
>
>
> Cheers
> --
> David Robley
>
> If you would know a man, observe how he treats a cat.
> Today is Setting Orange, the 36th day of Bureaucracy in the YOLD 3176.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I'm helping someone else, so not my setup. They want to disable the
gmagick extension.
I'm waiting for him to get back to me on system setup.
I'm not exactly sure why this extension requires disabling in a single
directory ...
All things I should have asked first, but my first impression was that
there was no way to do a ...
-extension=php_gmagick.dll (or .so).
I'm thinking about a shared hosting where a user may have a conflict
between their own classes and an extension's.
Namespaces could be the answer here, but you can't just put a 1 liner
in and have all the code fixed.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--- End Message ---
--- Begin Message ---
Hello Sridhar Pandurangiah,
how women and children do you have, that you
need a program, which count it for you? :-D
Thanks, Greetings and nice Day/Evening
Michelle Konzack
--
##################### Debian GNU/Linux Consultant ######################
Development of Intranet and Embedded Systems with Debian GNU/Linux
itsyst...@tdnet France EURL itsyst...@tdnet UG (limited liability)
Owner Michelle Konzack Owner Michelle Konzack
Apt. 917 (homeoffice)
50, rue de Soultz Kinzigstraße 17
67100 Strasbourg/France 77694 Kehl/Germany
Tel: +33-6-61925193 mobil Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix
<http://www.itsystems.tamay-dogan.net/> <http://www.flexray4linux.org/>
<http://www.debian.tamay-dogan.net/> <http://www.can4linux.org/>
Jabber [email protected]
ICQ #328449886
Linux-User #280138 with the Linux Counter, http://counter.li.org/
signature.pgp
Description: Digital signature
--- End Message ---
--- Begin Message ---
On Sat, Sep 11, 2010 at 8:50 PM, Shawn McKenzie <[email protected]> wrote:
> On 09/10/2010 11:13 AM, J Ravi Menon wrote:
>> Hi,
>>
>> I have some basic questions on running php (5.2.x series on Linux
>> 2.6) as a standalone daemon using posix methods (fork() etc..):
>>
>> #!/usr/bin/php
>> <?php
>>
>> require_once ('someclass.php');
>>
>> // do some initializations
>> .
>>
>> // main 'forever' loop - the '$shutdown' will
>> // be set to true via a signal handler
>>
>> while(!$shutdown)
>> {
>> $a = new SomeClass();
>>
>> $a->doSomething()
>>
>> }
>>
>> // shutdown logic.
>>
>> The 'someclass.php' in turn will include other files (via require_once).
>>
>> The above file will be executed directly from the shell. The main loop
>> could be listening to new requests via sockets etc..
>>
>> Few questions:
>>
>> 1) Does opcode cache really matter in such cli-based daemons? As
>> 'SomeClass' is instantiated at every loop, I am assuming it is only
>> compiled once as it has already been 'seen'.
>> I am not very clear on how apc (or eaccelerator) works in such cases.
>>
>>
>> 2) What about garbage collection? In a standard apache-mod-php setup,
>> we rely on the end of a request-cycle to free up resources - close
>> file descriptiors, free up memory etc..
>> I am assuming in the aforesaid standalone daemon case, we would
>> have to do this manually? In the loop above, would it be better to
>> 'unset($a)' explicitly at the end of it before
>> it goes to the next iteration?
>>
>> Note: I have written pre-forker deamons in php directly and
>> successfully deployed them in the past, but never looked at in depth
>> to understand all the nuances. Anecdotally, I have
>> done 'unset()' at some critical places were large arrays were used,
>> and I think it helped. AFAIK, unlike Java, there is no 'garbage
>> collector' thread that does all the magic?
>>
>> Thanks,
>> Ravi
>
> If I have time when you reply I'll answer the questions, but I must ask:
> Is this purely academic? Why is this a concern? Have you encountered
> issues? If so, what?
@Tom: I have compiled php with pcntl on and this has never been an
issue. It works well (on a linux setup), and I have deployed
standalone daemons with out any major problems. I have a home-grown
'preforker' framework (which I hope to share soon) which can be used
to exploit multi-core boxes.
@Shawn: It is not academic. There is a follow-up I am planning based
on the doubts above. I have deployed such daemons in the past with
some assumptions on (2) by doing manual cleanups - e.g. closing curl
connections, closing up db handles etc... Really want to understand
how php works in such setups outside of apache+mod_php.
thanks,
Ravi
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
--- End Message ---