[PHP] Problems reading a DOMDocument out of a session

2005-04-25 Thread Cas
Hi, 
 
I'm trying to read a (XML object) DOMDocument from an session but when I
try to do this from another page then where it's declared, it can't be read it.
I _can_ read the DOMDocument on the same page out of the session.
and also print_r(_SESSION); shows it still is a DOMDocument on all pages.
 
The attached file shows the problem. I get different results running
the script on
PHP 5.0.3 and 5.0.4 servers (all linux).
My expected result is that the DOMDocument is printed out when submit is hit,
but instead it gives different results:

Fatal error: Call to a member function saveXML() on a non-object in
/var/www/localhost/htdocs/dom_session.php on line 21
and

Warning: Couldn't fetch DOMDocument in
/var/www/localhost/htdocs/dom_session.php on line 21

I thought it was a bug in PHP and opened a bug report allready but it's closed.
http://bugs.php.net/?id=32825
 
Does anyone has an idea what could be wrong with it?

Thanks in advance,

Caspar Adriani

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

[PHP] Re: Problems reading a DOMDocument out of a session

2005-04-25 Thread Cas
Because I'm not sure if attachments are included in this mailinglist,
I copied the source of my sample script:


- start file --
loadXML('The almighty DOM');
// Write DOMDocument to session
$_SESSION['dom'] = $dom;

// Trying a variable too
$_SESSION['var'] = 'foo';

//check if we could fetch the DOM out of the session before the form 
send.
print $_SESSION['dom']->saveXML();
}
else
{
// Read DOMDocument out of session after send, this doesn't work
print $_SESSION['dom']->saveXML();
// Read the variable out to prove the session is ok
print $_SESSION['var'];
}
?>
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>



PHP sample file







- end of file --

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



Re: [PHP] Problems reading a DOMDocument out of a session

2005-04-25 Thread Cas
On both systems i use libxml 2.6.18, both Gentoo (2005.0) machines. I
asked in the irc channels if more people could run my script to be
sure it wasn't my system and two of the two people also had the
problem (dunno what their systems are, but one runned PHP 5.0.4). I
think it's weird I get different errors on my both systems what indeed
does suggest (at least one of) my system(s) are/is borked cause both
are PHP 5.0.3 and libXML 2.6.18.
I'm now updating to libXML 2.6.19 to see if it will fix my problem,
otherwise i will indeed work around the problem. My best suggestion is
to write the DOMDocument to a random filename and pass the name
through the sessions instead of the real dom object.
Any better solutions are more then welcome!

Greetings, 
Cas


On 4/25/05, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Cas wrote:
> > Hi,
> >
> > I'm trying to read a (XML object) DOMDocument from an session but when I
> > try to do this from another page then where it's declared, it can't be read 
> > it.
> > I _can_ read the DOMDocument on the same page out of the session.
> > and also print_r(_SESSION); shows it still is a DOMDocument on all pages.
> >
> > The attached file shows the problem. I get different results running
> > the script on
> > PHP 5.0.3 and 5.0.4 servers (all linux).
> > My expected result is that the DOMDocument is printed out when submit is 
> > hit,
> > but instead it gives different results:
> >
> > Fatal error: Call to a member function saveXML() on a non-object in
> > /var/www/localhost/htdocs/dom_session.php on line 21
> > and
> >
> > Warning: Couldn't fetch DOMDocument in
> > /var/www/localhost/htdocs/dom_session.php on line 21
> 
> I had a look at you problem... and I found it impossible to reproduce the
> errors or warnings - this leads me to believe that something on your system(s)
> is ed, libxml2 would a good place to start looking
> 
> BUT,
> 
> even though I managed to retrieve the DomDocument object from the session
> on the second/subsequent requests the object stored in the session did not
> contain the XML string that was originally loaded so that
> $_SESSION['dom']->saveXML() return NULL. which is not what I would expect but 
> maybe
> its correct behaviour.
> 
> anyway if you get so far as to see the same behaviour as I do you may have 
> something
> solid to report as a bug (or at least post a question here, or possibly on 
> internals)
> otherwise you're looking at refactoring you code to work around the problem
> 
> >
> > I thought it was a bug in PHP and opened a bug report allready but it's 
> > closed.
> > http://bugs.php.net/?id=32825
> >
> > Does anyone has an idea what could be wrong with it?
> >
> > Thanks in advance,
> >
> > Caspar Adriani
> >
> >
> 
> 


-- 
http://www.getfirefox.com/

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



Re: [PHP] link generating script

2005-04-25 Thread Cas
Maybe it's also an idea to close the  tag ;-) 
to make life easier:
if ($n=$Pagenum) 
{
  print ''.$n.'';
}else{
  print ''.$n.'';
}

On 4/25/05, Ryan A <[EMAIL PROTECTED]> wrote:
> Hey,
> This is a common mistake...have a look at what you wrote:
> 
> >if ($n=$Pagenum) {print '  ' . $n;}
> 
> take a look againsee the problem?
> 
> The above will always validate to true...reason being...you gotto use the
> equal to equal to instead of just equal to...like this:
> 
> if ($n==$Pagenum) {print '  ' . $n;}
> 
> Hope that helped.
> 
> Cheers,
> Ryan
> 
> On 4/25/2005 6:40:24 PM, Ed Dorsch ([EMAIL PROTECTED]) wrote:
> > Thanks Ryan!
> >
> >
> >
> > I'm having a difficult time, though, with the exact syntax. And where,
> exactly, to nest the If > then. I tried this, but it didn't
> > work. Nothing displayed and I think it got caught in an endless loop:
> >
> >
> >
> > $max=20;
> >
> > $max++;
> >
> > for ($n = 1; $n < $max; $n++)
> >
> >
> >
> > if ($n=$Pagenum) {print '  ' . $n;}
> >
> >
> >
> > else
> >
> >
> >
> > {print '   '.$n.'';}
> >
> > print '  ';
> >
> >
> >
> >
> >
> >
> >
> > -Original Message-
> >
> > From: Ryan A [mailto:[EMAIL PROTECTED]
> >
> > Sent: Monday, April 25, 2005 8:47 AM
> >
> > To: Ed Dorsch
> >
> > Cc: php
> >
> > Subject: Re: [PHP] link generating script
> >
> >
> >
> >
> >
> >
> >
> > On 4/25/2005 5:23:16 PM, Ed Dorsch ([EMAIL PROTECTED]) wrote:
> >
> > >
> > I'm scripting a photo gallery page that generates links (1 through $max),
> > sends the selected number in the url, then displays a set of photos based
> on
> > the number. However, I want it to display the number of the current
> gallery
> > diffe
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.10.2 - Release Date: 4/21/2005
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
http://www.getfirefox.com/

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



Re: [PHP] Problems reading a DOMDocument out of a session

2005-04-25 Thread Cas
Tried the newest libXML stable release (2.6.19) and recompiled mod_php with it
but I still have get the error:

Warning: Couldn't fetch DOMDocument in
/var/www/localhost/htdocs/pluxbox/test.php on line 20
foo

May I ask what your system specs are? (OS, PHP and libXML version).

Greetings, 
Cas

On 4/25/05, Cas <[EMAIL PROTECTED]> wrote:
> On both systems i use libxml 2.6.18, both Gentoo (2005.0) machines. I
> asked in the irc channels if more people could run my script to be
> sure it wasn't my system and two of the two people also had the
> problem (dunno what their systems are, but one runned PHP 5.0.4). I
> think it's weird I get different errors on my both systems what indeed
> does suggest (at least one of) my system(s) are/is borked cause both
> are PHP 5.0.3 and libXML 2.6.18.
> I'm now updating to libXML 2.6.19 to see if it will fix my problem,
> otherwise i will indeed work around the problem. My best suggestion is
> to write the DOMDocument to a random filename and pass the name
> through the sessions instead of the real dom object.
> Any better solutions are more then welcome!
> 
> Greetings,
> Cas
> 
> 
> On 4/25/05, Jochem Maas <[EMAIL PROTECTED]> wrote:
> > Cas wrote:
> > > Hi,
> > >
> > > I'm trying to read a (XML object) DOMDocument from an session but when I
> > > try to do this from another page then where it's declared, it can't be 
> > > read it.
> > > I _can_ read the DOMDocument on the same page out of the session.
> > > and also print_r(_SESSION); shows it still is a DOMDocument on all pages.
> > >
> > > The attached file shows the problem. I get different results running
> > > the script on
> > > PHP 5.0.3 and 5.0.4 servers (all linux).
> > > My expected result is that the DOMDocument is printed out when submit is 
> > > hit,
> > > but instead it gives different results:
> > >
> > > Fatal error: Call to a member function saveXML() on a non-object in
> > > /var/www/localhost/htdocs/dom_session.php on line 21
> > > and
> > >
> > > Warning: Couldn't fetch DOMDocument in
> > > /var/www/localhost/htdocs/dom_session.php on line 21
> >
> > I had a look at you problem... and I found it impossible to reproduce the
> > errors or warnings - this leads me to believe that something on your 
> > system(s)
> > is ed, libxml2 would a good place to start looking
> >
> > BUT,
> >
> > even though I managed to retrieve the DomDocument object from the session
> > on the second/subsequent requests the object stored in the session did not
> > contain the XML string that was originally loaded so that
> > $_SESSION['dom']->saveXML() return NULL. which is not what I would expect 
> > but maybe
> > its correct behaviour.
> >
> > anyway if you get so far as to see the same behaviour as I do you may have 
> > something
> > solid to report as a bug (or at least post a question here, or possibly on 
> > internals)
> > otherwise you're looking at refactoring you code to work around the problem
> >
> > >
> > > I thought it was a bug in PHP and opened a bug report allready but it's 
> > > closed.
> > > http://bugs.php.net/?id=32825
> > >
> > > Does anyone has an idea what could be wrong with it?
> > >
> > > Thanks in advance,
> > >
> > > Caspar Adriani
> > >
> > >
> >
> >
> 
> --
> http://www.getfirefox.com/
> 


-- 
http://www.getfirefox.com/

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



Re: [PHP] Mailform and mailit.php problem.

2005-04-27 Thread Cas
Your PHP server could be wrong configured. 
Open your php.ini and check the mail settings.
If you run a homeserver the easiest way is to set it to your smtp server.

Greeting,
Cas


On 4/27/05, Jim van den Noort <[EMAIL PROTECTED]> wrote:
> 
> Hello,
> 
> I have a problem. I downloaded the form mailer dynaform1.4 and it looks 
> like
> it works perfectly. I mad a form en adjusted te mailit scrit to my
> mailadress. When i test the form it is send eand i get the thanks message.
> But the mail will never come in to my mailbox? what shout i do?
> 
> Please help me. Jim van den Noort
> 
> ?
> 
> //
> ##
> //
> ##
> //
> // DynaForm v1.4 - Created by the Webligo Group
> // http://www.webligo.com
> //
> // YOUR USE OR DISTRIBUTION OF THIS SOFTWARE CONSTITUTES YOUR ACCEPTANCE
> // OF THE FOLLOWING LICENSE AGREEMENT:
> //
> // THIS SCRIPT AND ALL OF ITS CONTENTS ARE LICENSED UNDER THE
> // GPL FREEWARE LICENSE. IT MAY NOT BE RESOLD OUR USED COMMERCIALLY
> // WITHOUT EXPRESSED PERMISSION OF THE WEBLIGO GROUP. IT MAY, HOWEVER,
> // BE DISTRIBUTED FREELY WITHOUT CHARGE. THIS SOFTWARE IS INTELLECTUAL
> // PROPERTY OF THE WEBLIGO GROUP. ANYONE VIOLATING THIS AGREEMENT WITHOUT
> // THE EXPRESSED PERMISSION OF THE WEBLIGO GROUP MAY BE LEGALLY 
> PROSECUTED.
> // YOUR DOWNLOAD AND USE OF THIS SOFTWARE ALSO SIGNIFIES THAT YOU
> UNDERSTAND
> // AND AGREE TO THE DOWNLOAD AGREEMENT YOU READ UPON DOWNLOAD.
> //
> // The Webligo Group, its management, or any of its employees, associates,
> or
> // partners cannot be held liable for any damages that this software may
> cause.
> // As the Licensee and user of the software, you agree to accept full
> liability
> // for any damages or risk involved with using this software.
> //
> // If you need help installing or using this software, please
> // read the readme.txt file that was provided with it.
> //
> // This file and all related content are the intellectual
> // property of the Webligo Group and are under copyright.
> //
> // If you plan to use this script for your clients, sell it as a service,
> // or utilize it in any other commercial manner, you must purchase a
> commercial
> // license. Please see this page for more information:
> // http://webligo.com/products_dynaform.php
> //
> // We do not provide support for this script, unless you have purchased a
> // commercial license.
> //
> // Feel free to visit our website (http://www.webligo.com)
> // if you wish to send us any comments, etc.
> //
> //
> 
> ###
> //
> 
> ###
> 
> //
> 
> ###
> //  CONFIGURE FROM: ADDRESS
> ##
> 
> // THIS AREA IS OPTIONAL. ONLY TOUCH THESE SETTINGS IF YOU KNOW WHAT YOU 
> ARE
> // DOING. PLEASE READ README.TXT FOR MORE INFORMATION.
> 
> // If you would like to specify the From: address of emails sent by
> DynaForm,
> // enter it between the double quotes below. If you leave this blank, the
> // server will assign the default email address.
> 
> $from_address = "";
> 
> //
> 
> ###
> //
> 
> ###
> 
> //
> 
> ###
> //  ACTIVATE REQUIRED FIELDS?
> 
> 
> // THIS AREA IS OPTIONAL. ONLY TOUCH THESE SETTINGS IF YOU KNOW WHAT YOU 
> ARE
> // DOING. PLEASE READ README.TXT FOR MORE INFORMATION.
> //
> // If you would like to make some fields of your form required, change 
> "no"
> to
> // "yes" below.
> 
> $required_on = "yes";
> 
> // If you have set $required_on to "yes" above, you can make fields 
> required
> // by beginning their name with "r_". For example, if you want to require
> // a user to enter their name, use the following HTML:
> //
> // 
> //
> // If a user fails to enter a required field, they will be taken to a page
> // where a message such as "You have not completed all the required 
> fields."
> // will be displayed. Please specify the URL to this file below:
> 
> $required_errorpage = "error.html";
> 
> //
> 
>