php-windows Digest 2 Jul 2008 14:45:31 -0000 Issue 3500

Topics (messages 28988 through 28990):

Re: Remove End of Line Characters
        28988 by: Zephaniah ha Levi

Executing Shell Scripts in PHP
        28989 by: Wei, Alice J.

COM-problem: Uninitializing COM-Objects <-> runtime error
        28990 by: Mario Trojan

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 ---
she resolved issue yesterday by changing line:
str_replace($carriage, "", $lines4[$i]);

to 

$lines4[$i] = str_replace($carriage, "", $lines4[$i]);



-----Original Message-----
From: M. Sokolewicz [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 01, 2008 5:10 AM
To: Wei, Alice J.
Cc: Zephaniah ha Levi; [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Remove End of Line Characters

Wei, Alice J. wrote:
> Hi,
> 
> for ($i=1; $i <= 3; $i++) {
> 
> echo $i . ": " . $lines4[$i] . "\n";
> list($words, $file) = explode(" ", $lines4[$i]);
> $carriage= array("\r\n", "\r", "\n");
> str_replace($carriage, "", $lines4[$i]);
> echo "File: $file has $words words\n\n";
> $query3="INSERT INTO youtoo(Description,Filename,Words) VALUES
('$lines4[0]','$file', '$words')";
> $result1= mssql_query($query3) or die ("Couldn't Create New Entry into
Database $myDB");
> 
> }
> 
> Is this the change  you told me to change? Or, am I having some other
issues here in this revised code?
> I have just checked my database, and it is still giving me the same
square. Could there be something else that I have missed?
> 
> Thanks for your help.
> 
> Alice

You do realise that you're not assigning the result of the str_replace 
to anything, right? Thus, the entire statement is basically... useless 
(you're replacing all \r, \n, \r\n (this last one will never exist since 
all \r and \n, including \r\n have already been replaced) in a copy of 
$lines4[$i], and then never using that).

Please, post a couple of lines from the files and what you want them to 
become (exactly). I'm a bit confused with just the "first line in the 
Description column, and have each of the following lines  be entered 
into the database by assigning the number as $words, and the filename 
into the Filename column" without being able to see what you're talking 
about in the first place.

- Tul


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


--- End Message ---
--- Begin Message ---
Hi,

  I am wondering if anyone on this list has made attempts of executing shell 
scripts using PHP.
  Here is the code:

<?php

$command = "gcc -o hello.c";
exec($command);

?>

  So far, the actual program is something simple that prints out Hello, World. 
I have tried using

// create a new cURL resource

$ch = curl_init();

// set URL and other appropriate options

curl_setopt($ch, CURLOPT_URL, "http://localhost/hello.c";);

curl_setopt($ch, CURLOPT_HEADER, false);

All I got is the actual code content that is in one single long string. As for 
using the PHP snippet I have at the beginning of the email, all I get is a 
blank page, although it does not give me errors of the actual PHP program. 
Could anyone please tell me what problem I might be having here?

Anything is appreciated.

Alice
======================================================
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Hi,

i have a problem regarding some COM objects, especially with unitializing. It is possible to create a new COM object without problems, but at the end of each script a message is shown by the Microsoft Visual C++ Runtime Library:

"This application has requested the runtime to terminate it in a unusual way. Please contact the application's support team for more information".

I think that this message is thrown if one of the used COM objects wasn't uninitialized properly. Many COM objects have a method that needs to be called for uninitialization (e.g. Quit()), but some objects don't. And as soon as i try to work with one of these objects, the error message mentioned above is shown.

Is there any way to uninitialize the COM-object anyway, or at least to suppress that error message so that the script may end properly (otherwise a keypress is needed to end the script)?

This problem occurs with PHP versions between 5.2.1 and 5.2.6, i didn't test it with other versions yet.

Best Regards,
Mario Trojan

--- End Message ---

Reply via email to