php-windows Digest 11 Oct 2003 17:57:36 -0000 Issue 1951
Topics (messages 21752 through 21755):
PWS exec(), system(), shell_exec()
21752 by: Yingyuan D Hsu
include_path problem
21753 by: Muhammad Imran
php with MS Acces
21754 by: Masterblue
I can't make a 'read_tag.php' file
21755 by: Bas
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 ---
I saw quite few post on this and none of them
worked on my Win98SE PWS.
I wonder if anyone got it to work and what
is your settings.
I can get each command to start but they
never returned and, therefore, the browser
keep waiting. For system(), I can see the output
but the next php statement never get executed.
For shell_exec(), it doesn't show anything.
Both command works on command line:
C:\>php.exe xxx.php
My Win98SE is setuped with default user as ''
(i.e. empty) which I have trouble install
PWS without error. I create a seperate account
and was able to install PWS without error. But
it doesn't matter what I do, I got the same
result.
Can anyone help? Thanks. Duncan
--- End Message ---
--- Begin Message ---
I am trying to use PEAR DB interface, I have include it in my include_path
but when script run it unable to find it. Can any one help me. I am using
RH
8 and PHP 4.3.3.
Is it file permission error
error message come like:
Warning: main(DB.php): failed to open stream: No such file or directory in
/www/test.php on line 9
Fatal error: main(): Failed opening required 'DB.php'
(include_path='.:/home/sqlguru/php4/lib/php') in /www/test.php on line 9
Imran
--- End Message ---
--- Begin Message ---
I tried the code below but i got an error ,
Im on a win2000 machine and I use php 4.3.3
Could someone help me out please!!!
----- Code -----
$db = '\\\\server\\resource\\db.mdb';
$conn = new COM('ADODB.Connection');
$conn->Open("DRIVER={Driver do Microsoft Access (*.mdb)}; DBQ=$db");
// Driver do Microsoft Access (*.mdb)
// must be the name in your odbc drivers, the one you get
// from the Data Sources (ODBC).
// In this case, I'm in Mexico but the driver name is in portuguese, thanks
Microsoft.
$sql = 'SELECT username FROM tblUsuarios';
$res = $conn->Execute($sql);
while (!$res->EOF)
{
print $res->Fields['username']->Value . "<br>";
$res->MoveNext();
}
$res->Close();
$conn->Close();
$res = null;
$conn = null;
----- End Code -----
---The error ---
Warning: (null)(): Invoke() failed: Exception occurred. Source: Microsoft
OLE DB Provider for ODBC Drivers Description: [Microsoft][ODBC Microsoft
Access Driver]General error Unable to open registry key 'Temporary
(volatile) Jet DSN for process 0x5d8 Thread 0x1c4 DBC 0xae82f4 Jet'. in
E:\database.php on line 13
Warning: (null)(): Invoke() failed: Exception occurred. Source:
ADODB.Connection Description: Operation is not allowed when the object is
closed. in E:\database.php on line 21
Fatal error: Call to a member function on a non-object in E:\database.php on
line 25
---End of The error ---
--- End Message ---
--- Begin Message ---
I have found that this script doesn't work:
read_tag.php
---
<?php
function readTag($filename, $tagtype, $debug = 0) {
$filedata = file_get_contents($filename);
$tagrealname = "<bttag=";
$tagrealname .= $tagtype;
$tagrealname .= ">";
$tagdata = stristr($filedata, $tagrealname);
$posofend = strpos($tagdata, "</bttag>");
$length = strlen($tagdata);
$lengthoftag = strlen($tagrealname);
$lengthofend = strlen("</bttag>");
$lengthofstr = $length - $posofend - $lengthoftag;
$returndata = substr($tagdata, $lengthoftag, $lengthofstr);
if ($debug == 1) {
echo "<br>Length = " . $length;
echo "<br>Of Tag = " . $lengthoftag;
echo "<br>Of Str = " . $lengthofstr;
echo "<br>Of End = " . $posofend;
echo "<br>TagData:<br>" . $tagdata;
}
return $returndata;
}
?>
<HTML>
<BODY>
<h1>Test readTag-functie</h1>
<?php echo readTag("test.tag", "bassie", 1); ?>
</body>
</html>
---
And with this, it needs the file 'test.tag'
---
<bttag=bassie>
I am myself!!
</bttag>
<bttag=test>
This is a test!!!
</bttag>
<bttag=welcome>
Welcome!!!
</bttag>
<bttag=close>
Closing!!!
</bttag>
---
The first parameter of the readTag function is the filename of the tag file.
The second is the tag to search for an the third is the debug mode.
The error is that if i load this, the readTag function returns everything
except for the Closing!!!
What's wrong?
--- End Message ---