php-windows Digest 14 Nov 2002 19:16:08 -0000 Issue 1440

Topics (messages 16937 through 16949):

Re: Need to read a double value from a binary file
        16937 by: Rasmus Lerdorf

Re: php with mssql
        16938 by: Matt Kynaston
        16944 by: Miha Nedok

Sorry...
        16939 by: Brian McGarvie

Re: [PHP] runing com
        16940 by: Michael Hazelden

Re: COLD FUSION and PHP
        16941 by: Massimo Foti

Inetinfo
        16942 by: Seah Jie Ling

Printers ...
        16943 by: Michael Hazelden

Re: can php call a C executable program?
        16945 by: Franco Pozzer

incrementation error
        16946 by: DaMouse
        16948 by: Dash McElroy

Re: Permission denied with copy function..
        16947 by: Step Schwarz

Windows XP setup problem with Apache 1.3 and PHP
        16949 by: Scott Trosper

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 ---
$float = (float)$string;

On Tue, 12 Nov 2002, Juan Carlos Gonzalez wrote:

> Hi all! I need to read 8 bytes from a binary file (shp file) and cast it to
> its double value...
>
> I'm having problems because PHP casts it automaticlly to a string using
> fread; I can't find the function to cast it correctly, because floatval only
> removes the non-numeric parts of the variable, but it doesn't cast it
> completly...
>
> I already did a little program in C++ and it casts it perfectly, but I can'
> find the way to do it in php!
>
> Any help will be appreciated!
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
PEAR::DB - time abstracting is never wasted!!

Either that or rewrite the mssql_* functions to use FreeTDS (www.freetds.org) instead 
of dblib. (Just kidding - used freetds+mssql under Linux and it works extremely well, 
but not even sure it compiles under windows! It _would_ be nice to see better mssql 
support though...)

Matt

> -----Original Message-----
> From: soff [mailto:soff@;263.net]
> Sent: 14 November 2002 07:00
> To: David Elliott
> Cc: php-windows
> Subject: [PHP-WIN] Re: php with mssql
> 
> 
> Hello,
> 
>   I think changing to ODBC may cost lots of time  :(
> 
> ?ú?ú Wed, 13 Nov 2002 17:19:31 +0000 μ?à′D??Dìáμ1/2:
> 
> > Hail soff
> > 
> > On 13 November 2002 at 14:56:19 +0800 (which was 06:56 
> where I live) soff
> > rearranged electrons to get
> > 
> > > I am trying to connect mssql with php, when I use 
> mssql_pconnect(), It
> > > will fail to connect when the amount of visitors becomes 
> large. But,
> > > when I use mssql_connect(), I can only run SELECT quern, while the
> > > INSERT/UPDATE staments doesn't work. Can somebody tell me 
> why? thanks
> > > and sorry for my poor English :P
> > 
> > mssql_* uses the same library as used in mssql 6.5 (And 
> sybase however I
> > could be wrong with this one) to say it is flaky is an 
> understatement.
> > 
> > The following give problems.
> > 
> > (1) access the mssql library and then do a header location 
> sometimes gives a
> > CGI error.
> > 
> > (2) Multi line SQL statements don't work.
> > 
> > I suggest you either use ODBC or access the mssql interface 
> with a COM object
> > (like ASP)
> > 
> > -- 
> >  Thank you for your time,  
> _______________________________________________
> >   David                   |    David  Elliott    |   
> Software Engineer    |
> >  _________________________|  [EMAIL PROTECTED] | PGP Key 
> ID 0x650F4534  |
> > | ..then Lancelot, Robin and I will jump out of the Rabbit. 
>               |
> > 
> 
> -- 
> Welcome to http://www.soff.net
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
--- End Message ---
--- Begin Message ---
I recommend anyone using ODBC to access MSSQL to use the php_mssql.dll.
I have successfuly connected a test application and benchmarked with ab (
Apache Benchmar) 100000 hits without any errors  !

-Mike


On Thu, 14 Nov 2002, soff wrote:

> Date: Thu, 14 Nov 2002 15:00:05 +0800
> From: soff <[EMAIL PROTECTED]>
> To: David Elliott <[EMAIL PROTECTED]>
> Cc: php-windows <[EMAIL PROTECTED]>
> Subject: [PHP-WIN] Re: php with mssql
>
> Hello,
>
>   I think changing to ODBC may cost lots of time  :(
>
> 您在 Wed, 13 Nov 2002 17:19:31 +0000 的来信中提到:
>
> > Hail soff
> >
> > On 13 November 2002 at 14:56:19 +0800 (which was 06:56 where I live) soff
> > rearranged electrons to get
> >
> > > I am trying to connect mssql with php, when I use mssql_pconnect(), It
> > > will fail to connect when the amount of visitors becomes large. But,
> > > when I use mssql_connect(), I can only run SELECT quern, while the
> > > INSERT/UPDATE staments doesn't work. Can somebody tell me why? thanks
> > > and sorry for my poor English :P
> >
> > mssql_* uses the same library as used in mssql 6.5 (And sybase however I
> > could be wrong with this one) to say it is flaky is an understatement.
> >
> > The following give problems.
> >
> > (1) access the mssql library and then do a header location sometimes gives a
> > CGI error.
> >
> > (2) Multi line SQL statements don't work.
> >
> > I suggest you either use ODBC or access the mssql interface with a COM object
> > (like ASP)
> >
> > --
> >  Thank you for your time,  _______________________________________________
> >   David                   |    David  Elliott    |   Software Engineer    |
> >  _________________________|  [EMAIL PROTECTED] | PGP Key ID 0x650F4534  |
> > | ..then Lancelot, Robin and I will jump out of the Rabbit.               |
> >
>
> --
> Welcome to http://www.soff.net
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I know this is completely off-topic but I have searched and not found
answer...

I have PDF file which has printing disabled - a file given to me which i
need to print. Is it possible to re-enable?

( I have full Adobe PDF authoring package)


--- End Message ---
--- Begin Message ---
Kai,

I've moved this to the Windows list because someone else here might be able
to add something.

I'm afaid I didn't have to adjust anything within the PHP ini or anything -
for me it worked pretty much "out of the box".

With regards the registry - in order to check that you are using the
appropriate application id - simply open up regedit and search for the name
of the identifier you are using - if it's going to be used as a COM
identifier - it has to be in there somewhere.

Finding out what that identifier is though (if you don't already know it)
... is another matter ... the easiest way (I think) ... is to use
"HKEY_CLASSES_ROOT" in the registry ... browse through that list and look to
see if there is something appropriate.

In your case - for Media Player - I found "Mediaplayer.mediaplayer" in my
Windows 2000 server registry. It might be the one - but I haven't tried that
to see whether it works.

Basically - if you don't have documentation on the functions contained
within a COM object - you are a little shafted ... because it's going to be
very hard to know what functions to access and how.

Luckily - in my case - the application I interface with has full COM
documentation.

Sorry I can't be of more assistance.

Michael.

-----Original Message-----
From: kai [mailto:kai_flash@;hotmail.com]
Sent: 14 November 2002 19:05
To: [EMAIL PROTECTED]
Subject: Re: [PHP] runing com


Hi Michael,
thanks for your reply.

> Firstly - that error would suggest to me that Word is not installed on
your
> machine.

Thats true thats why i've been trying to start other applications like
wordpad,
just to see some funktionality.

>... try looking it up in the registry to confirm the registration
> for COM exists.

Maybe you can give me a little hint on that.
I've been creating some com components in vb some time ago,
but as I remember I had to register them with regsvr.exe  but that was
for dll's and stuff.

But hey I don't know exactly what you are suggesting, please help.

> Second ... why do you want to run media player to play a wave file on the
> server? I would have thought you'd want to activate the script on the
client

No, what I am trying to do is, if someone I know activates a button on my
site,
a sound file will play on my server, which is locate in my kitchen, to catch
my attention.

Further more I'd like to control outlook for different tasks.

> Another good idea is to check over the event viewer on the server - there
> are sometime some very revealing errors in there.

I've tried that, but did not see any entries related to my problem.

If your com code is running fine,
maybe you can remember if you have some special settings in
your php.ini, appache or win2k settings.

Any suggestion is welcome.

Thank you very much

KAi
"Michael Hazelden" <[EMAIL PROTECTED]> wrote in message
news:C1260EE72F22C44F833D033A17524AD702A4D159@;lhoexc1...
> I've been having some fun with COM myself recently ... so I can suggest a
> couple of things ...
>
> Firstly - that error would suggest to me that Word is not installed on
your
> machine. Remember - in order to interface with an app - it has to be
there.
> If it is ... try looking it up in the registry to confirm the registration
> for COM exists.
>
> Second ... why do you want to run media player to play a wave file on the
> server? I would have thought you'd want to activate the script on the
client
> ...
>
> Another good idea is to check over the event viewer on the server - there
> are sometime some very revealing errors in there.
>
> Cheers,
>
> Michael.
>
> -----Original Message-----
> From: kai [mailto:kai_flash@;hotmail.com]
> Sent: 14 November 2002 07:20
> To: [EMAIL PROTECTED]
> Subject: [PHP] runing com
>
>
> hi guy's I have a problem running com+ code and would appreciate any help.
>
> What I like to do is have the mediaplayer run a wave file triggert from
php
> via com.
> but I can not run any example code from the help without errors.
>
>
> this code is from a the help and should work but doesn't on my mashine:
>
> // starting word
> $word = new COM("word.application") or die("Unable to instanciate Word");
> print "Loaded Word, version {$word->Version}\n";
>
> file://bring it to front
> $word->Visible = 1;
> file://open an empty document
> $word->Documents->Add();
> file://do some weird stuff
> $word->Selection->TypeText("This is a test...");
> $word->Documents[1]->SaveAs("Useless test.doc");
> file://closing word
> $word->Quit();
> file://free the object
> $word->Release();
> $word = null;
>
> This is all very basic code and should run.
> I do not have word so I tried with other apps. like wordpad or painbrush
> but allways recieve this error:
>
> Warning: Invalid ProgID, GUID string, or Moniker: Invalid syntax in
> D:\Apache\htdocs\ring.php on line 7
> Unable to instanciate ..........
>
> Now I tried to give the access right's on the particular apps in dcomcnfg
> and
> also edited php.ini to
> allow Distributed-COM calls
> com.allow_dcom = true
>
>
> Does anybody can give me a run down on what I have to do exactly to get
this
> code running for
> let's say wordpad.
>
> Thank you
>
> KAi
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> _____________________________________________________________________
> This message has been checked for all known viruses by the
> MessageLabs Virus Control Centre.
>
> This message has been checked for all known viruses by the MessageLabs
Virus Control Centre.
>
>
> *********************************************************************
>
> Notice:  This email is confidential and may contain copyright material of
Ocado Limited (the "Company"). Opinions and views expressed in this message
may not necessarily reflect the opinions and views of the Company.
> If you are not the intended recipient, please notify us immediately and
delete all copies of this message. Please note that it is your
responsibility to scan this message for viruses.
>
> Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY
>
> *********************************************************************



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


_____________________________________________________________________
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.

        
*********************************************************************

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the "Company"). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*********************************************************************
--- End Message ---
--- Begin Message ---
"No One" <[EMAIL PROTECTED]> wrote in message
news:20021113214603.74387.qmail@;pb1.pair.com...
> Can I configure PHP to run with the Cold Fusion standalone server?  I
don't
> have IIS installed.  I'm on windows 2000 pro.

I don't think so, maybe you can hack it to work as a CGI, but it's not
something I would try to do


> I want to run the cold fusion server and be able to execute PHP scripts.
>
> Can anyone provide me with any guidance?

Personally I run Apache 1.3.x with both ColdFusion and PHP as a SAPI module
without any issu on Windows 2000 Pro

Massimo


--- End Message ---
--- Begin Message ---
anyone experience inetinfo.exe problem when shutdown?
i 've been looking at many forum. i saw some people asking regarding this problem. but 
never see anyone reply.

after running php page in PWS in win98 se, shutting down window always causes 
inetinfo.exe problem.
error is invalid page fault caused by php4ts.dll

Is this a bug of php4 ??
Please advise.

thanks,
gary

--- End Message ---
--- Begin Message ---
All,

I don't know if anyone could help me ... I am trying to set the default
printer for windows through PHP.

Let me explain - we have a number of reports, that exist in Cognos, we
access these reports through PHP and COM. However, various copies of these
reports need to go to different printers around the building.

Currently - we have two users and two scheduled jobs (one for each printer).
Since the number of reports and printers is about to explode (up to 10-15) I
don't want to have to set up 15 seperate users for each report/printer.

Cognos (via the COM interface) cannot select the printer it goes to. This
means that it will only ever print to the default printer. 

SO - what I'd like to do is change the default printer. But the only way -
currently - I've found is to use the W32API functions - e.g.

$result=w32api_register_function("winspool.drv","SetDefaultPrinterA","long")
;
$output=SetDefaultPrinterA("testqueue");

This works ... but it's a bit of a long way round ... anyone have a better
way?

Cheers,

Michael.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.

        
*********************************************************************

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the "Company"). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*********************************************************************
--- End Message ---
--- Begin Message ---
yes,  I try this code follow and it work fine  in my ENV (WinNt Apache 1.3.24
and PHP 4.2.3).

I do not remenber well but I think to do not have to modify anything in the
php.ini

the code:

 $result = passthru("visqdos.exe $filename 2");
 print_r($result);

where $filename and "2" are parm of the pgm (named visqdos.exe)

the same pgm link in different way:

exec("visqdos.exe $filename 2");

i hope you help.

Ciao Franco.


David Giragosian wrote:

> Howdy All,
>
> I have a C program that runs some queries on a MySQL db. I would like to
> trigger the program's execution from a web page. Can't seem to trigger the
> executable. Any thoughts/ideas/small code examples would be greatly
> appreciated.
>
> Thanks,    David
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
the following script is supposed to write a file and make a dir for a corrosponding 
forum the only problem is it keeps coming out as
1:bbs
1:bbs2
1:bbs21
instead of
1:bbs
2:bbs2
3:bbs21
any ideas?
<?php
if(!file_exists("./forum/"))
{
mkdir("./forum/", 0777);
}

if($_POST['dir'] == "")
{
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="dir" id="dir" />
<input type="submit" />
</form>
<?php
} else {
if(!file_exists("./forum/".$_POST['dir']."/"))
 {
  mkdir("./forum/".$_POST['dir']."/", 0777);
  echo "forum made";
 }
else
 {
  echo "forum already there";
 }
$forums = file("./forum/forums.xm");
for($f=0;$f<count($forums);$f++)
{
 $forums[$f] = explode(":",$forums[$f]);
 $forums[$f] = $forums[$f][0];
 settype($forums[$f],"integer");
}
natsort($forums);
$forums = $forums[count($forums)-1];
$forums = explode(":","",$forums);
$forums = $forums[0];
settype($forums,"integer");
$forums++;
if($fs=fopen("./forum/forums.xm","a"))
 {
  fwrite($fs,$forums.":".$_POST['dir']."\n");
  fclose($fs);
 }
}
?>
--- End Message ---
--- Begin Message ---
DaMouse,

Toss in a few extra 'echo' and 'print_r($array)' statements regarding to
your number and you'll figure it out. That's what I just did. Make it work
before you make it pretty :) I fill my code with echo and print_r statements
so I know what the code further down is getting.

Here's the fixed code: (note I commented out some of your code - that's all
that I did)

<?php
if(!file_exists("./forum/"))
{
mkdir("./forum/", 0777);
}

if(@$_POST['dir'] == "")
{
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="dir" id="dir" />
<input type="submit" />
</form>
<?php
} else {
if(!file_exists("./forum/".$_POST['dir']."/"))
 {
  mkdir("./forum/".$_POST['dir']."/", 0777);
  echo "forum made";
 }
else
 {
  echo "forum already there";
 }
$forums = file("./forum/forums.xm");
for($f=0;$f<count($forums);$f++)
{
 $forums[$f] = explode(":",$forums[$f]);
 $forums[$f] = $forums[$f][0];
 settype($forums[$f],"integer");
}
//print_r($forums);
natsort($forums);
$forums = $forums[count($forums)-1];
/* This stuff makes the $forums var = 0, then ++'ing that makes it 1
$forums = explode(":","",$forums);
$forums = $forums[0];
settype($forums,"integer");
*/
$forums++;
if($fs=fopen("./forum/forums.xm","a"))
 {
  fwrite($fs,$forums.":".$_POST['dir']."\n");
  fclose($fs);
 }
}
?>

-Dash

-----Original Message-----
From: DaMouse [mailto:damouse@;ntlworld.com] 
Sent: Tuesday, November 12, 2002 8:02 PM
To: PHP - Win
Subject: [PHP-WIN] incrementation error


the following script is supposed to write a file and make a dir for a
corrosponding forum the only problem is it keeps coming out as
1:bbs
1:bbs2
1:bbs21
instead of
1:bbs
2:bbs2
3:bbs21
any ideas?
<?php
if(!file_exists("./forum/"))
{
mkdir("./forum/", 0777);
}

if($_POST['dir'] == "")
{
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="dir" id="dir" />
<input type="submit" />
</form>
<?php
} else {
if(!file_exists("./forum/".$_POST['dir']."/"))
 {
  mkdir("./forum/".$_POST['dir']."/", 0777);
  echo "forum made";
 }
else
 {
  echo "forum already there";
 }
$forums = file("./forum/forums.xm");
for($f=0;$f<count($forums);$f++)
{
 $forums[$f] = explode(":",$forums[$f]);
 $forums[$f] = $forums[$f][0];
 settype($forums[$f],"integer");
}
natsort($forums);
$forums = $forums[count($forums)-1];
$forums = explode(":","",$forums);
$forums = $forums[0];
settype($forums,"integer");
$forums++;
if($fs=fopen("./forum/forums.xm","a"))
 {
  fwrite($fs,++$forums.":".$_POST['dir']."\n");
  fclose($fs);
 }
}
?>
--- End Message ---
--- Begin Message ---
Oops!  I actually meant to copy the whole list on this.. I need to remember
to hit the "Reply All" button :)

> What user is IIS running as?  Does it have access to those directories?

Thanks for thinking of that -- we checked the permissions of the user set up
to allow anonymous access to the site, and those permissions also grant Full
Control to the user.

We've also checked the IIS console to make sure the web site has Write and
Execute access.. and to make sure the temp directory is valid and also has
the proper permissions.

I tried to Google around for this.. but if anyone has seen setup
instructions for IIS -- not in installing PHP itself but in setting up the
IIS console beyond what the PHP 4.2.3 installer does by default -- please
let me know!

Thanks,
-Step

--- End Message ---
--- Begin Message ---
I have installed Apache 1.3.27 and PHP 4.2.3 and can not get it to run php
scripts.  I have gone through the install readme a couple of times to
confirm everything is as indicated.  When I call a script with php tags:  <?
phpinfo(); ?>   it does not launch php.  When I view the source, the text
for the file is all that is shown.  I am currently running the modules
configuration with the following lines in httpd.conf

LoadModule php4_module c:/php/sapi/php4apache.dll
AddModule mod_php4.c

AddType application/x-http-php .phtml .php
AddType application/x-http-php-source .phps

I have added the registry settings for php4isapi.dll , although I am not
sure if this is needed.  I tried with and without and it performs the same.

I do not get any sort of error message from Apache, the entry in the access
log file is:

127.0.0.1 - - [14/Nov/2002:11:32:21 -0700] "GET /phpinfo.php HTTP/1.1" 200
99

I am at a loss on this one.  I have even tried using Apache 2.0.43, but
could not get it to perform the LoadModule part correctly.  Gave up and went
back to 1.3.27

Are there any diagnostic tools I can use to see where this is going wrong?
I do not believe it is even calling php.  I did confirm the php installation
using php -i and piping this to an HTML  file that I could open.

The system I am using is running Windows XP professional with SP1 installed.

Thanks in Advance,
Scott Trosper
[EMAIL PROTECTED]




--- End Message ---

Reply via email to