php-windows Digest 24 Oct 2002 02:09:49 -0000 Issue 1403
Topics (messages 16496 through 16517):
Mail
16496 by: James Meers
16515 by: Prachait Saxena
16516 by: Prachait Saxena
Re: [PHP-DB] Print data
16497 by: Jeffrey_N_Dyke.Keane.com
16508 by: 1LT John W. Holmes
Re: this one's got me stumped...
16498 by: db
16507 by: Mikey
Mixing include path styles. How do I do this???
16499 by: Roderick Martin
16500 by: Rich Gray
16506 by: Roderick Martin
Re: PHP and databases? ...without MySQL and such
16501 by: Richard Allsebrook
16512 by: David Elliott
16513 by: Negretti, John (CCI-San Diego)
16514 by: Luis Ferro
OT
16502 by: Sichta Daniel
16503 by: Luis Ferro
Re: [PHP] Re: PHP and databases? ...without MySQL and such
16504 by: Geoff Hankerson
Re: [PHP] PHP and databases? ...without MySQL and such
16505 by: Maxim Maletsky
Re: php-windows Digest 23 Oct 2002 14:05:19 -0000 Issue 1402
16509 by: neil smith
Oracle IAS version of Apache (1.3.12) & php_oci8.dll
16510 by: Kurt Lund
Speed
16511 by: Mihail Bota
The directory name is invalid. cc
16517 by: chad cotton
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 ---
Hi,
I am trying to use the mail function, below is the code i am using:
mail( "[EMAIL PROTECTED]","test","This is a test mail" );
I get an error:
Warning: Server Error in F:\milinksroot\test.php on line 2
Does anyone know what i should be looking for to rectify this problem?
CHeers
James
--- End Message ---
--- Begin Message ---
Hello
I think there is no mail server installed on the machine, on which ur
running th script.
Please make sure that smtp server is running
Send the details like php version , o/s and others
To: PHP Helplist Windows <[EMAIL PROTECTED]>
Sent: Wednesday, October 23, 2002 7:37 PM
Subject: Mail
> Hi,
>
> I am trying to use the mail function, below is the code i am using:
>
> mail( "[EMAIL PROTECTED]","test","This is a test mail" );
>
> I get an error:
>
> Warning: Server Error in F:\milinksroot\test.php on line 2
>
>
> Does anyone know what i should be looking for to rectify this problem?
>
Bye, and Have a nice day.
Prachait Saxena
If you do for other's !
Other's will do for you !!
Visit me at
http://www.Prachait.Com/
http://www.SitesOnTesting.Com/
--- End Message ---
--- Begin Message ---
Hello
I think there is no mail server installed on the machine, on which ur
running th script.
Please make sure that smtp server is running
Send the details like php version , o/s and others
To: PHP Helplist Windows <[EMAIL PROTECTED]>
Sent: Wednesday, October 23, 2002 7:37 PM
Subject: Mail
> Hi,
>
> I am trying to use the mail function, below is the code i am using:
>
> mail( "[EMAIL PROTECTED]","test","This is a test mail" );
>
> I get an error:
>
> Warning: Server Error in F:\milinksroot\test.php on line 2
>
>
> Does anyone know what i should be looking for to rectify this problem?
>
Bye, and Have a nice day.
Prachait Saxena
If you do for other's !
Other's will do for you !!
Visit me at
http://www.Prachait.Com/
http://www.SitesOnTesting.Com/
--- End Message ---
--- Begin Message ---
I think this is only available as an option if you are running on windows
based hardward, but if you are...i know i've seen it in the manual.
José Moreira
<jmoreira@e-te To: Php Windows
<[EMAIL PROTECTED]>, Php-Db
rno.net> <[EMAIL PROTECTED]>
cc:
10/23/2002 Subject: [PHP-DB] Print data
10:05 AM
hello, at my company we have several network printers and i was was
wondering if it's possible to print directly to them using PHP, instead
of showing on the screen or both ...
to gain more control on what is printed, because of the nasty browsers
header and footer ... whom i now how to remove ...
i know that the printer IP is 192.192.1.100 and the port is 9005 ...
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
> hello, at my company we have several network printers and i was was
> wondering if it's possible to print directly to them using PHP, instead
> of showing on the screen or both ...
> to gain more control on what is printed, because of the nasty browsers
> header and footer ... whom i now how to remove ...
>
> i know that the printer IP is 192.192.1.100 and the port is 9005 ...
The printer functions in the manual only work in windows and only work for
the printer attached directly to the server. Hmm..I wonder, though, if you
have a network printer that's set up to print from the server, can you use
the printer functions to print to that? I'm sure the answer is in the
manual. If not, maybe you can open a connection directly to the printer and
send it the raw data, if you know the format.
---John Holmes...
--- End Message ---
--- Begin Message ---
thanks to all who replied!
using sizeof($_FILES['username']['name']) yields an array of over 10
elements regardless of the number of files selected for upload. and i tried
using something like
"while....list($key,$var)=each($_FILES['username']['name'][$i])...", but i
couldn't get that to work either (not sure i fully understood it...).
what does work is this:
FOR ($i=0; $i<20; $i++) {
IF ($_FILES['username']['name'][$i]==""){
break;
}
}
it somehow doesn't seem very clean, but its working. :)
thanks again!
"Dash McElroy" <[EMAIL PROTECTED]> wrote in message
news:Pine.NEB.4.44.0210221906470.13467-100000@;shell.sasquatch.com...
> In that case, I think you might want to figure out a way to have the user
> zip the files and then unzip them server side.
>
> That sounds like the least tedious way without requiring a mass file
> upload (i.e. other than http access to the web host like ftp or direct).
>
> I think you're running into an HTTP limit here, not a PHP limit.
>
> -Dash
>
> "Don't tell me I'm burning the candle at both ends -- tell me where to
> get more wax!!"
>
> On Tue, 22 Oct 2002, db wrote:
>
> > thanks, Dash. I'm sure that would work, but i'm try to set up a page
that
> > allow a user to upload pictures for use in a photo gallery that i've
> > scripted (i know i'm reinventing the wheel here). a user might have 50
or a
> > 100 pics, and to upload one by one may be a bit tedious.
> >
> > does someone have an alternative approach that accomplishes what i'm
trying
> > to do? from what i've read, $_FILES seems to contain an associative
array.
> > i'm not sure what that means, but perhaps that's things off.
> >
> > i got this from a comment in the docs:
> >
> > The $_FILES variable is not very well documented. Beware that it
contains an
> > associative array:
> >
> > array(1) {
> > ["File"]=>
> > array(5) {
> > ["name"]=>
> > string(12) "brahhh.jpg"
> > ["type"]=>
> > string(11) "image/pjpeg"
> > ["tmp_name"]=>
> > string(14) "/tmp/php2Uyz0c"
> > ["error"]=>
> > int(0)
> > ["size"]=>
> > int(36950)
> > }
> > }
> >
> > it seems that $_FILES['userfile'] has a default size of 5. but i'm not
sure
> > how to...comprehend this. any ideas on how to get around this?
> >
> > thanks.
> >
> > --db
> >
> > "Dash McElroy" <[EMAIL PROTECTED]> wrote in message
> > news:ABA3F1F1A223D411BE6C006008A6F7E2604D86@;MSX1-PTON...
> > > db;
> > >
> > > What I would do (and I have not done this...) would be this:
> > >
> > > Make the page ask for one file, then upload it, then automatically
refresh
> > > (via header("Location: ".$_SERVER['PHP_SELF']); or something similar,
and
> > > ask for another file. I think this is how Yahoo's mail program does
that.
> > >
> > > A little cumbersome, but it should work.
> > >
> > > -Dash
> > >
> > > -----Original Message-----
> > > From: db [mailto:postmaster@;kouryuu.com]
> > > Sent: Tuesday, October 22, 2002 5:25 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP-WIN] this one's got me stumped...
> > >
> > >
> > > ...which isn't that difficult cuz i'm a dunce, but anwyay....
> > >
> > > i'm trying to upload multiple files at once using the example in the
php
> > > doc's. i want to be able to upload up to 20 files at once, but less
than
> > > that at any time.
> > >
> > > this is what i have (basically):
> > >
> > > <input class='tbox' type='file' name='userfile[]' size='50'>
> > >
> > > listed out in a table 20 times and followed by:
> > >
> > > <input class='button' type='submit' name='submit' value='upload'>
> > >
> > > "tbox," refers to a style in a css file. anyway, i'm then trying to
> > > determine the size of the array with:
> > >
> > > $size = sizeof($_FILES['userfile']);
> > >
> > > i would think this would work, however, no matter the number of files
i
> > > select, $size=5. always!
> > >
> > > is there something wrong with my syntax here? or is there a better way
to
> > do
> > > this with this type of array? incidentally, i have register_globals
> > turned
> > > off -- not sure if that would affect anything....
> > >
> > > thx.
> > >
> > >
> > > ---
> > > Outgoing mail is certified Virus Free.
> > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > Version: 6.0.406 / Virus Database: 229 - Release Date: 10/21/2002
> > >
> > >
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.406 / Virus Database: 229 - Release Date: 10/21/2002
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.406 / Virus Database: 229 - Release Date: 10/21/2002
--- End Message ---
--- Begin Message ---
If you are trying to upload multiple files, why don't you get the user to
send them via e-mail and have a scheduled script ('at' command) process the
mailbox that receives the files?
Sorry for not showing any examples, I haven't really got the time...
regards,
Mikey
<-- Insert stream of consciousness here
--- End Message ---
--- Begin Message ---
We recently switched from Netscape Enterprise to IIS and I now need to
make a lot of changes to over 600 htmls - mostly in include statements.
We're doing two things here, switching servers and switching all our
SSI's to PHP includes.
Under Enterprise, I could define a path just by putting it into the
include from the root, ie:
<!--#include virtual="/acc/includes/headstart.htm"-->
I used a global Find and Replace app to change all these (each html has
about eight includes) to:
<? include '/acc/includes/headstart.htm'; ?>
and now they don't work. If I replace the whole path with a Windows
path structure (C:\...) to the included file, it does work.
Here's the problem as I see it. I can easily do another Find and
Replace to add in the first part of the directory tree to the web
directory. What I cannot easily do is change the "/" to "\" inside the
path for the part of the path that's already there.
Is there some way to define the path to the web directory using "\",
maybe in a variable and then somehow/way switch over to "/" so I don't
have to mess with the paths I already have?
Or maybe there's a solution I'm not even aware of. Thank you.
--- End Message ---
--- Begin Message ---
Roderick
Have you tried just changing '/acc/includes/headstart.htm' to
'c:/acc/includes/headstart.htm'? i.e. leaving the unix style slashes in
place...
There is a nasty bug in the latest versions of PHP on Win32 affecting the
include statement with absolute paths.
The above is a workaround solution - once the bug is fixed you should be
able to remove the 'c:' stuff.
HIW!
Rich
-----Original Message-----
From: Roderick Martin [mailto:maillist@;network23.com]
Sent: 23 October 2002 15:43
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Mixing include path styles. How do I do this???
We recently switched from Netscape Enterprise to IIS and I now need to
make a lot of changes to over 600 htmls - mostly in include statements.
We're doing two things here, switching servers and switching all our
SSI's to PHP includes.
Under Enterprise, I could define a path just by putting it into the
include from the root, ie:
<!--#include virtual="/acc/includes/headstart.htm"-->
I used a global Find and Replace app to change all these (each html has
about eight includes) to:
<? include '/acc/includes/headstart.htm'; ?>
and now they don't work. If I replace the whole path with a Windows
path structure (C:\...) to the included file, it does work.
Here's the problem as I see it. I can easily do another Find and
Replace to add in the first part of the directory tree to the web
directory. What I cannot easily do is change the "/" to "\" inside the
path for the part of the path that's already there.
Is there some way to define the path to the web directory using "\",
maybe in a variable and then somehow/way switch over to "/" so I don't
have to mess with the paths I already have?
Or maybe there's a solution I'm not even aware of. Thank you.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
My bad! Windows is definitely not a strong suit with me. I did not know
I could do the drive paths with the reverse slashes. I tried it and it
worked flawlessly! Thank you!!!
All I have to do now is add the drive path up to the web directory to
the replace.
Thanks again! Easier than I could have hoped for.
Rod
On Wednesday, October 23, 2002, at 10:13 AM, Rich Gray wrote:
Roderick
Have you tried just changing '/acc/includes/headstart.htm' to
'c:/acc/includes/headstart.htm'? i.e. leaving the unix style slashes in
place...
There is a nasty bug in the latest versions of PHP on Win32 affecting
the
include statement with absolute paths.
The above is a workaround solution - once the bug is fixed you should
be
able to remove the 'c:' stuff.
HIW!
Rich
-----Original Message-----
From: Roderick Martin [mailto:maillist@;network23.com]
Sent: 23 October 2002 15:43
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Mixing include path styles. How do I do this???
We recently switched from Netscape Enterprise to IIS and I now need to
make a lot of changes to over 600 htmls - mostly in include statements.
We're doing two things here, switching servers and switching all our
SSI's to PHP includes.
Under Enterprise, I could define a path just by putting it into the
include from the root, ie:
<!--#include virtual="/acc/includes/headstart.htm"-->
I used a global Find and Replace app to change all these (each html has
about eight includes) to:
<? include '/acc/includes/headstart.htm'; ?>
and now they don't work. If I replace the whole path with a Windows
path structure (C:\...) to the included file, it does work.
Here's the problem as I see it. I can easily do another Find and
Replace to add in the first part of the directory tree to the web
directory. What I cannot easily do is change the "/" to "\" inside the
path for the part of the path that's already there.
Is there some way to define the path to the web directory using "\",
maybe in a variable and then somehow/way switch over to "/" so I don't
have to mess with the paths I already have?
Or maybe there's a solution I'm not even aware of. Thank you.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
You can use the Microsoft ODBC Text driver to access flat files and perform
SQL Queries on it - can be REALLY slow on big files though (no indexes) :(
Alternatively - write a script that pulls the flat file into a proper
database table :)
Hope this helps
--
Richard Allsebrook
Applications and Web Development
"John Negretti" <[EMAIL PROTECTED]> wrote in message
news:47D4D382C169C84AADDC68C0600917992FDD1A@;CSAN0MS01.corp.cox.com...
Hello All,
I am somewhat new to PHP and I have a question relating to FLAT FILE
databases. First let me give an introduction to my question.
I used to work at a company (www.miva.com) where we developed our own
scripting language "Miva Script", so my only experience with PHP was for
comparison and such. The company was not doing so good and was barley
afloat, so I left. In my efforts to find a new scripting language I choose
PHP over ColdFusion, even though Miva Script was so similar to ColdFusion.
I am loving PHP, I never realized just how extensive PHP is. Now I am at a
big company where "red tape" has to be dealt with before I could get access
to a database server. With the Miva Script language it has it's own
built-in database (dBASE-DBF), so databases were never a problem with web
development. So, I am stuck with either using PHP and finding a solution
"or" reverting to Miva Script, which I do NOT want to do, of course I want
to stay with PHP. I have been doing some research on google.com and such
and have not found too much information on PHP with Flat File or DBF
databases. I did find some PHP scripts working with Flat File databases,
but not really what I need. Does anyone have any suggestions, or is PHP
mostly just for MySQL and such.
I am developing some PHP classes/functions that are utilizing "file()" and
"array()" to read and edit my flat files. It's not perfected yet and I am
running into difficulties here and there and this is why am I asking for any
opinions or comments on available resources. When I get done with it I'll
post it for free at www.ideablue.com (my personal site). Well, I do give
thanks in advance for any help.
NOTE: I think PHP is a great language and I do hope to stick with it. There
are many great resources like www.phpbuilder.com, www.phpbeginner.com and
the extensive documentation at www.php.net. Thanks to all that help us new
PHP developers.
John Negretti
Web Applications Developer
Cox Communications www.cox.com
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello John
On 22 October 2002 at 08:59:46 -0700 (which was 16:59 where I live) John
Negretti graced us with these comments
> I am somewhat new to PHP and I have a question relating to FLAT FILE
> databases.
If on a windoz box how about using an com abject (like asp) and link to an
access db !
- --
BBFN, _______________________________________________
David | David Elliott | Software Engineer |
_________________________| [EMAIL PROTECTED] | PGP Key ID 0x650F4534 |
| I never knew Tiamat had so many twin sisters. |
-----BEGIN PGP SIGNATURE-----
Version: 6.5.8ckt http://www.ipgpp.com/
iQA/AwUBPbb5pPmK8eZlD0U0EQKFgwCfe8W51EtWcqw9IB8j9FcT7st52IgAoMq0
1zMUnIb4Jq0r9/zHwlKDGDRQ
=+kEW
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
PHP-nites,
I want to thank you all for your insight on PHP and database options, particularly to
FLAT FILES.
Many of you commented on using MySQL or Oracle and such, commenting how better it
would be. I STRONGLY agree that using MySQL or any DMBS database application is a FAR
better options. Although I am in a situation where I can only use FLAT FILE
databases. I know it is not the best solution, but better than no database at all. I
have looked into your suggestions on using "dbase_create", "php_dbase.dll", "dbm",
"dba", "xml", "com" and such, yet without finding a real solution. So, I am
developing my own custom functions to maintain FLAT FILE databases.
---------------------
EXAMPLES:
---------------------
$conf_array = _FILEDB::Open( '/data/file.txt' );
_FILEDB::Edit( $conf_array, $line_id, $header, $new_value );
_FILEDB::Search( $conf_array, 'LIKE', 'joh*' );
_FILEDB::SearchHeader( $conf_array, 'LIKE', 'FNAME', 'John' );
Well, when I get done I'll post a link to download it for free. I know everyone is
PRO MySQL, so am I. I just think flat files should not be excluded. Again, thank you
all for your help.
John Negretti
> -----Original Message-----
> From: Negretti, John (CCI-San Diego)
> Sent: Tuesday, October 22, 2002 9:00 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP-WIN] PHP and databases? ...without MySQL and such
>
>
> Hello All,
>
> I am somewhat new to PHP and I have a question relating
> to FLAT FILE databases. First let me give an introduction to
> my question.
>
> I used to work at a company (www.miva.com) where we developed
> our own scripting language "Miva Script", so my only
> experience with PHP was for comparison and such. The company
> was not doing so good and was barley afloat, so I left. In
> my efforts to find a new scripting language I choose PHP over
> ColdFusion, even though Miva Script was so similar to
> ColdFusion. I am loving PHP, I never realized just how
> extensive PHP is. Now I am at a big company where "red tape"
> has to be dealt with before I could get access to a database
> server. With the Miva Script language it has it's own
> built-in database (dBASE-DBF), so databases were never a
> problem with web development. So, I am stuck with either
> using PHP and finding a solution "or" reverting to Miva
> Script, which I do NOT want to do, of course I want to stay
> with PHP. I have been doing some research on google.com and
> such and have not found too much information on PHP with Flat
> File or DBF databases. I did find some PHP scripts working
> with Flat File databases, but not really what I need. Does
> anyone have any suggestions, or is PHP mostly just for MySQL and such.
>
> I am developing some PHP classes/functions that are utilizing
> "file()" and "array()" to read and edit my flat files. It's
> not perfected yet and I am running into difficulties here and
> there and this is why am I asking for any opinions or
> comments on available resources. When I get done with it
> I'll post it for free at www.ideablue.com (my personal site).
> Well, I do give thanks in advance for any help.
>
> NOTE: I think PHP is a great language and I do hope to stick
> with it. There are many great resources like
> www.phpbuilder.com, www.phpbeginner.com and the extensive
> documentation at www.php.net. Thanks to all that help us new
> PHP developers.
>
> John Negretti
> Web Applications Developer
> Cox Communications www.cox.com
>
>
> --
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
As for databases based on flat files... i would recoment then the use
and abuse of php array system... which has a basic "find" and is very
flexible...
It isn't perfect, but it will work and it won't be an heavy penalty...
(it will be just a penalty... but will be usable...).
I've done once a flat file database for mantaining a user and group
permission and login system... in ASP... for crying out loud! But... it
worked much better then the existing MS Access database (which worked
nice with all those sql queries... but crashed when two useres requested
the connection at the same time [odbc bugs related with MS Access odbc
drivers], leading to an iisreset)...
The flat file is still working... having been transformed to a C++
component with cryptography and now works even better...
Cheers...
Luis Ferro
TelaDigital
P.S.- scripting languages can be a pain... but to do prototyping they
are sometimes handy... and PHP excels in many aspects and more...
---
[This E-mail scanned for viruses by Declude Virus]
--- End Message ---
--- Begin Message ---
Hi,
CFG: w2k, IIS, php4.0.6 as CGI
I have problem with IIS. It's harcoded to 10 connections. When I do refresh
few times I get error
403.9
Access Forbidden: Too many users are connected Internet Information
Services.
No one is connected (accept me) to this server. Any idea?
Thanks in advance
DAN
--- End Message ---
--- Begin Message ---
It seams you are using a development version of the servers (IIS/W2K) or
you are using IIS in a W2K Professional... both those versions are
hardcoded by microsoft to just serve 10 connections of it's services...
If your script has locked 10 sessions previously, then a iisreset is the
only thing (prior to reboot) to free the locked resources...
Cheers...
Luis Ferro
Sichta Daniel wrote:
Hi,
CFG: w2k, IIS, php4.0.6 as CGI
I have problem with IIS. It's harcoded to 10 connections. When I do refresh
few times I get error
403.9
Access Forbidden: Too many users are connected Internet Information
Services.
No one is connected (accept me) to this server. Any idea?
Thanks in advance
DAN
---
[This E-mail scanned for viruses by Declude Virus]
--- End Message ---
--- Begin Message ---
Youc use xml files as well as an alternative
Richard Allsebrook wrote:
You can use the Microsoft ODBC Text driver to access flat files and perform
SQL Queries on it - can be REALLY slow on big files though (no indexes) :(
Alternatively - write a script that pulls the flat file into a proper
database table :)
Hope this helps
--
Richard Allsebrook
Applications and Web Development
"John Negretti" <[EMAIL PROTECTED]> wrote in message
news:47D4D382C169C84AADDC68C0600917992FDD1A@;CSAN0MS01.corp.cox.com...
Hello All,
I am somewhat new to PHP and I have a question relating to FLAT FILE
databases. First let me give an introduction to my question.
I used to work at a company (www.miva.com) where we developed our own
scripting language "Miva Script", so my only experience with PHP was for
comparison and such. The company was not doing so good and was barley
afloat, so I left. In my efforts to find a new scripting language I choose
PHP over ColdFusion, even though Miva Script was so similar to ColdFusion.
I am loving PHP, I never realized just how extensive PHP is. Now I am at a
big company where "red tape" has to be dealt with before I could get access
to a database server. With the Miva Script language it has it's own
built-in database (dBASE-DBF), so databases were never a problem with web
development. So, I am stuck with either using PHP and finding a solution
"or" reverting to Miva Script, which I do NOT want to do, of course I want
to stay with PHP. I have been doing some research on google.com and such
and have not found too much information on PHP with Flat File or DBF
databases. I did find some PHP scripts working with Flat File databases,
but not really what I need. Does anyone have any suggestions, or is PHP
mostly just for MySQL and such.
I am developing some PHP classes/functions that are utilizing "file()" and
"array()" to read and edit my flat files. It's not perfected yet and I am
running into difficulties here and there and this is why am I asking for any
opinions or comments on available resources. When I get done with it I'll
post it for free at www.ideablue.com (my personal site). Well, I do give
thanks in advance for any help.
NOTE: I think PHP is a great language and I do hope to stick with it. There
are many great resources like www.phpbuilder.com, www.phpbeginner.com and
the extensive documentation at www.php.net. Thanks to all that help us new
PHP developers.
John Negretti
Web Applications Developer
Cox Communications www.cox.com
--- End Message ---
--- Begin Message ---
Darren Henderson <[EMAIL PROTECTED]> wrote... :
> > 1. Anything more than just one single PHP file made in your text editor.
>
> Not sure what you mean by this. If I write a single suite of data handling
> routines then it doesn't matter if I have one or 10,000 pages using it.
I meant a file to write and store the data. A configuration file, for
example.
> > 2. Dynamically modifying your configuration files.
>
> File locks? Not a hard or complicated thing.
But isn't a RDBMS easier and safer at that point? A very big point,
actually.
> > 3. Per-user based configurations like to store things for later,
> > frequent use.
>
> ndbm type solution is much better suited to this unless you have complicated
> querying requirements. And unless you are dealing with many users a simple
> unix type password table or user configuration files is perfectly
> sufficient.
Yes, if you never have to touch individual user's data from within an
admin area. But, if you want to do more things than just loading
variables - you need "querying" each file :)
> > 1. Simpler developing a database in SQL than in some Flat Files logic.
> > This means investment saving.
>
> Sessions are ideal. SQL buys nothing at all but complexity. A shopping cart
> is a list of items - you do not need to do multi-key/foreign key look ups to
> deal with it.
I didn't talk about sessions and multy-key/foreign-key staff yet. All I
want to mention is that, creating a logic between Flat Files is not a
simple thing, and, often, SQL usage will be easier. Unless one doesn't
know SQL at all and take really long time to start using it. Files are
more intuitive, true, but less complex than SQL.
Consider this for displaying an item out:
<?php
$link = mysql_connect("mysql_host", "mysql_user", "mysql_password"));
mysql_select_db("my_shop");
$result = mysql_query("SELECT * FROM products WHERE product_id = $id");
$product = mysql_fetch_array($result, MYSQL_ASSOC))
?>
Againsts this:
<?php
include("/a/huge/file.php");
$product = $data[$id];
?>
Easier with files, no? But, soooo limited... for a shopping cart is not
optimal at all. You will have to be quite experienced to write data in
PHP syntax with a solid logic and locking files. If you are, then your
experience will tell you - just get a DB, it's better.
> So.... if you've written your applications correctly
Let me cut it here: if one writes an application correctly - it means it
will write it with a DB, not flat files for a shopping cart.
> I would much rather worry about that then worry about backing up data bases,
every RDBMS has such utility.
> checking to make sure I can talk to the db
What about checking to make sure file is still writable (by anything on
the server?)
> dealing with network outages
Not always a need.
> dealing with speed issues,
RDBMS is faster in most cases, and, even if not then the downgrade
rarely goes over 1-10 milliseconds for things accomplishable also with
Flat Files.
> especially in a heavily shared environment as
> exists in most/many hosting companies.
believe me, files are worth in these cases :)
> Until recently MySQL didn't have transaction protection. In many hosting
> environements it isn't offered. If you are not using the roll back
> capabilities of the latest versions of MySQL then you do not have data
> integrity.
Data integrity is not only everything we hear about Oracle and what
mySQL only now is trying to implement. Data Integrity is also knowing
that the data is controlled by an application specialized in that.
If you need a real data integrity look for PostgreSQL that is Open
Source (or expensive Oracle which is the maximum of Data Integrity
logistics).
> The password needs to be stored somewhere on the file system - there is no
> advantage here. I wold hope you are protecting accounts and files with
> appropriate file permissions.
You are right about this. But, theoretically, it is still easier to
steal a folder than a DB.
> If you have complicated searches over a lot of data then yes, a data base is
> appropriate. I didn't say it was never the way to go. But - I would take
> issue with this statement. "a little search" on a few variables is almost
> always going to be faster in a flat file unless you are refering to finding
> a few records based on a key.
If you ever write files, then at least write PHP files that can be
simply included and referred by array keys. Then yes - files are faster.
But, if data is big than not.
Database is also portable, and portability is VERY important in
programming.
> > Conclusion:
> >
> > 1. Flat files - for site configurations
> > 2. Database - for data manipulations
>
> Databases are suitable for situations where you have a large amount of
> complex data that you must do complex operations on. The trade off will be
> the extra maintenace you must do and the additional potential points of
> failure you must contend with.
But truly, the one that knows to handle files well normally has no
problems writing SQL either and/or keeping a DB server up. Be reasonable.
> My contention is that the statement "always use a database" is not the best
> advice.
My contention is: "always use a database as the base for your data"
or
"Always use 'files' to store the things to include in files"
--
Maxim Maletsky
[EMAIL PROTECTED]
www.PHPBeginner.com // PHP for Beginners
www.maxim.cx // my Home
// my Wish List: ( Get me something! )
http://www.amazon.com/exec/obidos/registry/2IXE7SMI5EDI3
--- End Message ---
--- Begin Message ---
The documentation for IndexIgnore follows. Its pretty simple. Which bit
dont you understand ?
Use regular expressions to filter files so they are not shown in an index :
An Example might be
IndexIgnore *.js *.gif *.jp?g
One line - simple :-)
Put this is your .htaccess file for a direcrtory until you are happy with
how it works - its much easier and less risky than editing the global
httpd.conf file
Other alternative is to add an index file which simply has an HTTP redirect
to the main page of your site.
Cheers,
Neil Smith.
==============
IndexIgnore directive
Syntax: IndexIgnore file [file] ...
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_autoindex
The IndexIgnore directive adds to the list of files to hide when listing a
directory. File is a file extension, partial filename, wildcard expression
or full filename for files to ignore. Multiple IndexIgnore directives add
to the list, rather than replacing the list of ignored files. By default,
the list contains `.'.
Example: IndexIgnore README .htaccess *~
========================
At 14:05 23/10/2002 +0000, you wrote:
Message-ID: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
From: "Aidal" <[EMAIL PROTECTED]>
Date: Wed, 23 Oct 2002 12:36:28 +0200
Subject: Apache - simple question (IndexIgnore)
Hi NG.
I know this NG is suppose to be about PHP but...
Assuming that most of us people reading this NG uses Apache, I have a simple
question concerning 'IndexIgnore' in 'httpd.conf'.
When typing some http-address to a place under htdocs like
http://localhost/somedir/ which does not have an index file to load, the
server will list the files in the dir, but there is of cause some files
which isn't very wise to list.
Say I have some files containing classes or other code in some *.inc files,
I want to server to hide these when listing files in dir.
Apache has the 'IndexIgnore' to set these things from what I've read, but I
can't get this to work properly.
The current setting in my 'httpd.conf' is the folowing:
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
I'm not sure exactly what that means, though I've read the documentation on
IndexIgnore I still dont get the syntax.
Can anyone tell me how I do this?
Do I add a new line with 'IndexIgnore <some parameters>' ?
Or do I add '<some parameters>' to the existing 'IndexIgnore' ?
In any case, what would the syntax be for ignoring *.php and *.inc files
when listing?
Regards
~ Aidal
--- End Message ---
--- Begin Message ---
All,
I have the 1.3.12 version of Apache installed (via an Oracle install -- no
source) on a Win 2000 system and I have downloaded the manual verion of PHP
(not the Windows Installer). I configured PHP via the SAPI method and
everything works great, including access to SQLServer and Access (ODBC),
until I uncomment the php_oci8.dll line in PHP.INI. The Apache service
(which has a different name because of Oracle, but still seems to be
APACHE.EXE) fails to start. It hangs and the Service Control panel reports
that it failed to start.
1) How can I figure out where the actual problem is occuring?
2) Can I test the PHP install independant of Apache to prove that it is an
Apache issue and not a PHP issue?
3) What special issues are there with OCI8 and PHP?
Thank you for your help,
Kurt Lund
--- End Message ---
--- Begin Message ---
Dear all,
I have a piece of code which posts a matrix which can be from 1X1
dimension to...the sky is the limit (can be 500X500). In this piece of
code I have 2 while loops, nested, which I cannot get rid of..
I'd like to ask you for any suggestions to optimize the posting of the
matrix..I already put in action zend optimizer, ---with mm option...
Where/what should I tweak more, in order to make the whole thing faster. I
am running the system on Win 2k, therefore I cannot use Zend accelerator.
Thanks.
Mihai
--- End Message ---
--- Begin Message ---
I have just recently installed php on windows 2000 running IIS 5.0. on two
different machines.
the first went flawlessly. The second seemed to proceed just the same,
however, I have a problem.
I created the standard test:
<?php
phpinfo();
?>
this works fine.
when i hit the refresh button on my browser, i get back a simple if
completely useless message:
The directory name is invalid.
more specifically, the message is :
"<html><head><title>Error</title></head><body>The directory name is invalid.
</body></html>"
I have no idea what is generating this error. I have the same php.ini on
both systems, the same security settings the same directory structure, I
think the same configuration in IIS, but it only works on one installation!
Thanks for any pointers you can give me.
Chad Cotton
--- End Message ---