php-windows Digest 2 Oct 2002 21:22:14 -0000 Issue 1368
Topics (messages 16125 through 16133):
Re: using exec on WIMP
16125 by: MWCT - Markus Weber
Re: note 25599 rejected from function.exec by betz
16126 by: MWCT - Markus Weber
Re: i need help with an undefined variable
16127 by: Anyang
16128 by: Anyang
16129 by: brother - Martin Bagge
Question Java blocking broncode
16130 by: M.B.
Re: Access Violations, CGI errors
16131 by: Brian 'Bex' Huff
apche loadmodule php help.
16132 by: Steve Bradwell
PHP & sendmail
16133 by: Nicole
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 ---
Hi,
thank you very much for help. I will try this solution.
Do you believe there is still a way to use the exec() function of PHP ?
regards,
markus weber
"J Wynia" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Mwct - Markus Weber wrote:
> > Hi,
> >
> > may be someone can help me:
> >
> > I want to use the exec() function to run an executable as background
> > process. This means my php script should not wait for the end of the
> > background process. I tried a lot but without success. My script always
wait
> > for the end of the background process.
> >
> > My php script contains this line:
> >
> > exec(getenv("COMSPEC").' /c c:\mysql\bin\mysql.exe <
> > E:/Inetpub/wwwroot/update/load_logs.sql >
> > E:/Inetpub/wwwroot/update/load_logs.log');
> >
> > Regarding to the online documentation on php.net all screen output is
> > redirected to the file "load_logs.log".
> >
> > When I type in this string via command line the execution is successful.
> >
> > As I learned from the online documentation on php.net is that on LINUX
> > systems something like "2>1&" or ">/dev/null" will help - but not on
> > Windows.
> >
> > Any ideas ?
>
> If this script will only ever be run on Windows servers, you can use the
> Windows-specific shell capabilities through the COM interface.
>
> $shell = new COM("WScript.Shell") or die("This thing requires Windows
> Scripting Host");
> $shell -> Run($commandinquotes,$windowstate,$wait);
>
> Replace $commandinquotes with your commandline that you want to run. Put
> it in single quotes. Replace $windowstate with 1, 2 or 3 for normal DOS
> window, minimized or maximized and $wait with 0 in your case because you
> don't want PHP to wait for the process to finish.
>
> You could abstract it further by turning the COM "Run" into your own
> function. The below code hasn't been tested.
>
> function win_exec($command, $windowstate, $wait) {
> $shell = new COM("WScript.Shell") or die("This thing requires Windows
> Scripting Host");
> $shell -> Run($commandinquotes,$windowstate,$wait);
> }
>
> $command = getenv("COMSPEC").' /c c:\mysql\bin\mysql.exe <
> > E:/Inetpub/wwwroot/update/load_logs.sql >
> > E:/Inetpub/wwwroot/update/load_logs.log';
>
> win_exec($command, "2", "0");
>
--- End Message ---
--- Begin Message ---
<[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]...
> I am running a WIMP configuration and I want to use exec() to call
mysql.exe via my PHP script to run a big sql script in the background. The
PHP script executes the sql script via mysql.exe but my PHP script hangs
until the mysql process has finished. Does anybody know how I can run the
exec() command totally in the background on a WIMP system ? (I tried a lot
with "2>1&" and "cmd/c" etc.)
------------------------------------------
Please read this from [EMAIL PROTECTED]:
Mwct - Markus Weber wrote:
> Hi,
>
> may be someone can help me:
>
> I want to use the exec() function to run an executable as background
> process. This means my php script should not wait for the end of the
> background process. I tried a lot but without success. My script always
wait
> for the end of the background process.
>
> My php script contains this line:
>
> exec(getenv("COMSPEC").' /c c:\mysql\bin\mysql.exe <
> E:/Inetpub/wwwroot/update/load_logs.sql >
> E:/Inetpub/wwwroot/update/load_logs.log');
>
> Regarding to the online documentation on php.net all screen output is
> redirected to the file "load_logs.log".
>
> When I type in this string via command line the execution is successful.
>
> As I learned from the online documentation on php.net is that on LINUX
> systems something like "2>1&" or ">/dev/null" will help - but not on
> Windows.
>
> Any ideas ?
If this script will only ever be run on Windows servers, you can use the
Windows-specific shell capabilities through the COM interface.
$shell = new COM("WScript.Shell") or die("This thing requires Windows
Scripting Host");
$shell -> Run($commandinquotes,$windowstate,$wait);
Replace $commandinquotes with your commandline that you want to run. Put
it in single quotes. Replace $windowstate with 1, 2 or 3 for normal DOS
window, minimized or maximized and $wait with 0 in your case because you
don't want PHP to wait for the process to finish.
You could abstract it further by turning the COM "Run" into your own
function. The below code hasn't been tested.
function win_exec($command, $windowstate, $wait) {
$shell = new COM("WScript.Shell") or die("This thing requires Windows
Scripting Host");
$shell -> Run($commandinquotes,$windowstate,$wait);
}
$command = getenv("COMSPEC").' /c c:\mysql\bin\mysql.exe <
> E:/Inetpub/wwwroot/update/load_logs.sql >
> E:/Inetpub/wwwroot/update/load_logs.log';
win_exec($command, "2", "0");
--- End Message ---
--- Begin Message ---
nope, hadn't tried it, thanks. I was looking for something that would do
that for me. I find it wierd that it would work on a host but not on my
comp. Thanks a lot. I'll get back to ya if it works or not
"Peter Houchin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> have u tried using $_GET["game"] or $_POST["game"] ? so your code is
>
> <?php
> > > >
> > > > include("head.html");
> > > >
> > > > if (!$_GET["game"]) {
> > > > include("public.html");
> > > > }
> > > > if ($_GET["game"] != NULL && $op != NULL) {
> > > > include("http://mywebsite.com/example/" . "$game" . ".html");
> > > > }
>
> or post instead of get in there?
>
> > -----Original Message-----
> > From: Anyang [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, 2 October 2002 1:43 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP-WIN] i need help with an undefined variable
> >
> >
> > Like i said, the other server understood it at a function of the
> > address bar
> > so if index.php?game=foobar then $game = foobar and it would refresh the
> > page with the foobar page in the center. This is what I want to do.
> >
> > "Peter Houchin" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > how r u getting $game? that's the undefind var.
> > >
> > > > -----Original Message-----
> > > > From: Anyang [mailto:[EMAIL PROTECTED]]
> > > > Sent: Wednesday, 2 October 2002 11:38 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP-WIN] i need help with an undefined variable
> > > >
> > > >
> > > > I wrote a php script for a page that I hosted on a separate
> > host and it
> > > > worked perfectly. I recently installed php 4 onto my windows XP Pro
> > build
> > > > 2600 computer and it seems to work until I try to use varuables
> > > > that look to
> > > > the address bar for reference.
> > > >
> > > > I wanted to make it so that when somebody clicks "game" it would go
to
> > > > www.mywebsite.com/index.php?game=example and that would merely
replace
> > the
> > > > body with the example page. It worked on my other host but when
> > > > I tried it
> > > > on my computer it says:
> > > >
> > > > Notice: Undefined variable: game in
> > C:\Xitami\webpages\index.php on line
> > 5
> > > >
> > > > Notice: Undefined variable: game in
> > C:\Xitami\webpages\index.php on line
> > 8
> > > >
> > > > My script says:
> > > >
> > > > <?php
> > > >
> > > > include("head.html");
> > > >
> > > > if (!$game) {
> > > > include("public.html");
> > > > }
> > > > if ($game != NULL && $op != NULL) {
> > > > include("http://mywebsite.com/example/" . "$game" . ".html");
> > > > }
> > > >
> > > >
> > > > any ideas? please help. if there's any script i can type and
> > > > have all the
> > > > pages require it so that this can be defined that would work great.
> > > >
> > > >
> > > >
> > > > --
> > > > PHP Windows Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
--- End Message ---
--- Begin Message ---
it's giving me this now:
Notice: Undefined index: game in C:\Xitami\webpages\index.php on line 5
Notice: Undefined index: game in C:\Xitami\webpages\index.php on line 8
because i'm opening index.php without using ?game=
is there anything I can do to not get it to say that? it's not reading
$_GET["game"] as NULL but as undefined instead.
"Peter Houchin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> have u tried using $_GET["game"] or $_POST["game"] ? so your code is
>
> <?php
> > > >
> > > > include("head.html");
> > > >
> > > > if (!$_GET["game"]) {
> > > > include("public.html");
> > > > }
> > > > if ($_GET["game"] != NULL && $op != NULL) {
> > > > include("http://mywebsite.com/example/" . "$game" . ".html");
> > > > }
>
> or post instead of get in there?
>
> > -----Original Message-----
> > From: Anyang [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, 2 October 2002 1:43 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP-WIN] i need help with an undefined variable
> >
> >
> > Like i said, the other server understood it at a function of the
> > address bar
> > so if index.php?game=foobar then $game = foobar and it would refresh the
> > page with the foobar page in the center. This is what I want to do.
> >
> > "Peter Houchin" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > how r u getting $game? that's the undefind var.
> > >
> > > > -----Original Message-----
> > > > From: Anyang [mailto:[EMAIL PROTECTED]]
> > > > Sent: Wednesday, 2 October 2002 11:38 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP-WIN] i need help with an undefined variable
> > > >
> > > >
> > > > I wrote a php script for a page that I hosted on a separate
> > host and it
> > > > worked perfectly. I recently installed php 4 onto my windows XP Pro
> > build
> > > > 2600 computer and it seems to work until I try to use varuables
> > > > that look to
> > > > the address bar for reference.
> > > >
> > > > I wanted to make it so that when somebody clicks "game" it would go
to
> > > > www.mywebsite.com/index.php?game=example and that would merely
replace
> > the
> > > > body with the example page. It worked on my other host but when
> > > > I tried it
> > > > on my computer it says:
> > > >
> > > > Notice: Undefined variable: game in
> > C:\Xitami\webpages\index.php on line
> > 5
> > > >
> > > > Notice: Undefined variable: game in
> > C:\Xitami\webpages\index.php on line
> > 8
> > > >
> > > > My script says:
> > > >
> > > > <?php
> > > >
> > > > include("head.html");
> > > >
> > > > if (!$game) {
> > > > include("public.html");
> > > > }
> > > > if ($game != NULL && $op != NULL) {
> > > > include("http://mywebsite.com/example/" . "$game" . ".html");
> > > > }
> > > >
> > > >
> > > > any ideas? please help. if there's any script i can type and
> > > > have all the
> > > > pages require it so that this can be defined that would work great.
> > > >
> > > >
> > > >
> > > > --
> > > > PHP Windows Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
--- End Message ---
--- Begin Message ---
Anyang:
> it's giving me this now:
> Notice: Undefined index: game in C:\Xitami\webpages\index.php on line
> 5 Notice: Undefined index: game in C:\Xitami\webpages\index.php on
> line 8
>
> because i'm opening index.php without using ?game=
> is there anything I can do to not get it to say that? it's not
> reading $_GET["game"] as NULL but as undefined instead.
if (!isset($_GET["game"])) {
$game = "?"; //well what was an expected situation for requests without game
var?
} else {
$game = $_GET["game"];
}
then carry on with the code.
--- End Message ---
--- Begin Message ---
I know that this isn't really the place to ask, but mabey someone knows:
Does anyone know, if it is possible WHIT a JAVASCRIPT to block the broncode
so that you can't see it at all (also when you would save the page)?
I know that there is a script of it in PHP format (if any one knwos were I
can get it, it would be nice) but I haven't found one yet specially fo java,
and it has to be java becuase it will be used for a site that don't accept
php.
So I really would like to know if anyone knows if sutch a script is really
there and were I can get it for java (and ofcourse also for PHP, as I asked
in this question before).
So (verry important) I need it so that when I go to my broncode there will
be nothing to view also when you save the page!!!
M.B.
--- End Message ---
--- Begin Message ---
The SAPI module for IIS is faster than the CGI, but still not quite as
stable. There are open bugs about the access violations you mentioned
on some versions of IIS... they're being worked on, but from what I can
see the errors make no sense, so its tough to track them down.
As far as a bazillion CGI errors go, I'd first make sure that you
followed the CGI install docs for IIS to the letter:
http://www.php.net/manual/en/install.iis.php#install.iis.iis4
And test it with a simple "hello world" php page:
<?php
echo "Hello world!\n";
?>
that should cut down on the number of errors you are getting. If the
diagnostic errors still make no sense, post them to the list and
somebody will probably have seen them before, and be able to point you
in the right direction.
--
Brian 'Bex' Huff
[EMAIL PROTECTED]
Phone: 952-903-2023
Fax: 952-829-5424
--- End Message ---
--- Begin Message ---
Hello all,
I am in the process of changing my win 98 box to a 2000 box and am also
upgrading from apache 1.3.23 to 1.3.26. Unfortunatly I took the easy route
and simply copied my old httpd.conf file over the existing httpd.conf. All
is fine except Apache has a problem with the line:
"LoadModule php4_module c:/Program
Files/Apache/Apache/php/sapi/php4apache.dll"
Apache says "Load module takes 2 arguments..."
Can anyone help me with what I have done wrong? This works with 1.3.23 but
not with 1.3.26, do I need some kind of seperator in this line to specify
that it is 2 arguments?
Thanks alot,
Steve.
--- End Message ---
--- Begin Message ---
Hello,
Would someone give me an example of using sendmail from PHP instead of the
usual mail() function.
Thanks!
Nicole
--- End Message ---