php-windows Digest 28 Aug 2001 09:55:42 -0000 Issue 724

Topics (messages 9077 through 9086):

Re: printer_start_doc
        9077 by: Rob Cox

Accelerate PHP on Win98SE?????????
        9078 by: king

Re: Directory Date/Time
        9079 by: David Tod Sigafoos
        9080 by: Frank M. Kromann

calling COM objects from PHP
        9081 by: Haemish Graham
        9084 by: Alain Samoun

Curl/php/Apache on Win32
        9082 by: Chris
        9085 by: hassan el forkani

Re: <br> appear in Text file
        9083 by: Andy Ladouceur

Generating variables
        9086 by: P.Agenbag

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]


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


Thanks for the info on using printer_draw_text.


"Daniel Beulshausen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 15:08 24.08.2001 -0400, Rob Cox wrote:
> >Updated to 4.0.7rc1 and it still didn't work.
> >Here's my snippet:
> >
> >$handle = printer_open("\\\kinkos\\kinkos");
> >printer_start_doc($handle, "Project Status");
> >printer_start_page($handle);
> >printer_write($handle, "any text");
> >printer_end_page($handle);
> >printer_end_doc($handle);
> >printer_close($handle);
>
> i'm unable to reproduce this locally, i'll try to figure that out in a
> network later.
> which OS is the server/client running.
> btw: don't use printer_write. it's for sending raw printer data, you'll
> have to do something like
>
> $handle = printer_open();
> printer_set_option($handle, PRINTER_MODE, "TEXT");
> printer_write($handle, "Text to print");
> printer_close($handle);
>
> better see http://php.net/manual/en/function.printer-draw-text.php
>
> daniel
>
> p.s.: you can also contact me privately
>
> >"Rob Cox" <[EMAIL PROTECTED]> wrote in message
> >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > I will give it a try. Thanks.
> > >
> > > "Daniel Beulshausen" <[EMAIL PROTECTED]> wrote in message
> > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > At 14:20 24.08.2001 -0400, Rob Cox wrote:
> > > > >I've made sure that the printer is available to IUSR_ALPHA (my
server).
> > > The
> > > > >printer is actually open to everyone but I made sure that
IUSR_ALPHA
> >was
> > > > >specified too. Nothing. Still get the same error.
> > > >
> > > > please try http://www.php4win.com/~daniel/php-4.0.7rc1-win32.zip
> > > > there have been some fixes to the extension since 4.0.6.
> > > > if that still doesn't work please provide some reproducing code.
> > > > sounds like printer_start_doc() is failing (permission problem, no
> >device
> > > > context created/failed,...).
> > > >
> > > > daniel
> > > >
> > > >
> > > >
> > > > >"Erik H. Mathy" <[EMAIL PROTECTED]> wrote in message
> > > > >005101c12cc2$fb03c390$1300020a@erik_laptop">news:005101c12cc2$fb03c390$1300020a@erik_laptop...
> > > > > > > Yes I believe that I a m running under the IUSR_ComputerName
> > > account.
> > > > >I'll
> > > > > > > have to verify permissions.
> > > > > >
> > > > > > Do that. If it's a printer being shared over the network, it's
> >subject
> > > to
> > > > > > either the domain permissions or the permissions specific to the
box
> > > doing
> > > > > > the sharing (or both, actually). Wow. That was a long-ass runon
> > > sentence!
> > > > > >
> > > > > > > I've just noticed that the handle that is being returned is
> >showing
> > > as
> > > > > > > 'Resource id #1'.  I have no idea about that but it makes
sense
> >that
> > > if
> > > > >I
> > > > > > > don't have a proper handle, I won't be able to create a doc.
> > > > > >
> > > > > > That's because you're running PHP4. It ID's things like
connections,
> > > > > > etc...as Resource #(whathaveyou). It's an interesting way to
keep
> > > track of
> > > > > > how many major resources you have in a script. ;)
> > > > > >
> > > > > > > I would like to thank you Erik. You pushed me in the right
> > > > > > > direction to get to here.
> > > > > >
> > > > > > Bah, piffle, tain't no thing. It's nothing you wouldn't have
come up
> > > with,
> > > > > > I'm sure. Besides...it's good karma. You get some, you pass it
on!
> > > > > >
> > > > > > - Erik
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >--
> > > > >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]
> > > >
> > > >
> > > > /*--
> > > > daniel beulshausen - [EMAIL PROTECTED]
> > > > using php on windows? http://www.php4win.de
> > > >
> > >
> > >
> >
> >
> >
> >--
> >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]
>
>
> /*--
> daniel beulshausen
> [EMAIL PROTECTED] - [EMAIL PROTECTED]
> using php on windows? http://www.php4win.com
>






Which soft can do it???

like Zend Optimizer on NT.






I could really use some help on this .. I know there must be someone
out there who knows:

a) is it possible to get the date/time from a directory in windows
(win2k)

b) if it is possible .. then how

As mentioned in my original post I have tried both filemtime and
fileatime.  Here are the specific lines ..

<snip>
        $current_dir = "h:\my music";
        $dir = opendir($current_dir);
        
        echo "Upload Directory is $current_dir<br>";
        echo "Directory Listing:<br><hr><br>";
        while ($file = readdir($dir)) {
                echo "$file&nbsp;&nbsp;";
                echo date("j F Y H:i",filemtime($file)) . "<br>";
                echo date("j F Y H:i",fileatime($file)) . "<br>";
</snip>

There will be no date except for the . and .. directories.  The rest
will be 31 december 1969.  Now this was a great year but ...

So anyone with good info please respond.  I need to get this working

Thanks

DSig

On Sun, 26 Aug 2001 14:43:55 -0700, [EMAIL PROTECTED] (David Tod
Sigafoos) wrote:

>I am trying to get the date/time off of a directory.
>
>I have tried both fileatime and filemtime but both return a null
>
>Any ideas?  Sample of working code?
>
>  
>
>-- 
>DSig                                 `````
>David Tod Sigafoos                  ( O O )
>mailto:[EMAIL PROTECTED] _______oOOo__( )__oOOo_______
>
>Using 'The Bat' 1.53 Beta/4
>





Hi David,

The argument to the functions filemtime(), fileatime() and  filectime() should be a 
valid file name. In your case readdir() returns file names in the directory located by 
$current_dir but these files does not exist in the current directry where the script 
is executed.

You can fix this by adding the fill path when calling filemtime("$current_dir/$file"). 
This should fix your problem.

- Frank

> I could really use some help on this .. I know there must be someone
> out there who knows:
> 
> a) is it possible to get the date/time from a directory in windows
> (win2k)
> 
> b) if it is possible .. then how
> 
> As mentioned in my original post I have tried both filemtime and
> fileatime.  Here are the specific lines ..
> 
> <snip>
>       $current_dir = "h:\my music";
>       $dir = opendir($current_dir);
>       
>       echo "Upload Directory is $current_dir<br>";
>       echo "Directory Listing:<br><hr><br>";
>       while ($file = readdir($dir)) {
>               echo "$file  ";
>               echo date("j F Y H:i",filemtime($file)) . "<br>";
>               echo date("j F Y H:i",fileatime($file)) . "<br>";
> </snip>
> 
> There will be no date except for the . and .. directories.  The rest
> will be 31 december 1969.  Now this was a great year but ...
> 
> So anyone with good info please respond.  I need to get this working
> 
> Thanks
> 
> DSig
> 
> On Sun, 26 Aug 2001 14:43:55 -0700, [EMAIL PROTECTED] (David Tod
> Sigafoos) wrote:
> 
> >I am trying to get the date/time off of a directory.
> >
> >I have tried both fileatime and filemtime but both return a null
> >
> >Any ideas?  Sample of working code?
> >
> >  
> >
> >-- 
> >DSig                                 `````
> >David Tod Sigafoos                  ( O O )
> >mailto:[EMAIL PROTECTED] _______oOOo__( )__oOOo_______
> >
> >Using 'The Bat' 1.53 Beta/4
> >
> 
> 
> -- 
> 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.

I wrote a COM object today that returns the filename of the current winamp 
track running on my machine but do not seem to be able to get PHP to return 
the filename property. I tested my COM object using a stand alone VB script 
and a ColdFusion script with IIS, and it all worked. However running Apache 
and PHP (4.06) on a Windows 2000 box I get the following results:

----------8<----------8<----------8<----------8<----------
<?php
print "PHP version ". phpversion()."<br>\n";
$webamp = com_load( "WebAmp.WebAmpCtl" )  or die ("Could not create COM 
object");
$filename = com_get( $webamp, "sFilename" ) or die ("Could not get COM 
property");
$webamp = NULL;
?>
----------8<----------8<----------8<----------8<----------
PHP version 4.0.6

Warning: Error in php_OLECHAR_to_char() in d:\clients\haemish\index.html on 
line 46
Could not get COM property
----------8<----------8<----------8<----------8<----------

Does any one know just how reliable the COM interface is in PHP or if there 
are any tweaks that have to be done to the COM object. The COM object is 
written in VC++ 6.0 and I am quite happy to share the source if it will 
help solve the problem (although there really is not much there yet:)

Cheers.

-haemish





Try:
$webamp = New COM("WebAmp.WebAmpCtl") or die ("Could not create COM object");
$filename = $webamp->sFilename;
Sometimes it works better...
Otherwise, what is the value of $filename that you are expecting?
Alain

On Tue, Aug 28, 2001 at 12:24:48AM +0100, Haemish Graham wrote:
> Hi.
> 
> I wrote a COM object today that returns the filename of the current winamp 
> track running on my machine but do not seem to be able to get PHP to return 
> the filename property. I tested my COM object using a stand alone VB script 
> and a ColdFusion script with IIS, and it all worked. However running Apache 
> and PHP (4.06) on a Windows 2000 box I get the following results:
> 
> ----------8<----------8<----------8<----------8<----------
> <?php
> print "PHP version ". phpversion()."<br>\n";
> $webamp = com_load( "WebAmp.WebAmpCtl" )  or die ("Could not create COM 
> object");
> $filename = com_get( $webamp, "sFilename" ) or die ("Could not get COM 
> property");
> $webamp = NULL;
> ?>
> ----------8<----------8<----------8<----------8<----------
> PHP version 4.0.6
> 
> Warning: Error in php_OLECHAR_to_char() in d:\clients\haemish\index.html on 
> line 46
> Could not get COM property
> ----------8<----------8<----------8<----------8<----------
> 
> Does any one know just how reliable the COM interface is in PHP or if there 
> are any tweaks that have to be done to the COM object. The COM object is 
> written in VC++ 6.0 and I am quite happy to share the source if it will 
> help solve the problem (although there really is not much there yet:)
> 
> Cheers.
> 
> -haemish
> 
> 
> -- 
> 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]




Hello

 Does anyone know how to install and use php_curl.dll for php.
I set extension=c:\phpdev2\php\extension\ and also tried copying files
SSLEAY32.dll,
php4ts.dll,
libeay32.dll in to the winodws system directory and set extension to that
but still no sucess.

I always get a error message saying
"Warning: Unable to load dynamic library
'c:\phpdev2\php\extensions\php_curl.dll' - A device attached to the system
is not functioning"

And also try using  Dependency Wlaker 2.1 but I get error of "Error: At
least one module has an unresolved import due to a missing export function
in an implicitly dependent module."

Can anyone help
Thanks






hi
you probably have a missing dll some where try editing php_curl.dll and 
search for "dll" (dlls referenced in that dll) make sure all dlls you find 
are in your win../sys.. directory

www.php4win.de provides a full package with all the dlls you need

regards;

At 01:15 28/08/01, Chris wrote:
>Hello
>
>  Does anyone know how to install and use php_curl.dll for php.
>I set extension=c:\phpdev2\php\extension\ and also tried copying files
>SSLEAY32.dll,
>php4ts.dll,
>libeay32.dll in to the winodws system directory and set extension to that
>but still no sucess.
>
>I always get a error message saying
>"Warning: Unable to load dynamic library
>'c:\phpdev2\php\extensions\php_curl.dll' - A device attached to the system
>is not functioning"
>
>And also try using  Dependency Wlaker 2.1 but I get error of "Error: At
>least one module has an unresolved import due to a missing export function
>in an implicitly dependent module."
>
>Can anyone help
>Thanks
>
>
>
>--
>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 Jack,
The 'black box' you see is a newline, which can be removed by doing this:
$string=str_replace("\n","",$string);
$string=str_replace("\r","",$string);

That will replace \n (The newlines) and \r (The returns) with nothing,
getting rid of your problem. Hope this helps,
-Andy
Jack <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Dear all
> I'm writing a script which will greb the data from a user input form into
a
> text file (txt file), but the problem is that when the data had passed to
> the txt file, there will be some thing like the <br> and black square
appear
> inside the file. This is affecting to display the data from that txt file
to
> the text box in (input box).
> Is there anyway that i can do to avoid grebing the <br> from txt file to
my
> input box's value? or anyway that i can delete the <br> when the data is
> greb from input box to txt file??
>
> Thanks a lot
>
> Jack
> [EMAIL PROTECTED]
>
>
>






Hi, I've posted this on the genral mailing list, yet I got no response,
maybe too crowded there???


I am trying to auto generate some sql strings.
The resulting string should look like this:
update $table_name set var1='$var1', var2='$var2' ............. where
id=$id

I used a foreach loop to get the keys from a table and in each foreach
loop I tried the following.
foreach($myrow as $key=>$val) {
$var_list .= " $key = '\$$key', ";
}


The first php page is the "table generator"; VIEW_ALL.PHP
<?php
$username_1 = "user";
$password_1 = "password";
$db_name = "test";
$table_name = "users_db";
$link = mysql_connect("localhost",$username_1,$password_1);
mysql_select_db($db_name,$link);
$sql = "select * from $table_name";
$result = mysql_query($sql);
$result_2 = mysql_query($sql);
echo "<table border=\"1\">";
$myrow = mysql_fetch_assoc($result);
echo"<tr bgcolor=\"#CCCCCC\">";
foreach($myrow as $key=>$val) {
echo "<td><b>$key</b></td>";
}
echo"</tr>";
$count = 2;
while($myrow_2 = mysql_fetch_assoc($result_2)) {
 $id = $myrow_2["id"];
 if ($count == 2) {
  $bgcol = "#FFFFFF";
  $count = $count - 1;
 }
else {
  $bgcol = "#EFEFEF";
  $count = $count + 1;
 }
echo"<tr bgcolor=\"$bgcol\">";
foreach($myrow_2 as $key=>$val) {
echo"<td>$val</td>";
}
echo"<td><a
href=\"edit.php?id_1=$id&table_name=$table_name&db_name=$db_name&username_1=$username_1&password_1=$password_1\">Edit</a></td>";

echo"</tr>";
}
echo"</table>";
?>

Goes through to EDIT.PHP
<?php
$link = mysql_connect("localhost",$username_1,$password_1);
mysql_select_db($db_name,$link);
$sql = "select * from $table_name where id=$id_1";
$result = mysql_query($sql);
$myrow = mysql_fetch_assoc($result);
$count_fields = 0;
echo"<form name=\"form_1\" method=\"post\"
action=\"update.php?username_1=$username_1&password_1=$password_1&db_name=$db_name&table_name=$table_name\">";

echo"<table border\"1\">";
foreach($myrow as $key=>$val) {
echo"<tr bgcolor=\"#CCCCCC\"><td>$key</td><td><textarea
name=\"$key\">$val</textarea></td></tr>";
$var_list_1 .= "$key = '\$$key',";
$count_fields = $count_fields + 1;
}
echo"</table>";
$count = strlen($var_list);
$new_count = $count - 1;
$var_list_1[$new_count] = "";
echo"<input type=\"hidden\" name=\"var_list\" value=\"$var_list_1\">";
echo"<input type=\"submit\" value=\"submit\" name=\"submit\">";
echo"</form>";
?>

And this goes to UPDATE.PHP

<?php
$link = mysql_connect("localhost",$username_1,$password_1);
mysql_select_db($db_name,$link);
$sql_1 = "update $table_name set $var_list where id=$id";
$result = mysql_query($sql_1);
echo "Your data has been updated!<br>";
echo  "$sql_1 <br>";
echo "result: $result<br>";
?>

This is where the problems comes in, the SQL is not brought over
correctly, rather is written "as-is" with the single quotes \-ed out,
can someone plz help me?



Reply via email to