[PHP] Error in initialising XML parser

2010-09-06 Thread Sridhar Pandurangiah

Hi

I am writing a PHP snippet to display invoices that is generated by 
another computer application. The use case is as follows


1. The other computer application generates the invoices for the month 
in XML and puts it in a common dirctory. So at anytime there could be 
multiple files. Each file contains several invoices. These invoices are 
for different vendors.
2. My PHP snippet will list all the files in the directory. I have got 
this part right after a lot of research, phew! It displays only xml 
files and keeps out the others like files begining with . (dot) etc. 
This is listed as a series of checkboxes so that the user can view the 
list of invoices available. Once the user clicks on the checkboxes I 
POST the file name to the server with the following code


$BillLocation = /home/cmi/Integration/xml_files;
$StyleSheet = Bill.xsl;
$DirHandle = opendir($BillLocation);

if ($_POST['_submit_check'])
{
$MyBill = new Displaybill($_POST[BillChosen]);
$MyBill-parse($_POST[BillChosen]);
$MyBill-Show_Bill($MemberId, $StyleSheet);
}
{
$result = List_Directory($DirHandle);

}

I get a following error Fatal error: Class 'Displaybill' not found in 
/home/sridhar/Sastra/2010-ClubMan-Integration/ListAvailableBills.php on 
line 15


I have the Displaybill class in the same location as the other file 
still PHP is not able to locate it. What could be wrong? Any help would 
be appreciated.


Running the whole thing on localhost with the vhosts configured to teh 
above directory.


Best regards

Sridhar

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



Re: [PHP] Error in initialising XML parser

2010-09-06 Thread a...@ashleysheridan.co.uk
PHO won't automatically include a class file by default. You either need to 
manually include it with a require, include it or require_once line, or use an 
automagical include script. As it stands, you're getting the error because php 
doesn't know where your class is.

Thanks,
Ash
http://www.ashleysheridan.co.uk

- Reply message -
From: Sridhar Pandurangiah sridharpa...@gmail.com
Date: Mon, Sep 6, 2010 09:12
Subject: [PHP] Error in initialising XML parser
To: php-general@lists.php.net

Hi

I am writing a PHP snippet to display invoices that is generated by 
another computer application. The use case is as follows

1. The other computer application generates the invoices for the month 
in XML and puts it in a common dirctory. So at anytime there could be 
multiple files. Each file contains several invoices. These invoices are 
for different vendors.
2. My PHP snippet will list all the files in the directory. I have got 
this part right after a lot of research, phew! It displays only xml 
files and keeps out the others like files begining with . (dot) etc. 
This is listed as a series of checkboxes so that the user can view the 
list of invoices available. Once the user clicks on the checkboxes I 
POST the file name to the server with the following code

$BillLocation = /home/cmi/Integration/xml_files;
$StyleSheet = Bill.xsl;
$DirHandle = opendir($BillLocation);

if ($_POST['_submit_check'])
{
$MyBill = new Displaybill($_POST[BillChosen]);
$MyBill-parse($_POST[BillChosen]);
$MyBill-Show_Bill($MemberId, $StyleSheet);
}
{
$result = List_Directory($DirHandle);

}

I get a following error Fatal error: Class 'Displaybill' not found in 
/home/sridhar/Sastra/2010-ClubMan-Integration/ListAvailableBills.php on 
line 15

I have the Displaybill class in the same location as the other file 
still PHP is not able to locate it. What could be wrong? Any help would 
be appreciated.

Running the whole thing on localhost with the vhosts configured to teh 
above directory.

Best regards

Sridhar

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



Re: [PHP] Error in initialising XML parser

2010-09-06 Thread Sridhar Pandurangiah

Thanks, PHP is now able to include the class file

Best regards

 Original Message 
Subject: Re: [PHP] Error in initialising XML parser
From: a...@ashleysheridan.co.uk (a...@ashleysheridan.co.uk)
To:
Date: Mon Sep 06 2010 13:56:39 GMT+0530 (IST)


PHO won't automatically include a class file by default. You either need to 
manually include it with a require, include it or require_once line, or use an 
automagical include script. As it stands, you're getting the error because php 
doesn't know where your class is.

Thanks,
Ash
http://www.ashleysheridan.co.uk

- Reply message -
From: Sridhar Pandurangiah sridharpa...@gmail.com
Date: Mon, Sep 6, 2010 09:12
Subject: [PHP] Error in initialising XML parser
To: php-general@lists.php.net

Hi

I am writing a PHP snippet to display invoices that is generated by 
another computer application. The use case is as follows


1. The other computer application generates the invoices for the month 
in XML and puts it in a common dirctory. So at anytime there could be 
multiple files. Each file contains several invoices. These invoices are 
for different vendors.
2. My PHP snippet will list all the files in the directory. I have got 
this part right after a lot of research, phew! It displays only xml 
files and keeps out the others like files begining with . (dot) etc. 
This is listed as a series of checkboxes so that the user can view the 
list of invoices available. Once the user clicks on the checkboxes I 
POST the file name to the server with the following code


$BillLocation = /home/cmi/Integration/xml_files;
$StyleSheet = Bill.xsl;
$DirHandle = opendir($BillLocation);

if ($_POST['_submit_check'])
{
$MyBill = new Displaybill($_POST[BillChosen]);
$MyBill-parse($_POST[BillChosen]);
$MyBill-Show_Bill($MemberId, $StyleSheet);
}
{
$result = List_Directory($DirHandle);

}

I get a following error Fatal error: Class 'Displaybill' not found in 
/home/sridhar/Sastra/2010-ClubMan-Integration/ListAvailableBills.php on 
line 15


I have the Displaybill class in the same location as the other file 
still PHP is not able to locate it. What could be wrong? Any help would 
be appreciated.


Running the whole thing on localhost with the vhosts configured to teh 
above directory.


Best regards

Sridhar



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



[PHP] PHP Modular application

2010-09-06 Thread Abah Joseph
I appreciate you all. the php community is a wonderful community.

i`m developing an application that i need to support plugin for
additional features, i have used joomla and prestashop. i love the way
module interface on prestashop and i have been looking into the
classes but i did not understand the theory behind the module
positioning.

All modules must define at least a position, the position may need to
exists inside the template where the module will be displayed.

second, assume i have a registration form with 10 Fields matching 10
Fields in a table and later i want to add like 5 more Fields, did i
need to alter the table and my scripts again? or a plugin should take
care of that, i need some theory to take care of such situation.

Thank you in advance.

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



[PHP] Hi

2010-09-06 Thread Jordan Jovanov

Hi All

I need me a little help.
I create scripte for upload file is work very good but the problem is next:
I neet to upload only .zip file i need to disable some user to shoise to 
upload another file Extensions.


Can somebody help me.

Thanks a lot.

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



Re: [PHP] Hi

2010-09-06 Thread kranthi
use some thing like http://uploadify.com


u can always check for the uploaded file extension/mime-type on the server side

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



Re: [PHP] Hi

2010-09-06 Thread chris h
You can check the extension of the uploaded file
http://www.php.net/manual/en/features.file-upload.post-method.php


But to be sure that it's truly a zip file you could actually open the file
with php's zip function.
http://php.net/manual/en/ref.zip.php


Chris.


On Mon, Sep 6, 2010 at 9:46 AM, Jordan Jovanov jovanovj...@gmail.comwrote:

 Hi All

 I need me a little help.
 I create scripte for upload file is work very good but the problem is next:
 I neet to upload only .zip file i need to disable some user to shoise to
 upload another file Extensions.

 Can somebody help me.

 Thanks a lot.

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




Re: [PHP] Hi

2010-09-06 Thread Richard Quadling
On 6 September 2010 14:46, Jordan Jovanov jovanovj...@gmail.com wrote:
 Hi All

 I need me a little help.
 I create scripte for upload file is work very good but the problem is next:
 I neet to upload only .zip file i need to disable some user to shoise to
 upload another file Extensions.

 Can somebody help me.

 Thanks a lot.

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



Using standard HTML ... no. There is nothing in the input type=file
element to instantly limit the file type. You can use JavaScript to
some degree (http://www.codestore.net/store.nsf/unid/DOMM-4Q8H9E for
example).

As far as PHP goes, one of the values returned to you is the
$_FILES['userfile']['type'] property.

If this matches the zip file mime type (application/x-zip but also
application/x-gzip and maybe multipart/x-gzip, multipart/x-zip), then
you have a better chance of knowing it is a zip file.
-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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



Re: [PHP] Hi

2010-09-06 Thread a...@ashleysheridan.co.uk
I think you should not focus so much on the file extension, as that is mostly 
meaningless if someone wanted to attack your system.

Instead, you could wrap a call to the command line 'file' command, which gives 
mostly accurate information about a file. Basically it reads the first few 
bytes to see it is what it expected. There is a php wrapper for this, but I 
forget what its called just now.

If you do need to just grab a file extension though, you can do it with a call 
to pathinfo() with the 2nd argument of PATHINFO_EXTENSION.

Thanks,
Ash
http://www.ashleysheridan.co.uk

- Reply message -
From: Jordan Jovanov jovanovj...@gmail.com
Date: Mon, Sep 6, 2010 14:46
Subject: [PHP] Hi
To: php-general@lists.php.net
Cc: jovanovj...@gmail.com


Hi All

I need me a little help.
I create scripte for upload file is work very good but the problem is next:
I neet to upload only .zip file i need to disable some user to shoise to 
upload another file Extensions.

Can somebody help me.

Thanks a lot.

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



Re: [PHP] Hi

2010-09-06 Thread Richard Quadling
On 6 September 2010 15:04, a...@ashleysheridan.co.uk
a...@ashleysheridan.co.uk wrote:
 I think you should not focus so much on the file extension, as that is mostly 
 meaningless if someone wanted to attack your system.

 Instead, you could wrap a call to the command line 'file' command, which 
 gives mostly accurate information about a file. Basically it reads the first 
 few bytes to see it is what it expected. There is a php wrapper for this, but 
 I forget what its called just now.

 If you do need to just grab a file extension though, you can do it with a 
 call to pathinfo() with the 2nd argument of PATHINFO_EXTENSION.

 Thanks,
 Ash
 http://www.ashleysheridan.co.uk

 - Reply message -
 From: Jordan Jovanov jovanovj...@gmail.com
 Date: Mon, Sep 6, 2010 14:46
 Subject: [PHP] Hi
 To: php-general@lists.php.net
 Cc: jovanovj...@gmail.com


 Hi All

 I need me a little help.
 I create scripte for upload file is work very good but the problem is next:
 I neet to upload only .zip file i need to disable some user to shoise to
 upload another file Extensions.

 Can somebody help me.

 Thanks a lot.

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



How is the ['type'] arrived at within PHP. Is this supplied by the web
server? Or does PHP have to work it out before passing it to userland
code?

Either way, is it not accurate enough?

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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



Re: [PHP] Hi

2010-09-06 Thread a...@ashleysheridan.co.uk
As far as I can remember It's supplied by the client user agent, hence the big 
issue with jpeg images uploaded by IE, as it uses a different type to all the 
other browsers.

Thanks,
Ash
http://www.ashleysheridan.co.uk

- Reply message -
From: Richard Quadling rquadl...@gmail.com
Date: Mon, Sep 6, 2010 16:13
Subject: [PHP] Hi
To: a...@ashleysheridan.co.uk a...@ashleysheridan.co.uk
Cc: Jordan Jovanov jovanovj...@gmail.com, php-general@lists.php.net


On 6 September 2010 15:04, a...@ashleysheridan.co.uk
a...@ashleysheridan.co.uk wrote:
 I think you should not focus so much on the file extension, as that is mostly 
 meaningless if someone wanted to attack your system.

 Instead, you could wrap a call to the command line 'file' command, which 
 gives mostly accurate information about a file. Basically it reads the first 
 few bytes to see it is what it expected. There is a php wrapper for this, but 
 I forget what its called just now.

 If you do need to just grab a file extension though, you can do it with a 
 call to pathinfo() with the 2nd argument of PATHINFO_EXTENSION.

 Thanks,
 Ash
 http://www.ashleysheridan.co.uk

 - Reply message -
 From: Jordan Jovanov jovanovj...@gmail.com
 Date: Mon, Sep 6, 2010 14:46
 Subject: [PHP] Hi
 To: php-general@lists.php.net
 Cc: jovanovj...@gmail.com


 Hi All

 I need me a little help.
 I create scripte for upload file is work very good but the problem is next:
 I neet to upload only .zip file i need to disable some user to shoise to
 upload another file Extensions.

 Can somebody help me.

 Thanks a lot.

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



How is the ['type'] arrived at within PHP. Is this supplied by the web
server? Or does PHP have to work it out before passing it to userland
code?

Either way, is it not accurate enough?

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY


Re: [PHP] Hi

2010-09-06 Thread chris h
On Mon, Sep 6, 2010 at 1:45 PM, chris h chris...@gmail.com wrote:

 Per PHPdocs on $_FILES['userfile']['type']...

 The mime type of the file, if the browser provided this information. An
 example would be image/gif. This mime type is however not checked on the
 PHP side and therefore don't take its value for granted.


 Personally I like to use the file right off-the-bat to ensure it's safe.
  So if it's an image do some kind of image manipulation function on it, if
 it's zip then use some zip functions on it (i.e. if you can read data from a
 zip file using a zip function then it's probably a real zip file).  It can
 be slow, but handling user uploaded files is so dangerous that I think it's
 typically the way to go.


 Chris.



[PHP] workflow system design

2010-09-06 Thread gato chlr
Hi, i know it is not the right place, but, does anybody know a workflow
system development process? or methodology?
thanks!


RE: [PHP] PHP, Soap, and WDSL

2010-09-06 Thread SBS Computers

One more question. How would I parse the data below so that I only display the 
section - information=info_2

I've read a few articles on xml name spaces and none have helped.

?xml version=1.0 encoding=utf-16?soap:Envelope 
xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; 
xmlns=http://nowhere.com/wsdl;soap:Bodyresponse status=complete 
version=46 resource_type=data_1 ns=username op_type=get_data
 data_1 id=ID 1 information=info_2/
 
/response/soap:Body/soap:Envelope


I tried the following which give me an error in foreach

$test2 = simplexml_load_file('file.xml')
or die(Error: Cannot create object);


$test = $test2-xpath('Envelope/Body/response/data_1/@information');

foreach($test as $test)
{
echo $test.PHP_EOL;
}




From: sbs_comput...@hotmail.com
To: chris...@gmail.com; jang...@jangita.com
CC: php-general@lists.php.net
Subject: RE: [PHP] PHP, Soap, and WDSL
Date: Fri, 3 Sep 2010 09:05:52 -0400








Thanks guys.

Both methods worked.

Gino

 Date: Fri, 3 Sep 2010 08:31:06 -0400
 From: chris...@gmail.com
 To: jang...@jangita.com
 CC: php-general@lists.php.net
 Subject: Re: [PHP] PHP, Soap, and WDSL
 
 Alternatively you can pass the var through htmlspecialchars...
 
  echo htmlspecialchars( $response );
 
 
 and for a really simple solution you can echo it inside a textarea...
 
  echo textarea $response /textarea;
 
 
 Though you'll likely want to increase the size of the textarea!  ;-)
 
 
 
 
 Chris.
 
 
 
 On Fri, Sep 3, 2010 at 3:39 AM, Jangita jang...@jangita.com wrote:
 
  On 02/09/2010 10:51 p, SBS Computers wrote:
 
   It's as if the data is not getting to my php page?
 
  The view source shows the following data:
 
  ?xml version=1.0 encoding=utf-16?soap:Envelope xmlns:soap=
  http://schemas.xmlsoap.org/soap/envelope/;
  .
  .
  .bunch of data
  .
  .
  /response/soap:Body/soap:Envelope
 
   Seems like the data is getting there OK. But a browser normally will not
  output normal xml and hides it (unless there is a body / tag or other tags
  that normally display output since it is using the text/html MIME
 
  add this line
 
  header('Content-type: text/plain');
 
  before the echo and see what happens. Also make sure there is no other
  output (echo or any html tags) before the line above
 
  --
  Jangita | +256 76 91 8383 | Y!  MSN: jang...@yahoo.com
  Skype: jangita | GTalk: jangita.nyag...@gmail.com
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  

Re: [PHP] Multiple Login in a single PC should not be possible

2010-09-06 Thread Karl DeSaulniers

@Jagdeep Singh

Hi Jagdeep,
I know it has been a while now, but I thought I'd let you know.
Setting up a database with a session login and some checks and  
balances will allow you to do
what you were wanting with controlling a user using multiple browsers  
on the same machine.
I just finished my login system and it is set up with a session that  
checks the login status of a user
on every page they go to. I was testing to see how some css was  
working on one of the user info pages,
and so I was already logged into the account on safari, I then went  
to Opera and Firefox and tried to view the page I
was on and they told me I was not logged in. I also tried logging in  
on those browsers and it did not let me.
Hence, I know now it is possible to achieve the results your looking  
for.
I just built a query to an ACTIVE_USERS table in my database on the  
login page and a session check when each page was visited.
When a user successfully logs into the system, their username and  
time of login get stamped in this ACTIVE_USERS table for you to check  
against.
You could even put a field in this table that stamps what page they  
are on. JAT



Don't know if you still need help with this or not, but thought I'd  
let you know what I found out.


Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com


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



Re: [PHP] Multiple Login in a single PC should not be possible

2010-09-06 Thread Robert Cummings

On 10-09-07 01:21 AM, Karl DeSaulniers wrote:

@Jagdeep Singh

Hi Jagdeep,
I know it has been a while now, but I thought I'd let you know.
Setting up a database with a session login and some checks and
balances will allow you to do
what you were wanting with controlling a user using multiple browsers
on the same machine.
I just finished my login system and it is set up with a session that
checks the login status of a user
on every page they go to. I was testing to see how some css was
working on one of the user info pages,
and so I was already logged into the account on safari, I then went
to Opera and Firefox and tried to view the page I
was on and they told me I was not logged in. I also tried logging in
on those browsers and it did not let me.
Hence, I know now it is possible to achieve the results your looking
for.
I just built a query to an ACTIVE_USERS table in my database on the
login page and a session check when each page was visited.
When a user successfully logs into the system, their username and
time of login get stamped in this ACTIVE_USERS table for you to check
against.
You could even put a field in this table that stamps what page they
are on. JAT


Don't know if you still need help with this or not, but thought I'd
let you know what I found out.


If I recall this thread from several months ago... the issue is not 
detecting that a single user is logged in multiple times (this is known 
to be trivial - congratulations you've solved a solved problem), but 
that a person is logged in from one computer multiple times (whether it 
be via different browsers or virtual machines) where the logged in 
account is not necessarily the same user account in each logged in instance.


Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

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