php-general Digest 19 Jul 2009 12:25:10 -0000 Issue 6238

Topics (messages 295551 through 295569):

Re: why does PHP parse "*.html" files in one subdir/ but not in another?
        295551 by: Adam Shannon
        295553 by: Govinda
        295554 by: Adam Shannon
        295555 by: Paul M Foster
        295556 by: kranthi
        295557 by: Govinda
        295558 by: Govinda
        295561 by: Jim Lucas
        295562 by: Stuart

Re: Back from the dead with a racing question!
        295552 by: Jason Pruim
        295563 by: Ashley Sheridan

need to get .html files parsed by PHP.  -- WAS:  why does PHP parse "*.html" 
files in one subdir/ but not in  another?
        295559 by: Govinda
        295564 by: Ashley Sheridan
        295566 by: Eddie Drapkin

Re: IP to geo-location advice
        295560 by: Manuel Lemos

Help with file downloads.
        295565 by: tony mount
        295567 by: Ashley Sheridan

Newbie: Composition by Association - Pagination Class general question.
        295568 by: MEM
        295569 by: Stuart

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 Sat, Jul 18, 2009 at 7:01 PM, Govinda <[email protected]>wrote:

> Hi all,
>
> ..sitting here thinking this is so easy, and I must have been over this
> already in the past..  but it is eluding me just now..
>
> I can't figure out why files with the .html extension ARE being parsed by
> PHP when they are in the main doc root dir/, or in one subdirectory down
> from there..  BUT NOT when in *another* new subdirectory that I just
> created.  Both subdirectories have the exact same perms (same owner & group
> too), both have the same php.ini file in them,...  neither have an .htaccess
> file in them..  (if that would matter?).
>
> Anyway I just need to get PHP tp process all .html files in this and in any
> new subdirectory(ies) that I will make.
> Can someone point me to what I need to pay attention to?
>

It sounds like your .htaccess file may be telling .html files in a
/sub/directory/ to treat .html files as .php

Just add this to your root .htaccess
AddType x-mapp-php5 .html


>
> Thank you
> -Govinda
>
>
>
> ------------
> Govinda
> [email protected]
>
>


-- 
- Adam Shannon ( http://ashannon.us )

--- End Message ---
--- Begin Message ---

On Jul 18, 2009, at 6:36 PM, Adam Shannon wrote:



On Sat, Jul 18, 2009 at 7:01 PM, Govinda <[email protected]> wrote:
Hi all,

..sitting here thinking this is so easy, and I must have been over this already in the past.. but it is eluding me just now..

I can't figure out why files with the .html extension ARE being parsed by PHP when they are in the main doc root dir/, or in one subdirectory down from there.. BUT NOT when in *another* new subdirectory that I just created. Both subdirectories have the exact same perms (same owner & group too), both have the same php.ini file in them,... neither have an .htaccess file in them.. (if that would matter?).

Anyway I just need to get PHP tp process all .html files in this and in any new subdirectory(ies) that I will make.
Can someone point me to what I need to pay attention to?

It sounds like your .htaccess file may be telling .html files in a / sub/directory/ to treat .html files as .php

Just add this to your root .htaccess
AddType x-mapp-php5 .html

Thanks Adam. But still no luck. I did add that line to the .htaccess file in my doc root, but my file.html in subdir/ is still not being parsed by PHP.
??

-G

--- End Message ---
--- Begin Message ---
On Sat, Jul 18, 2009 at 7:54 PM, Govinda <[email protected]>wrote:

>
> On Jul 18, 2009, at 6:36 PM, Adam Shannon wrote:
>
>
>
> On Sat, Jul 18, 2009 at 7:01 PM, Govinda <[email protected]>wrote:
>
>> Hi all,
>>
>> ..sitting here thinking this is so easy, and I must have been over this
>> already in the past..  but it is eluding me just now..
>>
>> I can't figure out why files with the .html extension ARE being parsed by
>> PHP when they are in the main doc root dir/, or in one subdirectory down
>> from there..  BUT NOT when in *another* new subdirectory that I just
>> created.  Both subdirectories have the exact same perms (same owner & group
>> too), both have the same php.ini file in them,...  neither have an .htaccess
>> file in them..  (if that would matter?).
>>
>> Anyway I just need to get PHP tp process all .html files in this and in
>> any new subdirectory(ies) that I will make.
>> Can someone point me to what I need to pay attention to?
>>
>
> It sounds like your .htaccess file may be telling .html files in a
> /sub/directory/ to treat .html files as .php
>
> Just add this to your root .htaccess
> AddType x-mapp-php5 .html
>
>
> Thanks Adam.  But still no luck.  I did add that line to the .htaccess file
> in my doc root, but my file.html in subdir/ is still not being parsed by
> PHP.
> ??
>

Try to put that same line of .htaccess into the sub directory.  Your host
may not allow .htaccess rules to be many directories deep.


>
> -G
>



-- 
- Adam Shannon ( http://ashannon.us )

--- End Message ---
--- Begin Message ---
On Sat, Jul 18, 2009 at 06:01:14PM -0600, Govinda wrote:

> Hi all,
>
> ..sitting here thinking this is so easy, and I must have been over
> this already in the past..  but it is eluding me just now..
>
> I can't figure out why files with the .html extension ARE being parsed
> by PHP when they are in the main doc root dir/, or in one subdirectory
> down from there..  BUT NOT when in *another* new subdirectory that I
> just created.  Both subdirectories have the exact same perms (same
> owner & group too), both have the same php.ini file in them,...
> neither have an .htaccess file in them..  (if that would matter?).
>
> Anyway I just need to get PHP tp process all .html files in this and
> in any new subdirectory(ies) that I will make.
> Can someone point me to what I need to pay attention to?

You do realize that PHP does not parse HTML files, right? The web server
does that. In fact, the web server also parses PHP files, using a
different library.

Paul

-- 
Paul M. Foster

--- End Message ---
--- Begin Message ---
i never used x-mapp-php5, but most of a forums say it is specific to
1and1 hosting service. php recommends application/x-httpd-php

http://us2.php.net/manual/en/install.unix.apache2.php

try adding AddType application/x-httpd-php .html in your root htaccess
if that dosent help you'll have to add that to your htpd.conf file

> You do realize that PHP does not parse HTML files, right? The web server
> does that. In fact, the web server also parses PHP files, using a
> different library.
Kindly elaborate If you are saying that PHP cant parse files with
extension .html
http://us2.php.net/manual/en/security.hiding.php.

--- End Message ---
--- Begin Message ---

Just add this to your root .htaccess
AddType x-mapp-php5 .html

Thanks Adam. But still no luck. I did add that line to the .htaccess file in my doc root, but my file.html in subdir/ is still not being parsed by PHP.
??

Try to put that same line of .htaccess into the sub directory. Your host may not allow .htaccess rules to be many directories deep.

I just tried this, at your recommendation, but still no luck.

--- End Message ---
--- Begin Message ---
You do realize that PHP does not parse HTML files, right? The web server
does that. In fact, the web server also parses PHP files, using a
different library.

I understand. I just was saying it that way. Actually I rarely think too deeply about that specifically, but now that you pointed it out I realize I do know that. Thanks..
-G

--- End Message ---
--- Begin Message ---
Govinda wrote:
Hi all,

..sitting here thinking this is so easy, and I must have been over this already in the past.. but it is eluding me just now..

I can't figure out why files with the .html extension ARE being parsed by PHP when they are in the main doc root dir/, or in one subdirectory down from there.. BUT NOT when in *another* new subdirectory that I just created. Both subdirectories have the exact same perms (same owner & group too), both have the same php.ini file in them,... neither have an .htaccess file in them.. (if that would matter?).

Anyway I just need to get PHP tp process all .html files in this and in any new subdirectory(ies) that I will make.
Can someone point me to what I need to pay attention to?

Thank you
-Govinda



------------
Govinda
[email protected]



Another thing you could do is, instead of a .htaccess, use a php.ini file in 
your
DOCUMENT_ROOT.  Sometimes hosts allow this file.  If allowed, you will then be 
able
to set any php.ini configuration option you want.

Give it a shot!  What do you have to loose at this point?

Jim

--- End Message ---
--- Begin Message ---
2009/7/19 Jim Lucas <[email protected]>:
> Govinda wrote:
>>
>> Hi all,
>>
>> ..sitting here thinking this is so easy, and I must have been over this
>> already in the past..  but it is eluding me just now..
>>
>> I can't figure out why files with the .html extension ARE being parsed by
>> PHP when they are in the main doc root dir/, or in one subdirectory down
>> from there..  BUT NOT when in *another* new subdirectory that I just
>> created.  Both subdirectories have the exact same perms (same owner & group
>> too), both have the same php.ini file in them,...  neither have an .htaccess
>> file in them..  (if that would matter?).
>>
>> Anyway I just need to get PHP tp process all .html files in this and in
>> any new subdirectory(ies) that I will make.
>> Can someone point me to what I need to pay attention to?
>>
>> Thank you
>> -Govinda
>>
>>
>>
>> ------------
>> Govinda
>> [email protected]
>>
>>
>
> Another thing you could do is, instead of a .htaccess, use a php.ini file in
> your
> DOCUMENT_ROOT.  Sometimes hosts allow this file.  If allowed, you will then
> be able
> to set any php.ini configuration option you want.
>
> Give it a shot!  What do you have to loose at this point?

Lose not loose, and php.ini has no control over what file types get
parsed by PHP.

-Stuart

-- 
http://stut.net/

--- End Message ---
--- Begin Message ---

On Jul 18, 2009, at 5:54 PM, Phpster wrote:



On Jul 18, 2009, at 9:45 AM, Ashley Sheridan <[email protected]> wrote:

On Fri, 2009-07-17 at 14:01 -0400, Bastien Koert wrote:
On Fri, Jul 17, 2009 at 1:54 PM, Jason Pruim<[email protected]> wrote:

On Jul 17, 2009, at 11:56 AM, Bastien Koert wrote:

On Fri, Jul 17, 2009 at 11:51 AM, tedd<[email protected]> wrote:

At 11:12 AM -0400 7/17/09, Jason Pruim wrote:

Hi everyone!

So some of you may have noticed that I have been away for quite
awhile...
Been trying to get settled (Moved across the country) and getting a job.

And now that that is done I have a question about a project that I might
be doing for my current employer and want to do it properly.

If all goes through, I'll be writing an online database that upwards of
10
people will be using at various times through out the day. Basically, in
a
form they fill out a model number, customer name, phone number etc.
etc..
And then submit the form. After submitting they need to write the log
number
on some paperwork. If I have 2 people submit the form at the same time,
I'm
thinking I could end up with a race condition and they might get the
wrong
log number (The log number is simply a consecutive record number)

Do I need to be reading up on locking tables/rows? Or in my situation as I've briefly described it do I not have to worry about it? Or is there a third door with the magic bullet that will solve all my problems? :)

Any advice is greatly appreciated as always, RTFMing is good as well, as
long as M is defined :)

I'm not afraid of google either, just need the right terms to hit it
with
so I don't go into "search overload" as the commercials for a rival
search
engine claim :)

Thanks Everyone!

Jason:

Welcome back.

Clearly if you have two or more people checkout the same record at the
same
time and each edits the record then you ARE going to have problems when
each
updates the record.

You can solve this problem by using transactions -- here's a link:

http://dev.mysql.com/doc/refman/5.0/en/lock-tables-and-transactions.html

When someone is editing a record, you also need to be able to show the
next
person(s) that the record they want is currently busy and not available. However, I'm not sure as to how to notify the next user that the table is locked via php. Perhaps a table status might provide that information. If
so, then use that to notify the next user.

As for your log of activity, just create a another record (with an auto_increment index) in your activity log table and update that record
with
the data you need to record, such as user id, timestamp, what record they accessed and whatever else you want after the transaction is completed.

Cheers,

tedd

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

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



As a further note to tedd's reply on transactions, you will need to use the INNODB engine in mysql should you want to use transactions. Transactions here are done a row locking level not table so you should
have fewer issues.

I also just found out that unless I can convince them to host it off site, it'll be on a windows machine.... So php & mssql... Does that change alot?

To answer some of the other questions the Log number is currently just an auto incrementing consuctive number. So an auto+increment would work
perfectly. What I'm trying to avoid is:

User1
User2

User1 submits to log number 12345
User2 submits to log number 12346

User1 is told their log number is 12346
User2 is told their log number is 12346

But User1 & User2 are on different computers... And if it's as easy as using the equivelant for: SELECT * FROM table WHERE UserID="User1" ORDER BY lognumber desc LIMIT 1; Then I'm good... I know how to proceed with writing
it... Just need to figure out how to bill/sell it! ;)




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



MSSQL doesn't allow limit, but you can do a

select top 1 * from table [where] [order by lognumber desc]

--

Bastien

Cat, the other other white meat

I believe more recent versions of MSSQL allow the LIMIT clause, but
what's wrong with MySQL on Windows?

Thanks
Ash
www.ashleysheridan.co.uk


Nothing, but Jason indicated that mssql was predetermined.

Absolutely right :)

mssql is installed already so I'm trying to make it easy for them. Personally I'd go MySQL but I should branch out some anyway ;)




--- End Message ---
--- Begin Message ---
On Sat, 2009-07-18 at 20:36 -0400, Jason Pruim wrote:
> On Jul 18, 2009, at 5:54 PM, Phpster wrote:
> 
> >
> >
> > On Jul 18, 2009, at 9:45 AM, Ashley Sheridan  
> > <[email protected]> wrote:
> >
> >> On Fri, 2009-07-17 at 14:01 -0400, Bastien Koert wrote:
> >>> On Fri, Jul 17, 2009 at 1:54 PM, Jason Pruim<[email protected]>  
> >>> wrote:
> >>>>
> >>>> On Jul 17, 2009, at 11:56 AM, Bastien Koert wrote:
> >>>>
> >>>>> On Fri, Jul 17, 2009 at 11:51 AM, tedd<[email protected]>  
> >>>>> wrote:
> >>>>>>
> >>>>>> At 11:12 AM -0400 7/17/09, Jason Pruim wrote:
> >>>>>>>
> >>>>>>> Hi everyone!
> >>>>>>>
> >>>>>>> So some of you may have noticed that I have been away for quite
> >>>>>>> awhile...
> >>>>>>> Been trying to get settled (Moved across the country) and  
> >>>>>>> getting a job.
> >>>>>>>
> >>>>>>> And now that that is done I have a question about a project  
> >>>>>>> that I might
> >>>>>>> be doing for my current employer and want to do it properly.
> >>>>>>>
> >>>>>>> If all goes through, I'll be writing an online database that  
> >>>>>>> upwards of
> >>>>>>> 10
> >>>>>>> people will be using at various times through out the day.  
> >>>>>>> Basically, in
> >>>>>>> a
> >>>>>>> form they fill out a model number, customer name, phone number  
> >>>>>>> etc.
> >>>>>>> etc..
> >>>>>>> And then submit the form. After submitting they need to write  
> >>>>>>> the log
> >>>>>>> number
> >>>>>>> on some paperwork. If I have 2 people submit the form at the  
> >>>>>>> same time,
> >>>>>>> I'm
> >>>>>>> thinking I could end up with a race condition and they might  
> >>>>>>> get the
> >>>>>>> wrong
> >>>>>>> log number (The log number is simply a consecutive record  
> >>>>>>> number)
> >>>>>>>
> >>>>>>> Do I need to be reading up on locking tables/rows? Or in my  
> >>>>>>> situation as
> >>>>>>> I've briefly described it do I not have to worry about it? Or  
> >>>>>>> is there a
> >>>>>>> third door with the magic bullet that will solve all my  
> >>>>>>> problems? :)
> >>>>>>>
> >>>>>>> Any advice is greatly appreciated as always, RTFMing is good  
> >>>>>>> as well, as
> >>>>>>> long as M is defined :)
> >>>>>>>
> >>>>>>> I'm not afraid of google either, just need the right terms to  
> >>>>>>> hit it
> >>>>>>> with
> >>>>>>> so I don't go into "search overload" as the commercials for a  
> >>>>>>> rival
> >>>>>>> search
> >>>>>>> engine claim :)
> >>>>>>>
> >>>>>>> Thanks Everyone!
> >>>>>>
> >>>>>> Jason:
> >>>>>>
> >>>>>> Welcome back.
> >>>>>>
> >>>>>> Clearly if you have two or more people checkout the same record  
> >>>>>> at the
> >>>>>> same
> >>>>>> time and each edits the record then you ARE going to have  
> >>>>>> problems when
> >>>>>> each
> >>>>>> updates the record.
> >>>>>>
> >>>>>> You can solve this problem by using transactions -- here's a  
> >>>>>> link:
> >>>>>>
> >>>>>> http://dev.mysql.com/doc/refman/5.0/en/lock-tables-and-transactions.html
> >>>>>>
> >>>>>> When someone is editing a record, you also need to be able to  
> >>>>>> show the
> >>>>>> next
> >>>>>> person(s) that the record they want is currently busy and not  
> >>>>>> available.
> >>>>>> However, I'm not sure as to how to notify the next user that  
> >>>>>> the table is
> >>>>>> locked via php. Perhaps a table status might provide that  
> >>>>>> information. If
> >>>>>> so, then use that to notify the next user.
> >>>>>>
> >>>>>> As for your log of activity, just create a another record (with  
> >>>>>> an
> >>>>>> auto_increment index) in your activity log table and update  
> >>>>>> that record
> >>>>>> with
> >>>>>> the data you need to record, such as user id, timestamp, what  
> >>>>>> record they
> >>>>>> accessed and whatever else you want after the transaction is  
> >>>>>> completed.
> >>>>>>
> >>>>>> Cheers,
> >>>>>>
> >>>>>> tedd
> >>>>>>
> >>>>>> --
> >>>>>> -------
> >>>>>> http://sperling.com  http://ancientstones.com  http://earthstones.com
> >>>>>>
> >>>>>> --
> >>>>>> PHP General Mailing List (http://www.php.net/)
> >>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
> >>>>>>
> >>>>>>
> >>>>>
> >>>>> As a further note to tedd's reply on transactions, you will need  
> >>>>> to
> >>>>> use the INNODB engine in mysql should you want to use  
> >>>>> transactions.
> >>>>> Transactions here are done a row locking level not table so you  
> >>>>> should
> >>>>> have fewer issues.
> >>>>
> >>>> I also just found out that unless I can convince them to host it  
> >>>> off site,
> >>>> it'll be on a windows machine....  So php & mssql... Does that  
> >>>> change alot?
> >>>>
> >>>> To answer some of the other questions the Log number is currently  
> >>>> just an
> >>>> auto incrementing consuctive number. So an auto+increment would  
> >>>> work
> >>>> perfectly. What I'm trying to avoid is:
> >>>>
> >>>> User1
> >>>> User2
> >>>>
> >>>> User1 submits to log number 12345
> >>>> User2 submits to log number 12346
> >>>>
> >>>> User1 is told their log number is 12346
> >>>> User2 is told their log number is 12346
> >>>>
> >>>> But User1 & User2 are on different computers... And if it's as  
> >>>> easy as using
> >>>> the equivelant for: SELECT * FROM table WHERE UserID="User1"  
> >>>> ORDER BY
> >>>> lognumber desc LIMIT 1; Then I'm good... I know how to proceed  
> >>>> with writing
> >>>> it... Just need to figure out how to bill/sell it! ;)
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> PHP General Mailing List (http://www.php.net/)
> >>>> To unsubscribe, visit: http://www.php.net/unsub.php
> >>>>
> >>>>
> >>>
> >>> MSSQL doesn't allow limit, but you can do a
> >>>
> >>> select top 1 * from table [where] [order by lognumber desc]
> >>>
> >>> -- 
> >>>
> >>> Bastien
> >>>
> >>> Cat, the other other white meat
> >>>
> >> I believe more recent versions of MSSQL allow the LIMIT clause, but
> >> what's wrong with MySQL on Windows?
> >>
> >> Thanks
> >> Ash
> >> www.ashleysheridan.co.uk
> >>
> >
> > Nothing, but Jason indicated that mssql was predetermined.
> 
> Absolutely right :)
> 
> mssql is installed already so I'm trying to make it easy for them.  
> Personally I'd go MySQL but I should branch out some anyway ;)
> 
> 
> 
> 
You'll end up regretting it ;) There doesn't seem to be any phpMyAdmin
equivalent for MSSQL, and the darn Enterprise Manager software I used at
my last job is probably one of the worst pieces of software I've ever
encountered...

Thanks
Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
i never used x-mapp-php5, but most of a forums say it is specific to
1and1 hosting service. php recommends application/x-httpd-php

http://us2.php.net/manual/en/install.unix.apache2.php

try adding AddType application/x-httpd-php .html in your root htaccess

hmmm.   Darn!   I just did try what you suggested above.  Still no luck.

if that dosent help you'll have to add that to your htpd.conf file

I am guessing that this means that I am outta luck since I am on a shared hosting environment and assume I do not have access to httpd.conf.

Agreed?

It sounds like your .htaccess file may be telling .html files in a / sub/directory/ to treat .html files as .php

I'm sorry I misled everyone. I just looked better at things and .html files are NOT getting their PHP parsed... *not anywhere*. So I assume then that it IS an httpd.conf issue. (?) ...and only the host admin can turn this on for me? (Because if it is something I have control over he is going to give me a hard time ;-)

-G

--- End Message ---
--- Begin Message ---
On Sat, 2009-07-18 at 23:09 -0600, Govinda wrote:
> > i never used x-mapp-php5, but most of a forums say it is specific to
> > 1and1 hosting service. php recommends application/x-httpd-php
> >
> > http://us2.php.net/manual/en/install.unix.apache2.php
> >
> > try adding AddType application/x-httpd-php .html in your root htaccess
> 
> hmmm.   Darn!   I just did try what you suggested above.  Still no luck.
> 
> > if that dosent help you'll have to add that to your htpd.conf file
> 
> I am guessing that this means that I am outta luck since I am on a  
> shared hosting environment and assume I do not have access to  
> httpd.conf.
> 
> Agreed?
> 
> > It sounds like your .htaccess file may be telling .html files in a / 
> > sub/directory/ to treat .html files as .php
> 
> I'm sorry I misled everyone.  I just looked better at things and .html  
> files are NOT getting their PHP parsed...  *not anywhere*.   So I  
> assume then that it IS an httpd.conf issue.  (?)   ...and only the  
> host admin can turn this on for me?  (Because if it is something I  
> have control over he is going to give me a hard time ;-)
> 
> -G
> 
Generally, if a file has a .html extenstion, then it should really just
contain html. .php extensions are meant for php code containing html.

Thanks
Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
On Sun, Jul 19, 2009 at 2:53 AM, Ashley
Sheridan<[email protected]> wrote:
> On Sat, 2009-07-18 at 23:09 -0600, Govinda wrote:
>> > i never used x-mapp-php5, but most of a forums say it is specific to
>> > 1and1 hosting service. php recommends application/x-httpd-php
>> >
>> > http://us2.php.net/manual/en/install.unix.apache2.php
>> >
>> > try adding AddType application/x-httpd-php .html in your root htaccess
>>
>> hmmm.   Darn!   I just did try what you suggested above.  Still no luck.
>>
>> > if that dosent help you'll have to add that to your htpd.conf file
>>
>> I am guessing that this means that I am outta luck since I am on a
>> shared hosting environment and assume I do not have access to
>> httpd.conf.
>>
>> Agreed?
>>
>> > It sounds like your .htaccess file may be telling .html files in a /
>> > sub/directory/ to treat .html files as .php
>>
>> I'm sorry I misled everyone.  I just looked better at things and .html
>> files are NOT getting their PHP parsed...  *not anywhere*.   So I
>> assume then that it IS an httpd.conf issue.  (?)   ...and only the
>> host admin can turn this on for me?  (Because if it is something I
>> have control over he is going to give me a hard time ;-)
>>
>> -G
>>
> Generally, if a file has a .html extenstion, then it should really just
> contain html. .php extensions are meant for php code containing html.
>
> Thanks
> Ash
> www.ashleysheridan.co.uk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

File extension has absolutely no bearing at all on the contents of the
file.  There's valid reasons to not expose what's what under the hood,
especially if there happen to be known exploits in the latest version
of PHP that week.  God forbid that that happens, but it does every so
often.  File mime-type being determined by an extension is entirely M$
Windows mentality and doesn't really extend to *nix environments,
where most of us are hosting our sites, anyway.  You could name your
scripts whatever you want, .awesome, .refridgerator, .silver, whatever
and it'd have no bearing on the files themselves.  It's certainly the
de-factor standard that .html files only contain flat markup, but
that's by no means a rule or anything, but it's common practice
(mostly because programmers are lazy).

Sorry if I sound rude, just quit smoking :)
--Eddie

--- End Message ---
--- Begin Message ---
Viva,

on 07/15/2009 09:14 AM Patrick said the following:
> Could anyone give me some advice on the best way to do IP to
> geo-location with php using open source code?

You may want to look here for several solution for that purpose:

http://www.phpclasses.org/browse/class/39/top/rated.html

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
Hi,
My first post. Been writing php from scratch for about 12 months, mainly
with what I learnt from the web. Have a problem trying to download
multiple files. I'm using the following code:
if (file_exists($file)) {
    header('Content-Description: File Transfer');
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename='.basename($file));
    header('Content-Transfer-Encoding: binary');
    header('Expires: 0');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    header('Content-Length: ' . filesize($file));
    ob_clean();
    flush();
    readfile($file);
//    exit;
}
from the the php manual under "readfile". The files are text files <1Mb
in size. Only the first file is downloaded. (The exit; statement is
excluded). What should I do?
Thanks
Tony


--- End Message ---
--- Begin Message ---
On Sun, 2009-07-19 at 16:47 +0930, tony mount wrote:
> Hi,
> My first post. Been writing php from scratch for about 12 months, mainly
> with what I learnt from the web. Have a problem trying to download
> multiple files. I'm using the following code:
> if (file_exists($file)) {
>     header('Content-Description: File Transfer');
>     header('Content-Type: application/octet-stream');
>     header('Content-Disposition: attachment; filename='.basename($file));
>     header('Content-Transfer-Encoding: binary');
>     header('Expires: 0');
>     header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
>     header('Pragma: public');
>     header('Content-Length: ' . filesize($file));
>     ob_clean();
>     flush();
>     readfile($file);
> //    exit;
> }
> from the the php manual under "readfile". The files are text files <1Mb
> in size. Only the first file is downloaded. (The exit; statement is
> excluded). What should I do?
> Thanks
> Tony
> 
> 
Is that script in a loop or something, as by itself, it'll only operate
on one file.

Thanks
Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
Hello,

I have a Animals DAO class that I'd like to apply a pagination class to it.

Between this two classes, there will be a composition relation (more
precisely, an association one). My question is:

Is a Pagination that "has a" Animal. OR Is a Animal that "has a" pagination?
Should we create on Class Pagination a property named $_animal OR, should we
create on class Animal a property named $_pagination? 

I'm inclined to accept the second one, since, if I put the property $_animal
on my classe Pagination, I will end up, on the Pagination Class, with so
many properties as pagination objects... :s



Any help please?
Márcio


--- End Message ---
--- Begin Message ---
2009/7/19 MEM <[email protected]>:
> Hello,
>
> I have a Animals DAO class that I'd like to apply a pagination class to it.
>
> Between this two classes, there will be a composition relation (more
> precisely, an association one). My question is:
>
> Is a Pagination that "has a" Animal. OR Is a Animal that "has a" pagination?
> Should we create on Class Pagination a property named $_animal OR, should we
> create on class Animal a property named $_pagination?
>
> I'm inclined to accept the second one, since, if I put the property $_animal
> on my classe Pagination, I will end up, on the Pagination Class, with so
> many properties as pagination objects... :s

Pagination is the generically applicable class - it should know
nothing about what specifically it's paginating.

-Stuart

-- 
http://stut.net/

--- End Message ---

Reply via email to