[PHP] dbase verify

2002-10-28 Thread Plamen Slavov
Does anyone know if there is a way to tell if a given file is a valid dbase file, 
using PHP functions ?


Re: [PHP] dbase verify

2002-10-28 Thread Marek Kilimajer
Filetypes are usualy recognized by first 4 bytes (or so), so you need to 
find out what these bytes should be
for dbase files

Plamen Slavov wrote:

Does anyone know if there is a way to tell if a given file is a valid dbase file, using PHP functions ?
 



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




[PHP] PHP dBASE connectivity

2002-07-04 Thread labhras sammin

Hi I need to use PHP (ver 4 windows) to add a record to a dBase iv database.

I can  create, open, read and close a database but when I try to add a
record I always get  the following error:
Warning: unexpected error in C:\php\phpstuff\addTest1.php on line 23

Here is the code [shortened] that I use to create the database table, open
the table, create the record and add the record- the database table has one
field a 10 char string:

$dbname = test1.dbf;
$dbflag = 2;
$def = array( array(name, C,  10));
dbase_create($dbname, $def));
$db_num = dbase_open($dbname, $dbflag);
$new_record['name'] = 'xx';
dbase_add_record ($db_num, $new_record);

any help, advice or code samples would be very appreciated
thanks
Labhras




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




[PHP] Re: [PHP-DB] PHP dBASE connectivity

2002-07-04 Thread Miles Thompson

1. Please don't cross post.
2. Which line is #23?
3. Have you tested to ensure that you have a valid handle? ($db_num)
4. Have you tried adding error code to see the result of dbase_create(), 
dbase_open()
5. I seem to remember reading in the docs, a long time ago (2 yr) that the 
dbase functions were not really reliable and were intended mostly to 
extract info for export to another database. I could not be 100% wrong on 
that, and I've not worked with the dbase functions in PHP.

After this reply, please keep this focused on the php-db list.

Regards - Miles Thompson

At 12:14 PM 7/4/2002 +0100, labhras sammin wrote:
Hi I need to use PHP (ver 4 windows) to add a record to a dBase iv database.

I can  create, open, read and close a database but when I try to add a
record I always get  the following error:
Warning: unexpected error in C:\php\phpstuff\addTest1.php on line 23

Here is the code [shortened] that I use to create the database table, open
the table, create the record and add the record- the database table has one
field a 10 char string:

$dbname = test1.dbf;
$dbflag = 2;
$def = array( array(name, C,  10));
dbase_create($dbname, $def));
$db_num = dbase_open($dbname, $dbflag);
$new_record['name'] = 'xx';
dbase_add_record ($db_num, $new_record);

any help, advice or code samples would be very appreciated
thanks
Labhras




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



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




[PHP] Re: [PHP-DB] PHP dBASE connectivity

2002-07-04 Thread labhras sammin

thanks for your help
I have tested that everything works, valid handles, returned method values,
etc.
Line 23 is the dbase_add_record line. Do you know of anywhere there may be
an example
thanks Labhras


Miles Thompson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 1. Please don't cross post.
 2. Which line is #23?
 3. Have you tested to ensure that you have a valid handle? ($db_num)
 4. Have you tried adding error code to see the result of dbase_create(),
 dbase_open()
 5. I seem to remember reading in the docs, a long time ago (2 yr) that the
 dbase functions were not really reliable and were intended mostly to
 extract info for export to another database. I could not be 100% wrong on
 that, and I've not worked with the dbase functions in PHP.

 After this reply, please keep this focused on the php-db list.

 Regards - Miles Thompson

 At 12:14 PM 7/4/2002 +0100, labhras sammin wrote:
 Hi I need to use PHP (ver 4 windows) to add a record to a dBase iv
database.
 
 I can  create, open, read and close a database but when I try to add a
 record I always get  the following error:
 Warning: unexpected error in C:\php\phpstuff\addTest1.php on line 23
 
 Here is the code [shortened] that I use to create the database table,
open
 the table, create the record and add the record- the database table has
one
 field a 10 char string:
 
 $dbname = test1.dbf;
 $dbflag = 2;
 $def = array( array(name, C,  10));
 dbase_create($dbname, $def));
 $db_num = dbase_open($dbname, $dbflag);
 $new_record['name'] = 'xx';
 dbase_add_record ($db_num, $new_record);
 
 any help, advice or code samples would be very appreciated
 thanks
 Labhras
 
 
 
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





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




[PHP] dbase

2002-05-21 Thread eoghan

anyone ther eused dbase with php.
was looking for best pratices on 
searching... any code snippets appreciated.

thanks...



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




[PHP] Apache+suEXEC+php+dbase

2001-05-23 Thread JUANG

hi...
how do i use dbf_open() function or other dbf functions in php with apache+suexec? my 
php script is
?
$dbfile=kasbon.dbf;
$db =dbase_open($dbfile, 0);
$rec = dbase_get_record($db, 2);
$nf  = dbase_numfields($db);
for ($i=0; $i  $nf; $i++) {
print $rec[$i].br\n;
}
?

it worked if i changed mode to 777 *.dbf but.. if mode is 700 it couldn't work. i 
use apache+suexec with virtual host .
i.e:
VirtualHost 192.168.1.100
DocumentRoot /home/httpd/html
ServerName master.mydomain.com
/VirtualHost
VirtualHost 192.168.1.101
DocumentRoot /home/hosting/dev1
ServerName dev1.mydomain.com
User dev1
Group hosting
/VirtualHost
--

for domain master: master.mydomain.com
in directory /home/httpd/html/dbf 
==all *.dbf files are 700 
==all *.dbf files i was change the owner to chown dev1:hosting *.dbf
http://master.mydomain.com/masterdbf/dbf_open.php it work if user=dev1 and 
group=hosting in my httpd.conf


for domain dev1: dev1.mydomain.com
in directory /home/hosting/dev1/dbf 
==all *.dbf files are 700 == chmod 700 *.dbf
==all *.dbf files was changed to  dev1:hosting  == chown dev1:hosting *.dbf
http://dev1.mydomain.com/index.php -- it work returned info of php
http://dev1.mydomain.com/dbf/dbf_open.php didn't work 

why? even i changed the mode and owner of *.dbf files it still didn't work? and in 
error log of my apache there was no error about suexec. help 
please
-JUANG-




[PHP] dbase functions still supported?

2001-03-20 Thread Don Pro

Hi,

Using PHP 4.04pl1

I am getting an error executing the dbase_create function. Th elines of
code are:

if (!dbase_create($export_file, $dbf_def))
  echo "Error creating DBF file";

my error message is:

Fatal error:  Call to undefined function:  dbase_create() in my_prog.
php on line 59

I found this function in the PHP docs. Is it still supported?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] dbase function howtos/faq

2001-02-17 Thread Robert L. Yelvington


i am having some issues with dbf files...some fields are being displayed
correctly, some are not.

can someone direct me to a howto or faq that might address these and
other dbf issues?

thanx,
-robt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] DBase functions

2001-01-22 Thread Piotr Duszynski

I have a problem connecting to dbase database. I use:
dbase_open("filename.dbf",0) and get from PHP:
Fatal error: Call to unsupported or undefined function dbase_open() in ...

What's the problem?

-- 

Piotr Duszynski

http://www.softomat.com.pl
http://filmomat.3miasto.pl 
http://www.3miasto.pl

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] DBase functions

2001-01-22 Thread Brian Clark


Hello Piotr, 

(PD == "Piotr Duszynski") [EMAIL PROTECTED] writes:

PD Fatal error: Call to unsupported or undefined function
PD dbase_open() in ...

PD What's the problem?

You'll probably need to re./configure PHP with the --enable-dbase
option.

-Brian



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]