php-general Digest 6 Sep 2010 20:23:55 -0000 Issue 6927
Topics (messages 307861 through 307874):
Re: Error in initialising XML parser
307861 by: a...@ashleysheridan.co.uk
307862 by: Sridhar Pandurangiah
307863 by: Sridhar Pandurangiah
PHP Modular application
307864 by: Abah Joseph
Hi
307865 by: Jordan Jovanov
307866 by: kranthi
307867 by: chris h
307868 by: Richard Quadling
307869 by: a...@ashleysheridan.co.uk
307870 by: Richard Quadling
307871 by: a...@ashleysheridan.co.uk
307872 by: chris h
workflow system design
307873 by: gato chlr
Re: PHP, Soap, and WDSL
307874 by: SBS Computers
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
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-gene...@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
--- End Message ---
--- Begin Message ---
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-gene...@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
--- End Message ---
--- Begin Message ---
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-gene...@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
--- End Message ---
--- Begin Message ---
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.
--- End Message ---
--- Begin Message ---
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.
--- End Message ---
--- Begin Message ---
use some thing like http://uploadify.com
u can always check for the uploaded file extension/mime-type on the server side
--- End Message ---
--- Begin Message ---
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.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
>
>
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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-gene...@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
--- End Message ---
--- Begin Message ---
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-gene...@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
--- End Message ---
--- Begin Message ---
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-gene...@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-gene...@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
--- End Message ---
--- Begin Message ---
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.
>
--- End Message ---
--- Begin Message ---
Hi, i know it is not the right place, but, does anybody know a workflow
system development process? or methodology?
thanks!
--- End Message ---
--- Begin Message ---
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:Body><response 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-gene...@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-gene...@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
> >
> >
--- End Message ---