php-windows Digest 15 May 2009 14:55:05 -0000 Issue 3622

Topics (messages 29327 through 29332):

Re: Problem with DOM
        29327 by: Niel Archer
        29328 by: Bellemo Maurizio
        29329 by: Niel Archer
        29330 by: Niel Archer
        29331 by: Niel Archer

Debug PHP , Write Every Action (and not just errors debug related) into a file
        29332 by: onemancrew

Administrivia:

To subscribe to the digest, e-mail:
        php-windows-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-windows-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-wind...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
> Hi all,
> 
> I'm trying to create some XML from PHP code to save data about customers, but 
> I found many problem and it doesn't work.
> 
> The class Customer is quite simple I put it right below
> 
> <?php
> 
> class customer {
>         var $name;
>         var $phone;
> 
>         function customer($name, $phone) {
>                 $this->name = $name;
>                 $this->phone = $phone;
>         }
> 
>         function getName() {
>                 return $name;
>         }
> 
>         function setName($name) {
>                 $this->name = $name;
>         }
> 
>         function getPhone() {
>                 return $phone;
>         }
> 
>         function setPhone($phone) {
>                 $this->phone = $phone;
>         }
> 
>         function addXMLCustomer($dom, $root) {
>                 $customer = $dom->createElement('customer');
> 
>                 $name_at = $dom->createAttribute('name');
>                 $customer->appendChild($name_at);
>                 $name_at_val = $dom->createTextNode($this->name);
>                 $name_at->appendChild($name_at_val);
> 
>                 $phone_at = $dom->createAttribute('phone');
>                 $customer->appendChild($phone_at);
>                 $phone_at_val = $dom->createTextNode($this->phone);
>                 $phone_at->appendChild($phone_at_val);
> 
>                 $root->appendChild($customer);
> 
>         }
> }
> 
> ?>
> 
> the main page is simply a little form asking to introduce a new customer.... 
> (the problem is not when you try to create the XML file for the first time, 
> but something on getElementsByTagName, that is when you try to reopen the 
> file... for example for a second customer....
> 
> <html>
> <head>
> <title>MCare administration</title>
> <script type="text/javascript" 
> src="script/scriptaculous-js-1.8.2/prototype.js"></script>
> <script type="text/javascript" 
> src="script/scriptaculous-js-1.8.2/scriptaculous.js"></script>
> </head>
> <?php
> // require class file
> require("customer.php");
> 
> $xmlfile = "C:/Users/Maurizio/Desktop/customers.xml";
> 
> if(!file_exists($xmlfile)) {
>         $doc = new DOMDocument('1.0', 'iso-8859-1');
>         $root = $doc->createElement('customers');
>         $doc->appendChild($root);
> 
>         if (isset($_GET['add_customer']) && isset($_GET['new_customer_name'])
>                 && isset($_GET['new_customer_phone'])) {
>                 $c = new customer($_GET['new_customer_name'], 
> $_GET['new_customer_phone']);
>                 $c->addXMLCustomer($doc, $root);
>         }
>         $doc->save($xmlfile);
> }
> else {
>         $doc = new DOMDocument();
>         $doc->load($xmlfile);
>         $root = $doc->getElementsByTagName("customers");
>         if (isset($_GET['add_customer']) && isset($_GET['new_customer_name'])
>                 && isset($_GET['new_customer_phone'])) {
>                 $c = new customer($_GET['new_customer_name'], 
> $_GET['new_customer_phone']);
>                 $c->addXMLCustomer($doc, $root);
>         }
>         $doc->save($xmlfile);
> }
> ?>
> <body>
> <div>
> <fieldset><legend>Add new customer</legend>
> <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
> <label for="new_customer_name">Name:</label>
> <input id="new_customer_name" name="new_customer_name" type="text" />
> <label for="new_customer_phone">Phone:</label>
> <input id="new_customer_phone" name="new_customer_phone" type="text" />
> <button id="add_customer" name="add_customer" type="submit">Add</button>
> </form>
> </fieldset>
> </div>
> </body>
> </html>
> 
> Any suggestions??

It looks to me that you are creating a new DOM object for the file
existing condition, but not loading the actual file into the object with
$doc->load() or similar. Consequently you are creating a new file with
single entry each time.
Also, I wonder why your new DOMDocument()s have different parameters?
Wouldn't it be wise to make them the same to avoid possible problems?


> Thks
> Maurizio
> 
> --
> The information transmitted is intended for the person or entity to which it 
> is addressed and may contain confidential and/or privileged material. Any 
> review, retransmission, dissemination or other use of, or taking of any 
> action in reliance upon, this information by persons or entities other than 
> the intended recipient is prohibited. If you received this in error, please 
> contact the sender and delete the material from any computer.
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--
Niel Archer
niel.archer (at) blueyonder.co.uk



--- End Message ---
--- Begin Message ---
Hi
I'm sorry, but I don't understand well what you are trying to tell me.....

Let's imagine I want to modify an existent XML file called customers.xml

I should do this steps

$doc = new DOMDocument();
$doc->load('customers.xml');
$root = $doc->getElementsByTagName("customers"); // to take the root

.... // create one customer

$doc->save('customer.xml'); // to save the changes

that is exactly what I did in the else part (in the if, in the case the file 
customers.xml didn't exist, I create the file with only the root node).
Isn't is right?

For what concerns the two type of DOMDocument istantiation.... I forgot to 
chance them both :)

Thks
Maurizio Bellemo
Sytel Reply Deutschland
__________________

m.bell...@reply.it
Prinzenalle 7
40549 Düsseldorf
GERMANY
________________________________________
From: Niel Archer [...@chance.now]
Sent: Tuesday, May 12, 2009 7:16 PM
To: php-wind...@lists.php.net
Subject: Re: [PHP-WIN] Problem with DOM

> Hi all,
>
> I'm trying to create some XML from PHP code to save data about customers, but 
> I found many problem and it doesn't work.
>
> The class Customer is quite simple I put it right below
>
> <?php
>
> class customer {
>         var $name;
>         var $phone;
>
>         function customer($name, $phone) {
>                 $this->name = $name;
>                 $this->phone = $phone;
>         }
>
>         function getName() {
>                 return $name;
>         }
>
>         function setName($name) {
>                 $this->name = $name;
>         }
>
>         function getPhone() {
>                 return $phone;
>         }
>
>         function setPhone($phone) {
>                 $this->phone = $phone;
>         }
>
>         function addXMLCustomer($dom, $root) {
>                 $customer = $dom->createElement('customer');
>
>                 $name_at = $dom->createAttribute('name');
>                 $customer->appendChild($name_at);
>                 $name_at_val = $dom->createTextNode($this->name);
>                 $name_at->appendChild($name_at_val);
>
>                 $phone_at = $dom->createAttribute('phone');
>                 $customer->appendChild($phone_at);
>                 $phone_at_val = $dom->createTextNode($this->phone);
>                 $phone_at->appendChild($phone_at_val);
>
>                 $root->appendChild($customer);
>
>         }
> }
>
> ?>
>
> the main page is simply a little form asking to introduce a new customer.... 
> (the problem is not when you try to create the XML file for the first time, 
> but something on getElementsByTagName, that is when you try to reopen the 
> file... for example for a second customer....
>
> <html>
> <head>
> <title>MCare administration</title>
> <script type="text/javascript" 
> src="script/scriptaculous-js-1.8.2/prototype.js"></script>
> <script type="text/javascript" 
> src="script/scriptaculous-js-1.8.2/scriptaculous.js"></script>
> </head>
> <?php
> // require class file
> require("customer.php");
>
> $xmlfile = "C:/Users/Maurizio/Desktop/customers.xml";
>
> if(!file_exists($xmlfile)) {
>         $doc = new DOMDocument('1.0', 'iso-8859-1');
>         $root = $doc->createElement('customers');
>         $doc->appendChild($root);
>
>         if (isset($_GET['add_customer']) && isset($_GET['new_customer_name'])
>                 && isset($_GET['new_customer_phone'])) {
>                 $c = new customer($_GET['new_customer_name'], 
> $_GET['new_customer_phone']);
>                 $c->addXMLCustomer($doc, $root);
>         }
>         $doc->save($xmlfile);
> }
> else {
>         $doc = new DOMDocument();
>         $doc->load($xmlfile);
>         $root = $doc->getElementsByTagName("customers");
>         if (isset($_GET['add_customer']) && isset($_GET['new_customer_name'])
>                 && isset($_GET['new_customer_phone'])) {
>                 $c = new customer($_GET['new_customer_name'], 
> $_GET['new_customer_phone']);
>                 $c->addXMLCustomer($doc, $root);
>         }
>         $doc->save($xmlfile);
> }
> ?>
> <body>
> <div>
> <fieldset><legend>Add new customer</legend>
> <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
> <label for="new_customer_name">Name:</label>
> <input id="new_customer_name" name="new_customer_name" type="text" />
> <label for="new_customer_phone">Phone:</label>
> <input id="new_customer_phone" name="new_customer_phone" type="text" />
> <button id="add_customer" name="add_customer" type="submit">Add</button>
> </form>
> </fieldset>
> </div>
> </body>
> </html>
>
> Any suggestions??

It looks to me that you are creating a new DOM object for the file
existing condition, but not loading the actual file into the object with
$doc->load() or similar. Consequently you are creating a new file with
single entry each time.
Also, I wonder why your new DOMDocument()s have different parameters?
Wouldn't it be wise to make them the same to avoid possible problems?


> Thks
> Maurizio
>
> --
> The information transmitted is intended for the person or entity to which it 
> is addressed and may contain confidential and/or privileged material. Any 
> review, retransmission, dissemination or other use of, or taking of any 
> action in reliance upon, this information by persons or entities other than 
> the intended recipient is prohibited. If you received this in error, please 
> contact the sender and delete the material from any computer.
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--
Niel Archer
niel.archer (at) blueyonder.co.uk



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


--
The information transmitted is intended for the person or entity to which it is 
addressed and may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient is prohibited. If you received this in error, please contact the 
sender and delete the material from any computer.

--- End Message ---
--- Begin Message ---
> Hi
> I'm sorry, but I don't understand well what you are trying to tell me.....
> 
> Let's imagine I want to modify an existent XML file called customers.xml
> 
> I should do this steps
> 
> $doc = new DOMDocument();
> $doc->load('customers.xml');
> $root = $doc->getElementsByTagName("customers"); // to take the root
> 
> .... // create one customer
> 
> $doc->save('customer.xml'); // to save the changes
> 
> that is exactly what I did in the else part (in the if, in the case the file 
> customers.xml didn't exist, I create the file with only the root node).
> Isn't is right?

Apologies.  I missed the '!' in the if and got the logic reversed.

You do not say what does or does not happen on the second attempt? Am I
correct in assuming there is no change?


> For what concerns the two type of DOMDocument istantiation.... I forgot to 
> chance them both :)
> 
> Thks
> Maurizio Bellemo
> Sytel Reply Deutschland
> __________________
> 
> m.bell...@reply.it
> Prinzenalle 7
> 40549 Düsseldorf
> GERMANY
> ________________________________________
> From: Niel Archer [...@chance.now]
> Sent: Tuesday, May 12, 2009 7:16 PM
> To: php-wind...@lists.php.net
> Subject: Re: [PHP-WIN] Problem with DOM
> 
> > Hi all,
> >
> > I'm trying to create some XML from PHP code to save data about customers, 
> > but I found many problem and it doesn't work.
> >
> > The class Customer is quite simple I put it right below
> >
> > <?php
> >
> > class customer {
> >         var $name;
> >         var $phone;
> >
> >         function customer($name, $phone) {
> >                 $this->name = $name;
> >                 $this->phone = $phone;
> >         }
> >
> >         function getName() {
> >                 return $name;
> >         }
> >
> >         function setName($name) {
> >                 $this->name = $name;
> >         }
> >
> >         function getPhone() {
> >                 return $phone;
> >         }
> >
> >         function setPhone($phone) {
> >                 $this->phone = $phone;
> >         }
> >
> >         function addXMLCustomer($dom, $root) {
> >                 $customer = $dom->createElement('customer');
> >
> >                 $name_at = $dom->createAttribute('name');
> >                 $customer->appendChild($name_at);
> >                 $name_at_val = $dom->createTextNode($this->name);
> >                 $name_at->appendChild($name_at_val);
> >
> >                 $phone_at = $dom->createAttribute('phone');
> >                 $customer->appendChild($phone_at);
> >                 $phone_at_val = $dom->createTextNode($this->phone);
> >                 $phone_at->appendChild($phone_at_val);
> >
> >                 $root->appendChild($customer);
> >
> >         }
> > }
> >
> > ?>
> >
> > the main page is simply a little form asking to introduce a new 
> > customer.... (the problem is not when you try to create the XML file for 
> > the first time, but something on getElementsByTagName, that is when you try 
> > to reopen the file... for example for a second customer....
> >
> > <html>
> > <head>
> > <title>MCare administration</title>
> > <script type="text/javascript" 
> > src="script/scriptaculous-js-1.8.2/prototype.js"></script>
> > <script type="text/javascript" 
> > src="script/scriptaculous-js-1.8.2/scriptaculous.js"></script>
> > </head>
> > <?php
> > // require class file
> > require("customer.php");
> >
> > $xmlfile = "C:/Users/Maurizio/Desktop/customers.xml";
> >
> > if(!file_exists($xmlfile)) {
> >         $doc = new DOMDocument('1.0', 'iso-8859-1');
> >         $root = $doc->createElement('customers');
> >         $doc->appendChild($root);
> >
> >         if (isset($_GET['add_customer']) && 
> > isset($_GET['new_customer_name'])
> >                 && isset($_GET['new_customer_phone'])) {
> >                 $c = new customer($_GET['new_customer_name'], 
> > $_GET['new_customer_phone']);
> >                 $c->addXMLCustomer($doc, $root);
> >         }
> >         $doc->save($xmlfile);
> > }
> > else {
> >         $doc = new DOMDocument();
> >         $doc->load($xmlfile);
> >         $root = $doc->getElementsByTagName("customers");
> >         if (isset($_GET['add_customer']) && 
> > isset($_GET['new_customer_name'])
> >                 && isset($_GET['new_customer_phone'])) {
> >                 $c = new customer($_GET['new_customer_name'], 
> > $_GET['new_customer_phone']);
> >                 $c->addXMLCustomer($doc, $root);
> >         }
> >         $doc->save($xmlfile);
> > }
> > ?>
> > <body>
> > <div>
> > <fieldset><legend>Add new customer</legend>
> > <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
> > <label for="new_customer_name">Name:</label>
> > <input id="new_customer_name" name="new_customer_name" type="text" />
> > <label for="new_customer_phone">Phone:</label>
> > <input id="new_customer_phone" name="new_customer_phone" type="text" />
> > <button id="add_customer" name="add_customer" type="submit">Add</button>
> > </form>
> > </fieldset>
> > </div>
> > </body>
> > </html>
> >
> > Any suggestions??
> 
> It looks to me that you are creating a new DOM object for the file
> existing condition, but not loading the actual file into the object with
> $doc->load() or similar. Consequently you are creating a new file with
> single entry each time.
> Also, I wonder why your new DOMDocument()s have different parameters?
> Wouldn't it be wise to make them the same to avoid possible problems?
> 
> 
> > Thks
> > Maurizio
> >
> > --
> > The information transmitted is intended for the person or entity to which 
> > it is addressed and may contain confidential and/or privileged material. 
> > Any review, retransmission, dissemination or other use of, or taking of any 
> > action in reliance upon, this information by persons or entities other than 
> > the intended recipient is prohibited. If you received this in error, please 
> > contact the sender and delete the material from any computer.
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 
> --
> Niel Archer
> niel.archer (at) blueyonder.co.uk
> 
> 
> 
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> --
> The information transmitted is intended for the person or entity to which it 
> is addressed and may contain confidential and/or privileged material. Any 
> review, retransmission, dissemination or other use of, or taking of any 
> action in reliance upon, this information by persons or entities other than 
> the intended recipient is prohibited. If you received this in error, please 
> contact the sender and delete the material from any computer.
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--
Niel Archer



--- End Message ---
--- Begin Message ---
> > Hi
> > I'm sorry, but I don't understand well what you are trying to tell me.....
> > 
> > Let's imagine I want to modify an existent XML file called customers.xml
> > 
> > I should do this steps
> > 
> > $doc = new DOMDocument();
> > $doc->load('customers.xml');
> > $root = $doc->getElementsByTagName("customers"); // to take the root
> > 
> > .... // create one customer
> > 
> > $doc->save('customer.xml'); // to save the changes
> > 
> > that is exactly what I did in the else part (in the if, in the case the 
> > file customers.xml didn't exist, I create the file with only the root node).
> > Isn't is right?
> 
> Apologies.  I missed the '!' in the if and got the logic reversed.
> 
> You do not say what does or does not happen on the second attempt? Am I
> correct in assuming there is no change?

The problem appears to be with the line:

$root->appendChild($customer);

in your addXMLCustomer method.

This give me the following error:
PHP Fatal error:  Call to undefined method DOMNodeList::appendChild() in 
D:\Scripts\PHP\TESTS\DOM-test.php


> > For what concerns the two type of DOMDocument istantiation.... I forgot to 
> > chance them both :)
> > 
> > Thks
> > Maurizio Bellemo
> > Sytel Reply Deutschland
> > __________________
> > 
> > m.bell...@reply.it
> > Prinzenalle 7
> > 40549 Düsseldorf
> > GERMANY
> > ________________________________________
> > From: Niel Archer [...@chance.now]
> > Sent: Tuesday, May 12, 2009 7:16 PM
> > To: php-wind...@lists.php.net
> > Subject: Re: [PHP-WIN] Problem with DOM
> > 
> > > Hi all,
> > >
> > > I'm trying to create some XML from PHP code to save data about customers, 
> > > but I found many problem and it doesn't work.
> > >
> > > The class Customer is quite simple I put it right below
> > >
> > > <?php
> > >
> > > class customer {
> > >         var $name;
> > >         var $phone;
> > >
> > >         function customer($name, $phone) {
> > >                 $this->name = $name;
> > >                 $this->phone = $phone;
> > >         }
> > >
> > >         function getName() {
> > >                 return $name;
> > >         }
> > >
> > >         function setName($name) {
> > >                 $this->name = $name;
> > >         }
> > >
> > >         function getPhone() {
> > >                 return $phone;
> > >         }
> > >
> > >         function setPhone($phone) {
> > >                 $this->phone = $phone;
> > >         }
> > >
> > >         function addXMLCustomer($dom, $root) {
> > >                 $customer = $dom->createElement('customer');
> > >
> > >                 $name_at = $dom->createAttribute('name');
> > >                 $customer->appendChild($name_at);
> > >                 $name_at_val = $dom->createTextNode($this->name);
> > >                 $name_at->appendChild($name_at_val);
> > >
> > >                 $phone_at = $dom->createAttribute('phone');
> > >                 $customer->appendChild($phone_at);
> > >                 $phone_at_val = $dom->createTextNode($this->phone);
> > >                 $phone_at->appendChild($phone_at_val);
> > >
> > >                 $root->appendChild($customer);
> > >
> > >         }
> > > }
> > >
> > > ?>
> > >
> > > the main page is simply a little form asking to introduce a new 
> > > customer.... (the problem is not when you try to create the XML file for 
> > > the first time, but something on getElementsByTagName, that is when you 
> > > try to reopen the file... for example for a second customer....
> > >
> > > <html>
> > > <head>
> > > <title>MCare administration</title>
> > > <script type="text/javascript" 
> > > src="script/scriptaculous-js-1.8.2/prototype.js"></script>
> > > <script type="text/javascript" 
> > > src="script/scriptaculous-js-1.8.2/scriptaculous.js"></script>
> > > </head>
> > > <?php
> > > // require class file
> > > require("customer.php");
> > >
> > > $xmlfile = "C:/Users/Maurizio/Desktop/customers.xml";
> > >
> > > if(!file_exists($xmlfile)) {
> > >         $doc = new DOMDocument('1.0', 'iso-8859-1');
> > >         $root = $doc->createElement('customers');
> > >         $doc->appendChild($root);
> > >
> > >         if (isset($_GET['add_customer']) && 
> > > isset($_GET['new_customer_name'])
> > >                 && isset($_GET['new_customer_phone'])) {
> > >                 $c = new customer($_GET['new_customer_name'], 
> > > $_GET['new_customer_phone']);
> > >                 $c->addXMLCustomer($doc, $root);
> > >         }
> > >         $doc->save($xmlfile);
> > > }
> > > else {
> > >         $doc = new DOMDocument();
> > >         $doc->load($xmlfile);
> > >         $root = $doc->getElementsByTagName("customers");
> > >         if (isset($_GET['add_customer']) && 
> > > isset($_GET['new_customer_name'])
> > >                 && isset($_GET['new_customer_phone'])) {
> > >                 $c = new customer($_GET['new_customer_name'], 
> > > $_GET['new_customer_phone']);
> > >                 $c->addXMLCustomer($doc, $root);
> > >         }
> > >         $doc->save($xmlfile);
> > > }
> > > ?>
> > > <body>
> > > <div>
> > > <fieldset><legend>Add new customer</legend>
> > > <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
> > > <label for="new_customer_name">Name:</label>
> > > <input id="new_customer_name" name="new_customer_name" type="text" />
> > > <label for="new_customer_phone">Phone:</label>
> > > <input id="new_customer_phone" name="new_customer_phone" type="text" />
> > > <button id="add_customer" name="add_customer" type="submit">Add</button>
> > > </form>
> > > </fieldset>
> > > </div>
> > > </body>
> > > </html>
> > >
> > > Any suggestions??
> > 
> > It looks to me that you are creating a new DOM object for the file
> > existing condition, but not loading the actual file into the object with
> > $doc->load() or similar. Consequently you are creating a new file with
> > single entry each time.
> > Also, I wonder why your new DOMDocument()s have different parameters?
> > Wouldn't it be wise to make them the same to avoid possible problems?
> > 
> > 
> > > Thks
> > > Maurizio
> > >
> > > --
> > > The information transmitted is intended for the person or entity to which 
> > > it is addressed and may contain confidential and/or privileged material. 
> > > Any review, retransmission, dissemination or other use of, or taking of 
> > > any action in reliance upon, this information by persons or entities 
> > > other than the intended recipient is prohibited. If you received this in 
> > > error, please contact the sender and delete the material from any 
> > > computer.
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > 
> > --
> > Niel Archer
> > niel.archer (at) blueyonder.co.uk
> > 
> > 
> > 
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 
> > --
> > The information transmitted is intended for the person or entity to which 
> > it is addressed and may contain confidential and/or privileged material. 
> > Any review, retransmission, dissemination or other use of, or taking of any 
> > action in reliance upon, this information by persons or entities other than 
> > the intended recipient is prohibited. If you received this in error, please 
> > contact the sender and delete the material from any computer.
> > 
> > -- 
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 
> --
> Niel Archer
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--
Niel Archer



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

Got it working as expected. Try the following modified class

class customer {
        $name;
        $phone;

        function customer($name, $phone) {
                $this->name = $name;
                $this->phone = $phone;
        }

        function getName() {
                return $name;
        }

        function setName($name) {
                $this->name = $name;
        }

        function getPhone() {
                return $phone;
        }

        function setPhone($phone) {
                $this->phone = $phone;
        }

        function addXMLCustomer($dom) {
                $customer = $dom->createElement('customer');
                $customer->setAttribute('name', $this->name);
                $customer->setAttribute('phone', $this->phone);

                $dom->documentElement->appendChild($customer);
        }
}

HTH
--
Niel Archer



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

I am using PHP Version 4 Over Windows Server 2003 , the webserver application is IIS 6

I couldn't find a way to debug PHP and enable the debug.
I would like that every action that PHP is doing will be written into a file.
I think that PHP doesn't support such feature but I am here to confirm it.
I am not talking about writting only errors , I would like to debug any action that the php is doing.

thanks

onemancrew
--- End Message ---

Reply via email to