php-general Digest 1 Oct 2007 12:19:17 -0000 Issue 5048

Topics (messages 262603 through 262611):

Re: 500 Internal Server Error
        262603 by: Wolf

Re: PHP and daylight savings
        262604 by: Jeffery Fernandez
        262605 by: Bruce Cowin

Re: SimpleXMLElement is not Simple
        262606 by: Jeffery Fernandez

Problem with pasting text from word into php form
        262607 by: Crab Hunt
        262608 by: Jeffery Fernandez

Smarty Question
        262609 by: Shahrzad
        262610 by: Stut

Re: Classes and access to outside variables
        262611 by: Nathan Nobbe

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Either change your PHP installation to be C:\php

Or you need to learn how to write:
C:\progra~1\php


Wolf

Francisco Frost wrote:
No, it's not, but I found out by enabling the show errors in php.ini that for about 80 items it's saying "PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\" then the DLL's file name, then "The specified module was not found" but all the files are there.

"Per Jessen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
Francisco Frost wrote:

I'm getting an error with my PHP, I'm running Apache 2.2.6 and every
time I try to access a PHP page on the Apache server, it says HTTP 500
Internal Server Error, can anyone help?

Check your apache error logs.  My guess is that PHP is making apache
segfault.


/Per Jessen, Zürich


--- End Message ---
--- Begin Message ---
On Monday 01 October 2007 10:08, Bruce Cowin wrote:
> Yet another update!  I managed to get rid of the CGI error by turning off
> error logging to the syslog.  But now I get this message:
>
> PHP Warning: PHP Startup: Unable to load dynamic library
> 'c:\php\ext\php_timezonedb.dll' - Access is denied. in Unknown on line 0

I don't know if this will make a difference.. have you checked the permissions 
of the file. I think you need to grant the extentions folder Full Control for 
IUSR_COMPUTERNAME

>
> As I say, this same dll works fine on a server running the same PHP version
> (5.1.2).  Any ideas?
>
>
>
> Regards,
>
> Bruce
>
> >>> "Bruce Cowin" <[EMAIL PROTECTED]> 1/10/2007 12:13 p.m. >>>
>
> I discovered that we needed to update the php_timezonedb.dll.  This worked
> fine on our servers and time is now correct.  But in my dev environment on
> my machine, when I put the same dll in (with the same version of PHP), I
> get a CGI error when PHP tries to do anything.  Anyone know why?
>
>
>
> Regards,
>
> Bruce
>
> >>> "Bruce Cowin" <[EMAIL PROTECTED]> 1/10/2007 11:02 a.m. >>>
>
> I'm using PHP 5.1.2 on IIS.  Here in New Zealand, our daylight savings
> started a week earlier than usual and went into affect this past weekend. 
> The time on my machine is correct.  The timezone settings on my machine are
> correct.  But if I display the time on a PHP page, it is 1 hour behind. 
> Setting the timezone with date_default_timezone_set() doesn't make any
> difference.  If I display the time on an ASP page, it shows the correct
> time so it can't be an IIS problem I don't think.
>
> Why would PHP be showing the time as if it hadn't changed?  Where is it
> getting the time from?  Here is the code I'm using:
>
>       date_default_timezone_set('Pacific/Auckland');
>       echo "time is " . date("h:i:s");
>
>
>
>
> Regards,
>
> Bruce
>
> --
> PHP General 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

-- 
Internet Vision Technologies
Level 1, 520 Dorset Road
Croydon
Victoria - 3136
Australia

Attachment: pgplDWAxgct3h.pgp
Description: PGP signature


--- End Message ---
--- Begin Message ---
That was it, thanks!  I compared the permissions on this dll to another dll 
extension that loads fine.  When I made it the same, it worked.  Thanks again!


Regards,

Bruce

>>> Jeffery Fernandez <[EMAIL PROTECTED]> 1/10/2007 1:23 p.m. >>>
On Monday 01 October 2007 10:08, Bruce Cowin wrote:
> Yet another update!  I managed to get rid of the CGI error by turning off
> error logging to the syslog.  But now I get this message:
>
> PHP Warning: PHP Startup: Unable to load dynamic library
> 'c:\php\ext\php_timezonedb.dll' - Access is denied. in Unknown on line 0

I don't know if this will make a difference.. have you checked the permissions 
of the file. I think you need to grant the extentions folder Full Control for 
IUSR_COMPUTERNAME

>
> As I say, this same dll works fine on a server running the same PHP version
> (5.1.2).  Any ideas?
>
>
>
> Regards,
>
> Bruce
>
> >>> "Bruce Cowin" <[EMAIL PROTECTED]> 1/10/2007 12:13 p.m. >>>
>
> I discovered that we needed to update the php_timezonedb.dll.  This worked
> fine on our servers and time is now correct.  But in my dev environment on
> my machine, when I put the same dll in (with the same version of PHP), I
> get a CGI error when PHP tries to do anything.  Anyone know why?
>
>
>
> Regards,
>
> Bruce
>
> >>> "Bruce Cowin" <[EMAIL PROTECTED]> 1/10/2007 11:02 a.m. >>>
>
> I'm using PHP 5.1.2 on IIS.  Here in New Zealand, our daylight savings
> started a week earlier than usual and went into affect this past weekend. 
> The time on my machine is correct.  The timezone settings on my machine are
> correct.  But if I display the time on a PHP page, it is 1 hour behind. 
> Setting the timezone with date_default_timezone_set() doesn't make any
> difference.  If I display the time on an ASP page, it shows the correct
> time so it can't be an IIS problem I don't think.
>
> Why would PHP be showing the time as if it hadn't changed?  Where is it
> getting the time from?  Here is the code I'm using:
>
>       date_default_timezone_set('Pacific/Auckland');
>       echo "time is " . date("h:i:s");
>
>
>
>
> Regards,
>
> Bruce
>
> --
> PHP General 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 

-- 
Internet Vision Technologies
Level 1, 520 Dorset Road
Croydon
Victoria - 3136
Australia

--- End Message ---
--- Begin Message ---
On Friday 28 September 2007 11:21, Jeffery Fernandez wrote:
> On Friday 28 September 2007 11:09, Nathan Nobbe wrote:
> > just curious, what database are you using?
>
> I am using MySQL Ver 14.12 Distrib 5.0.22


Any clues Nathan? 

I have done some further testing and found that if I copy the working code 
(standalone script) and put it amongst the application code, that doesn't 
work either. I am thinking its a locale or character encoding problem. Any 
thoughts ?


cheers,
Jeffery

>
> cheers,
> Jeffery
>
> > -nathan
> >
> > On 9/27/07, Jeffery Fernandez <[EMAIL PROTECTED]> wrote:
> > > I am having nightmares with this bit off code.
> > >
> > > The following code work perfectly fine:
> > >
> > > $soap_request_string = <<<XML
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope";
> > > xmlns:ns1="urn:Gateway_Proxy"
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:enc="
> > > http://www.w3.org/2003/05/soap-encoding";>
> > > <env:Body>
> > >   <ns1:make_proxy_payment env:encodingStyle="
> > > http://www.w3.org/2003/05/soap-encoding";>
> > >     <payment_id>61ecc268-1cd0-f468</payment_id>
> > >     <payment_amount>15495</payment_amount>
> > >
> > >
> > > <callback_query_string>&amp;payment_id=61ecc268-1cd0-f468</callback_que
> > >ry _string> <transaction_note>Order from Student Library Fees with
> > > Payment Id: 61ecc268-1cd0-f468</transaction_note>
> > >   </ns1:make_proxy_payment>
> > > </env:Body>
> > > </env:Envelope>
> > > XML;
> > >
> > > $xml = new SimpleXMLElement($soap_request_string, NULL, false, '
> > > http://www.w3.org/2003/05/soap-envelope');
> > > print_r($xml);
> > > $ns = $xml->getNamespaces(true);
> > > //print_r($ns);
> > >
> > > foreach ($xml->children($ns['env']) as $body)
> > > {
> > >     //printf("%s<br />", $body->getName());
> > >
> > >         foreach ($body->children($ns['ns1']) as $function)
> > >         {
> > >             printf("function %s()<br />", $function->getName());
> > >
> > >             foreach ($function->children() as $parameters)
> > >             {
> > >                     printf("%s => \"%s\"<br />",
> > > $parameters->getName(), $parameters);
> > >             }
> > >         }
> > > }
> > >
> > >
> > > However when the XML string is coming from the database it does not
> > > work. The Field and table have a collation of "utf8_unicode_ci"
> > >
> > > $soap_request_string = trim(str_replace(array("\n"), '',
> > > $record['SoapRequestEnvelope']));
> > > $xml = new SimpleXMLElement($soap_request_string, NULL, false, '
> > > http://www.w3.org/2003/05/soap-envelope');
> > > print_r($xml);
> > >
> > >
> > > The above code is supposed to print out the following (for me to
> > > proceed further):
> > >
> > > SimpleXMLElement Object
> > > (
> > >     [Body] => SimpleXMLElement Object
> > >         (
> > >         )
> > > )
> > >
> > >
> > > but only returns:
> > > SimpleXMLElement Object
> > > (
> > > )
> > >
> > >
> > > The XL string from the database looks exactly like this (after
> > > replacing new lines):
> > >
> > > <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="
> > > http://www.w3.org/2003/05/soap-envelope"; xmlns:ns1="urn:Gateway_Proxy"
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="
> > > http://www.w3.org/2001/XMLSchema-instance"; xmlns:enc="
> > > http://www.w3.org/2003/05/soap-encoding";><env:Body><ns1:make_proxy_paym
> > >en t
> > > env:encodingStyle="http://www.w3.org/2003/05/soap-encoding";><payment_id
> > >>5
> > > ce30dcc-7df7-04e8</payment_id><payment_amount>10</payment_amount><callb
> > >ack
> > > _query_string>&amp;payment_id=5ce30dcc-7df7-04e8</callback_query_string
> > >><t ransaction_note>Order from Student Library Fees with Payment Id:
> > > 5ce30dcc-7df7-04e8</transaction_note></ns1:make_proxy_payment></env:Bod
> > >y> </env:Envelope>
> > >
> > >
> > > I can't figure out whats wrong with the code. Any suggestions?
> > >
> > > cheers,
> > > Jeffery
> > > --
> > > Internet Vision Technologies
> > > Level 1, 520 Dorset Road
> > > Croydon
> > > Victoria - 3136
> > > Australia

-- 
Internet Vision Technologies
Level 1, 520 Dorset Road
Croydon
Victoria - 3136
Australia

Attachment: pgpQwNG4BvCUt.pgp
Description: PGP signature


--- End Message ---
--- Begin Message ---
Hi,
Is there a fix for removing the junk characters that appear when we copy and
paste some text from Microsoft word into a php form ? For example the double
quotes "" turn into something like *â??*

thanks in advance.

--- End Message ---
--- Begin Message ---
On Monday 01 October 2007 16:01, Crab Hunt wrote:
> Hi,
> Is there a fix for removing the junk characters that appear when we copy
> and paste some text from Microsoft word into a php form ? For example the
> double quotes "" turn into something like *â??*
>
> thanks in advance.


Some WYSIWYG editors do this nicely. Look at the code of FCKeditor, it has 
some javascript functions to cleanup the Word document characters.

cheers,
jeffery
-- 
Internet Vision Technologies
Level 1, 520 Dorset Road
Croydon
Victoria - 3136
Australia

Attachment: pgpRVPknBfEhn.pgp
Description: PGP signature


--- End Message ---
--- Begin Message ---
IRIran.netHi,
I want to replace a php variable with a javascript variable inside <script 
type="text/javascript"> tag in a TPL file(smarty) , how can I do that?

//what in my mind is  , but this code is wrong
///////////////////////////////////////////////////
 var Country = document.search.country;
 {php} $me={/php} Country.value  {php};{/php}
//

Thanks 

--- End Message ---
--- Begin Message ---
Shahrzad wrote:
IRIran.netHi,
I want to replace a php variable with a javascript variable inside <script 
type="text/javascript"> tag in a TPL file(smarty) , how can I do that?

//what in my mind is  , but this code is wrong
///////////////////////////////////////////////////
 var Country = document.search.country;
 {php} $me={/php} Country.value  {php};{/php}
//

Thanks

Smarty have their own mailing lists - please use them.

-Stut

--
http://stut.net/

--- End Message ---
--- Begin Message ---
On 10/1/07, Merlin <[EMAIL PROTECTED]> wrote:
>
> Hello everybody,
>
> thank you for all your answers. I am sorry but I just realized that
> there is an huge difference between PHP5 and PHP4 considering OOP.
> Unfortunatelly I am still running PHP4.x and cant change this over
> night. However I still need to implement this class which does work very
> well, just needs handwritten parameters again.
>
> There is one file where the DB login data is stored and the new ajax
> class I am using needs this data as well. Right now I am changin this in
> both files, as I could not figure out how to access the variable from
> inside the class. The code Martin has written seems only to work in PHP5
> as I do get errors.
>
> For now all I do want is to access an outside variable from inside a
> class with PHP4 code. Thats all. I will look into classes more deaply in
> the next days and in PHP5, but it would be very helpful if somebody
> could help me now with getting that variable.
>
> Thank you for your help.
>
> Best regards,
>
> Merlin
>


Merlin,

in php4 there are no restrictions on variable access from outside the class.
you can access any member variable from an instance of the class directly,
here is an example:

class SomeClass {
    var $someVar = 'hello';
}

$classInstance = new SomeClass();

echo $classInstance->someVar;   /// prints hello

i recommend you not do this however, since standard practice is to mark
variables
private and expose access to them through public methods.  as you indicated
php4
does not have ppp support.  but, if you want a tip on how to write decent oo
code
in php4 here it is; drive all access to member variables through methods.
when you
later (if ever) port the code to php5, the member variables can be marked
private and
the member functions can be marked public.  here is a revision of the above
example
to demonstrate:

class SomeClass {
    var $someVar = 'hello';

    /// getter method; return the value of the instance variable
    function getSomeVar() {
        return $this->someVar;
    }

    /// setter method, change the value of the instance variable
    function setSomeVar($someVar) {
       // some validation perhaps
        $this->someVar = $someVar;
    }
}

$someClassInstance = new SomeClass();
echo $someClassInstance->getSomeVar ();   /// prints hello

$someClassInstance->setSomeVar('wow');
echo $someClassInstance->getSomeVar();   /// prints wow

that is good practice per php4 oop programming (imho).  if it doesnt
run you may have to weed out a typo or 2, i just wrote it right into the
email.
also, you dont have to pass data into the constructor only.  typically, you
only pass data into a constructor that a constructor may need to create
an initial state for the object instance.  if an object instance is valid
w/o
some data youre thinking about passing into the constructor, it may be
better
to just have a separate setter method.

-nathan

--- End Message ---

Reply via email to