php-windows Digest 30 Oct 2001 01:26:49 -0000 Issue 828

Topics (messages 10082 through 10098):

Floating Point
        10082 by: Anthony

Re: What is a class
        10083 by: Mike Frazer

Help, connection object in php
        10084 by: aaron
        10085 by: Erik H. Mathy
        10086 by: John Lim
        10094 by: Svensson, B.A.T.
        10098 by: Ross Fleming

Re: IIS, PHP and LANs
        10087 by: Christoph Grottolo
        10091 by: CJD
        10093 by: CJD

No DLL's after installation?
        10088 by: Joseph Koenig
        10089 by: Alain Samoun
        10097 by: Daniel Parsons

Re: PHPshop and gettext
        10090 by: Karen Siefken

php and outlook2000
        10092 by: Jingzhao Ou

Re: php.ini
        10095 by: Gaylen Fraley

permissions running dnscmd with exec
        10096 by: kmahan

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]


----------------------------------------------------------------------


   Is there a way to limit the amount of decimal places a floating point 
equation will calculate out to?  I have an equation that I get -1.#IND 
as the value of the equation sometimes.  Does anyone know what this 
means?  There are no errors in the formula that is being equated. 
Please help me out.

- Anthony





Think of a class as a car:

The car as a whole is one "object", while it is made up of several smaller
components that serve various "functions".  You can also store different
things in the trunk of the car that will be useful later (these would be the
class variables).

Now lets think of it in programming sense:

PHP allows for object-oriented programming through their class/object
interfaces.  All they really do is serve as a place to dump functions and
variables that are made to work with one another directly, and in many cases
to prevent non-related functions and processes from accessing their data
directly (although this is one of the best things about Object-Oriented
Programing, PHP hasn't entirely implemented it yet).

A simple class:

class car {
    var $color;
    var $doors;
    var $year;
    var $model;
    var $fuel;

    function car() {
        $doors = "4";
        $year = "2001";
        $model = "PHP Class Car";
    }

    function addFuel($gallons) {
        $this->fuel += $gallons;
    }

    var paintCar($newcolor) {
        $this->color = $newcolor;
    }
}

The class encapsulates all this information.  To use this stuff you need to
create a variable of type car:

$myCar = new car;

Doing this automatically calls the "constructor" function if one is present.
The constructor is a function with the same name as the class (this rule
varies a bit depending on your version of PHP; read the manual for details).
In the constructor, certain variables are given default values and certain
functions can be called if needed.

After that you can access variable data using $myCar->[variable name].
Functions are called the same way: $myCar->myFunction($myArgs);

Those are the basics.  There's a great deal more to learn about OOP.  If you
really want to learn about OOP, get a book on C, C++ or Java.  These are
probably the three best implementations of OOP (and it really originated in
its current form with C++).

Mike Frazer



"Jack" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Dear all
> I'm fresh on PHP, there is a question which i don't understand , even i
had
> read the book about PHP.
> There is a Class and object in PHP, but i don't quite understand what is
> that for.
> I had look at some of the Example in PHP.net and i know most of it, but
> there is a operator :
> $this->edible = $edible;
> What is the "$this -> " stand for?
>
> Could someone please tell me more???
> Thx
>
> jack
> [EMAIL PROTECTED]
>
>






Is is possible to set the connection object to point to a database on
another server?  I'm using SQLserver and IIS and would like to point the
connection object to the SQL server.  SQL server is on one computer and IIS
is on another.

Thanks,
Aaron








> Is is possible to set the connection object to point to a database on
> another server?  I'm using SQLserver and IIS and would like to point the
> connection object to the SQL server.  SQL server is on one
> computer and IIS is on another.

Yep. That's part of the mssql_connect(); syntax.

$conn = mssql_connect("ComputerName", "Account", "Password");

The name is generally the name of your other box (or IP address, if it's
static), account is the sql account you're using to connect and password,
is, um, the password.

More info:
http://www.php.net/manual/en/function.mssql-connect.php

Enjoy,
- Erik





Hi Aaron,
You sound like an ASP convert to PHP. The answer is yes.

You might like the adodb database library that works like ADO at
http://php.weblogs.com/adodb

Regards, John


Aaron <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is is possible to set the connection object to point to a database on
> another server?  I'm using SQLserver and IIS and would like to point the
> connection object to the SQL server.  SQL server is on one computer and
IIS
> is on another.
>
> Thanks,
> Aaron
>
>
>
>






It depends on the current security set-up over the network and available
network protocols (named pipes, TCP/IP, etc, etc). But yes, it should be
possible.

-----Original Message-----
From: aaron
To: [EMAIL PROTECTED]
Sent: 2001-10-29 19:17
Subject: [PHP-WIN] Help, connection object in php

Is is possible to set the connection object to point to a database on
another server?  I'm using SQLserver and IIS and would like to point the
connection object to the SQL server.  SQL server is on one computer and
IIS is on another.

Thanks,
Aaron





-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Forgive my ignorance but doesn't ODBC do this for you, pretty much hassle
free?  I've only briefly looked into this once though.

Ross

PS I've REALLY only dabbled in this when tossing an idea over in my head, I
should really have a disclaimer:
The above statements could well be a load of ^%%&!!  Feel free to ridicule
them.  :)

-----Original Message-----
From: aaron [mailto:[EMAIL PROTECTED]]
Sent: 29 October 2001 18:17
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Help, connection object in php


Is is possible to set the connection object to point to a database on
another server?  I'm using SQLserver and IIS and would like to point the
connection object to the SQL server.  SQL server is on one computer and IIS
is on another.

Thanks,
Aaron





--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]







Hi

You must use a PHP build newer than 2001-07-03 to access files on a network
share on Windows. The last offical release is PHP 4.06 which was built on
June 23, you'll need a more recent developer version - maybe you can try
www.php4win.com.

Also be sure to give the appropriate permissions on the share to the
anonymous user in IIS. Usually this has to be a valid network user. And you
should also check 'check that file exists' in the script mapping panel where
you map .php files to php.exe/php4isapi.dll.

Christoph

"Cjd" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am running IIS on my PC as a development platform, and all is good.  I'm
> wanting to set up a virtual directory to a network drive on the LAN and it
> works fine for HTML files, but when accessing a PHP file I get
>
> The specified CGI application misbehaved by not returning a complete set
of
> HTTP headers
>
> and no output.
>
> Surely if the HTML files work, the PHP ones will too? The server is
> configured will all rights and every option (r/w/exe etc.)
>
> I have seen this question bandied about now and then, but no solution has
> worked as yet.
>
>






That works!  Downloaded 4.0.8 and then I could view and execute PHP files
over the network. Fantactic.

BUT!

I use include() to pull in a connect.php foile to connect to the database,
and it has a bunch of function in it too. Now, if the include() statement
calls a file in it's current directory, all is well, but when grabbing it
from a different directory, it fails every time (and this used to work
locally, and does work on the web server)

    Warning: Failed opening '../php_inc/connect.php' for inclusion
(include_path='')

So, include("../inc/xyz.php") will fail with a error like above, but
include("file.php") works!  Is there a way around this without having to
push a site to a single directory or copy the include files to every
directory?





"Christoph Grottolo" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi
>
> You must use a PHP build newer than 2001-07-03 to access files on a
network
> share on Windows. The last offical release is PHP 4.06 which was built on
> June 23, you'll need a more recent developer version - maybe you can try
> www.php4win.com.
>
> Also be sure to give the appropriate permissions on the share to the
> anonymous user in IIS. Usually this has to be a valid network user. And
you
> should also check 'check that file exists' in the script mapping panel
where
> you map .php files to php.exe/php4isapi.dll.
>
> Christoph
>
> "Cjd" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I am running IIS on my PC as a development platform, and all is good.
I'm
> > wanting to set up a virtual directory to a network drive on the LAN and
it
> > works fine for HTML files, but when accessing a PHP file I get
> >
> > The specified CGI application misbehaved by not returning a complete set
> of
> > HTTP headers
> >
> > and no output.
> >
> > Surely if the HTML files work, the PHP ones will too? The server is
> > configured will all rights and every option (r/w/exe etc.)
> >
> > I have seen this question bandied about now and then, but no solution
has
> > worked as yet.
> >
> >
>
>






further to this, any reference in the code to a pathname not in the same
directory would produce similar errors.  Oddly enough, I switched to Apache
(v1.3.20) and all the paths worked fine. ASP won;t work now, but that's
hardly something to care about!

Solution = PHP v4.0.8 on Apache


"Cjd" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> That works!  Downloaded 4.0.8 and then I could view and execute PHP files
> over the network. Fantactic.
>
> BUT!
>
> I use include() to pull in a connect.php foile to connect to the database,
> and it has a bunch of function in it too. Now, if the include() statement
> calls a file in it's current directory, all is well, but when grabbing it
> from a different directory, it fails every time (and this used to work
> locally, and does work on the web server)
>
>     Warning: Failed opening '../php_inc/connect.php' for inclusion
> (include_path='')
>
> So, include("../inc/xyz.php") will fail with a error like above, but
> include("file.php") works!  Is there a way around this without having to
> push a site to a single directory or copy the include files to every
> directory?
>
>
>
>
>
> "Christoph Grottolo" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi
> >
> > You must use a PHP build newer than 2001-07-03 to access files on a
> network
> > share on Windows. The last offical release is PHP 4.06 which was built
on
> > June 23, you'll need a more recent developer version - maybe you can try
> > www.php4win.com.
> >
> > Also be sure to give the appropriate permissions on the share to the
> > anonymous user in IIS. Usually this has to be a valid network user. And
> you
> > should also check 'check that file exists' in the script mapping panel
> where
> > you map .php files to php.exe/php4isapi.dll.
> >
> > Christoph
> >
> > "Cjd" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > I am running IIS on my PC as a development platform, and all is good.
> I'm
> > > wanting to set up a virtual directory to a network drive on the LAN
and
> it
> > > works fine for HTML files, but when accessing a PHP file I get
> > >
> > > The specified CGI application misbehaved by not returning a complete
set
> > of
> > > HTTP headers
> > >
> > > and no output.
> > >
> > > Surely if the HTML files work, the PHP ones will too? The server is
> > > configured will all rights and every option (r/w/exe etc.)
> > >
> > > I have seen this question bandied about now and then, but no solution
> has
> > > worked as yet.
> > >
> > >
> >
> >
>
>






Hi, I recently had an admin install PHP 4.0.6 on a Windows 2000 Server.
The server is running Microsoft Site Server. Forgive my ignorance of
Windows...I created an info.php page that displayed itself properly. I
went to use the mssql extension - I uncommented it in the php.ini file.
It threw up errors that it couldn't find the dll. I figured the path was
wrong and did a search for php_mssql.dll on the server. Nothing found.
In fact, a search for "php" only brings up a few items. No dll's except
php4ts.dll. What happened? During installation, the admin told me a
message saying an ocx was missing popped up. I see in the archives that
that isn't a problem really though. Any ideas? Please CC me as I'm not
on the WIN list. Thanks,

Joe




It looks like that your admin has installed the basic version of php without
extensions. What does the phpinfo say?
Alain

On Mon, Oct 29, 2001 at 02:01:59PM -0600, Joseph Koenig wrote:
> Hi, I recently had an admin install PHP 4.0.6 on a Windows 2000 Server.
> The server is running Microsoft Site Server. Forgive my ignorance of
> Windows...I created an info.php page that displayed itself properly. I
> went to use the mssql extension - I uncommented it in the php.ini file.
> It threw up errors that it couldn't find the dll. I figured the path was
> wrong and did a search for php_mssql.dll on the server. Nothing found.
> In fact, a search for "php" only brings up a few items. No dll's except
> php4ts.dll. What happened? During installation, the admin told me a
> message saying an ocx was missing popped up. I see in the archives that
> that isn't a problem really though. Any ideas? Please CC me as I'm not
> on the WIN list. Thanks,
> 
> Joe
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]




Hi Joe,

I recently had a similar problem. All the dlls that I neded were
available in the full windows zip package from php.net's downloads
section. I used Dependency Walker
( http://www.dependencywalker.com/ - Thanks again Philippe) to determine
which dlls I needed to have as often the dll referenced in the ini file
won't load even after you have installed it due to some missing dlls
that it depends on.

In the end I set my extensions directory in the php.ini file to
c:\winnt\system32 and copied all the necessary dlls there. This worked
like a charm for me.

HTH
D.

> -----Original Message-----
> From: Joseph Koenig [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 30 October 2001 9:02 a.m.
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] No DLL's after installation?
>
>
> Hi, I recently had an admin install PHP 4.0.6 on a Windows
> 2000 Server.
> The server is running Microsoft Site Server. Forgive my ignorance of
> Windows...I created an info.php page that displayed itself properly. I
> went to use the mssql extension - I uncommented it in the
> php.ini file.
> It threw up errors that it couldn't find the dll. I figured
> the path was
> wrong and did a search for php_mssql.dll on the server. Nothing found.
> In fact, a search for "php" only brings up a few items. No
> dll's except
> php4ts.dll. What happened? During installation, the admin told me a
> message saying an ocx was missing popped up. I see in the
> archives that
> that isn't a problem really though. Any ideas? Please CC me as I'm not
> on the WIN list. Thanks,
>
> Joe
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>





I got my PHP binaries from www.zend.com and I have that dll...

Check it out, and let me know if you want me to send the dll as and attachment.
K

"Julian Bourne" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
> 
> I am trying to install phpshop using php 4.0.6 and it appears to need
> gettext invoked (somehow it does not pass session variables) so I loaded the
> gettext.dll extension library, but it now requires gnu_gettext.dll which I
> do not possess. I have search for this dll and even downloaded the gnu
> gettext code but have not found the dll I need.
> 
> Please can someone help me with a copy of gnu_gettext.dll as required by
> php.
> 
> Thanks
> 
> JB
> 
> 




Hi,

I have maintained a calendar myself using PHP. I wonder if there is any way
that can let my own calendar synchronized with the calendar in outlook2000.
That is, if I add any event to my PHP calendar, then, I can add this to my
outlook2000 as well, and vice versa.

Can anyone help me with this? Thanks a lot in advance!

Best regards,
Jingzhao






from the c:\ directory, type dir php.ini/s .

--
Gaylen
[EMAIL PROTECTED]
http://www.gaylenandmargie.com
PHP KISGB v2.2 Guestbook http://www.gaylenandmargie.com/phpwebsite

"Sharan" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hey all,
>
> My php.ini file is not in the WINNT directory.  But phpinfo() functions
> tells me it is.  Anywhere else i should look for the file.  I am using
.dll
> file with apache 1.3.20.
>
> Thanks in Advance,
> Pritpal Dhaliwal
>
>






System: Win2k Advanced server

anyone else having trouble running this with php but no trouble with a
command line. Also i can get back the command line usage information but
when i try to make a change it says permission denied. Iuser is set for full
control.

post any ideas or similar probs that you may be having.




Reply via email to