php-windows Digest 28 Mar 2001 21:11:38 -0000 Issue 515

Topics (messages 6346 through 6358):

Re: Array How To ???
        6346 by: Andreas Lange

session handling
        6347 by: \[Inf\] F!RE-WALL
        6352 by: Johannes Janson

Re: [PHP] session handling
        6348 by: Pavel Kalian
        6349 by: Pavel Kalian
        6351 by: \[Inf\] F!RE-WALL

Date function
        6350 by: Lars Eirik Rønning

Re: [PHP-DB] auto_increment in mysql
        6353 by: Ben Cairns
        6354 by: Phil Driscoll

PHP and Filesystem
        6355 by: Thomas W. Badera
        6356 by: Thomas W. Badera

IIS 4 Index Server and PHP docs
        6357 by: Asendorf, John

FDF Help
        6358 by: Conover, Ryan

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]


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


Hi

> -----Original Message-----
> From: Barry [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, March 27, 2001 10:23 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Array How To ???
> 
> 
> Hello Everyone,
> 
> I would like to sort a list of array indices. The array is 
> multi- dimensional N x 3
> 
> for example, if (note the actual data is not important to my 
> question):
> 
> $a[0]['a'] = 1, $a[0]['b'] = 2, $a[0]['c'] = 3
> $a[1]['a'] = 1, $a[1]['b'] = 2, $a[1]['c'] = 3
> $a[2]['a'] = 1, $a[2]['b'] = 2, $a[2]['c'] = 3
> 
> Q1) I will use the "usort" user sort function. I see the 
> example for multi-dimensional arrays in the manual (they use 
> fruits, not a b c). Does usort work in Windows (NT4 machine, 
> PHP 4.04, running as cgi) ?

yes, used it some time ago ;)

> 
> Q2) The array $a will be stored in a session. I will want to 
> clear $a and then  recreate and resort $a. How do I clear a 
> variable or array ?

easiest way:
unset($a);

or for a specific item

unset($a[1]);

> For example, if the first time I create $a it gets up to 
> $a[30] (remember $a is saved in a session), but if I recreate 
> $a and the indices only go to $a[20], I need to be sure 
> $a[21] to $a[30] no longer exist. Easiest way: clear $a 
> before recreating it.
> 
> Q3) The $a array will be generated from the results of a 
> mysql database query. Is it realistic to save the results set 
> ($res) of a query ($res =
> mysql_query($sql)) in a session? I think the size of $res 
> won't exceed 32KB. Is there a session storage size limit for Windows?

hmm .. i don't know, but do not store the $res ... read the query line
by line into an array:

// Read the whole query and put it into a 2D Array
@unset($storearray);
while($row=mysql_fetch_array($res,MYSQL_ASSOC))
{
        $storearray[]=$row;
}

then put the storearray into your session ;)

> Thanks very much for your experience,
> Barry.

hope this helps ;)

CodeDuck

> 
> 
> 
> -- 
> 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]
> 





Every time I want to initiate a session i get this:

Warning: open(/tmp\sess_b18426d4011c38e033bd0ed54bd2d2f1, O_RDWR) failed: m
(2) in e:\webserver\phptest\page1.php on line 2

Warning: open(/tmp\sess_b18426d4011c38e033bd0ed54bd2d2f1, O_RDWR) failed: m
(2) in Unknown on line 0

Warning: Failed to write session data (files). Please verify that the
current setting of session.save_path is correct (/tmp) in Unknown on line 0

I run an Apache webserver under Windows and I have the latest version of
PHP. I looked up the "session.save_path" in the php.ini file and it sais:

[Session]
session.save_handler      = files   ; handler used to store/retrieve data
session.save_path         = /tmp    ; argument passed to save_handler
                                    ; in the case of files, this is the
                                    ; path where data files are stored
session.use_cookies       = 1       ; whether to use cookies
session.name              = PHPSESSID
                                    ; name of the session
                                    ; is used as cookie name
session.auto_start        = 0       ; initialize session on request startup
session.cookie_lifetime   = 1814400       ; lifetime in seconds of cookie
                                    ; or if 0, until browser is restarted
session.cookie_path       = /       ; the path the cookie is valid for
session.cookie_domain     =         ; the domain the cookie is valid for
session.serialize_handler = php     ; handler used to serialize data
                                    ; php is the standard serializer of PHP
session.gc_probability    = 1       ; percentual probability that the
                                    ; 'garbage collection' process is
started
                                    ; on every session initialization
session.gc_maxlifetime    = 1440    ; after this number of seconds, stored
                                    ; data will be seen as 'garbage' and
                                    ; cleaned up by the gc process
session.referer_check     =         ; check HTTP Referer to invalidate
                                    ; externally stored URLs containing ids
session.entropy_length    = 0       ; how many bytes to read from the file
session.entropy_file      =         ; specified here to create the session
id
; session.entropy_length    = 16
; session.entropy_file      = /dev/urandom
session.cache_limiter     = nocache ; set to {nocache,private,public} to
                                    ; determine HTTP caching aspects
session.cache_expire      = 180     ; document expires after n minutes
session.use_trans_sid     = 1       ; use transient sid support if enabled
                                    ; by compiling with --enable-trans-sid
url_rewriter.tags         =
"a=href,area=href,frame=src,input=src,form=fakeentry"

What's wrong with /tmp ? Where's that map located? Do I need to change the
entry? Should I create the dir? If so, where?






Hi,

as you can see from the error message apache looks for
a dir called /tmp. This is a unix path. You have to change this to a
windows path such as c:\temp or what you like.

Johannes

""[Inf] F!RE-WALL"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
99sd6d$m6k$[EMAIL PROTECTED]">news:99sd6d$m6k$[EMAIL PROTECTED]...
> Every time I want to initiate a session i get this:
>
> Warning: open(/tmp\sess_b18426d4011c38e033bd0ed54bd2d2f1, O_RDWR) failed:
m
> (2) in e:\webserver\phptest\page1.php on line 2
>
> Warning: open(/tmp\sess_b18426d4011c38e033bd0ed54bd2d2f1, O_RDWR) failed:
m
> (2) in Unknown on line 0
>
> Warning: Failed to write session data (files). Please verify that the
> current setting of session.save_path is correct (/tmp) in Unknown on line
0
>
> I run an Apache webserver under Windows and I have the latest version of
> PHP. I looked up the "session.save_path" in the php.ini file and it sais:
>
> [Session]
> session.save_handler      = files   ; handler used to store/retrieve data
> session.save_path         = /tmp    ; argument passed to save_handler
>                                     ; in the case of files, this is the
>                                     ; path where data files are stored
> session.use_cookies       = 1       ; whether to use cookies
> session.name              = PHPSESSID
>                                     ; name of the session
>                                     ; is used as cookie name
> session.auto_start        = 0       ; initialize session on request
startup
> session.cookie_lifetime   = 1814400       ; lifetime in seconds of cookie
>                                     ; or if 0, until browser is restarted
> session.cookie_path       = /       ; the path the cookie is valid for
> session.cookie_domain     =         ; the domain the cookie is valid for
> session.serialize_handler = php     ; handler used to serialize data
>                                     ; php is the standard serializer of
PHP
> session.gc_probability    = 1       ; percentual probability that the
>                                     ; 'garbage collection' process is
> started
>                                     ; on every session initialization
> session.gc_maxlifetime    = 1440    ; after this number of seconds, stored
>                                     ; data will be seen as 'garbage' and
>                                     ; cleaned up by the gc process
> session.referer_check     =         ; check HTTP Referer to invalidate
>                                     ; externally stored URLs containing
ids
> session.entropy_length    = 0       ; how many bytes to read from the file
> session.entropy_file      =         ; specified here to create the session
> id
> ; session.entropy_length    = 16
> ; session.entropy_file      = /dev/urandom
> session.cache_limiter     = nocache ; set to {nocache,private,public} to
>                                     ; determine HTTP caching aspects
> session.cache_expire      = 180     ; document expires after n minutes
> session.use_trans_sid     = 1       ; use transient sid support if enabled
>                                     ; by compiling with --enable-trans-sid
> url_rewriter.tags         =
> "a=href,area=href,frame=src,input=src,form=fakeentry"
>
> What's wrong with /tmp ? Where's that map located? Do I need to change the
> entry? Should I create the dir? If so, where?
>
>
>
> --
> 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]
>







----- Original Message -----
From: "[Inf] F!RE-WALL" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 28, 2001 12:10 PM
Subject: [PHP] session handling


> Every time I want to initiate a session i get this:
>
> Warning: open(/tmp\sess_b18426d4011c38e033bd0ed54bd2d2f1, O_RDWR) failed:
m
> (2) in e:\webserver\phptest\page1.php on line 2
>
> Warning: open(/tmp\sess_b18426d4011c38e033bd0ed54bd2d2f1, O_RDWR) failed:
m
> (2) in Unknown on line 0
>
> Warning: Failed to write session data (files). Please verify that the
> current setting of session.save_path is correct (/tmp) in Unknown on line
0
>
> I run an Apache webserver under Windows and I have the latest version of
> PHP. I looked up the "session.save_path" in the php.ini file and it sais:
>
> [Session]
> session.save_handler      = files   ; handler used to store/retrieve data
> session.save_path         = /tmp    ; argument passed to save_handler
>                                     ; in the case of files, this is the
>                                     ; path where data files are stored
> session.use_cookies       = 1       ; whether to use cookies
> session.name              = PHPSESSID
>                                     ; name of the session
>                                     ; is used as cookie name
> session.auto_start        = 0       ; initialize session on request
startup
> session.cookie_lifetime   = 1814400       ; lifetime in seconds of cookie
>                                     ; or if 0, until browser is restarted
> session.cookie_path       = /       ; the path the cookie is valid for
> session.cookie_domain     =         ; the domain the cookie is valid for
> session.serialize_handler = php     ; handler used to serialize data
>                                     ; php is the standard serializer of
PHP
> session.gc_probability    = 1       ; percentual probability that the
>                                     ; 'garbage collection' process is
> started
>                                     ; on every session initialization
> session.gc_maxlifetime    = 1440    ; after this number of seconds, stored
>                                     ; data will be seen as 'garbage' and
>                                     ; cleaned up by the gc process
> session.referer_check     =         ; check HTTP Referer to invalidate
>                                     ; externally stored URLs containing
ids
> session.entropy_length    = 0       ; how many bytes to read from the file
> session.entropy_file      =         ; specified here to create the session
> id
> ; session.entropy_length    = 16
> ; session.entropy_file      = /dev/urandom
> session.cache_limiter     = nocache ; set to {nocache,private,public} to
>                                     ; determine HTTP caching aspects
> session.cache_expire      = 180     ; document expires after n minutes
> session.use_trans_sid     = 1       ; use transient sid support if enabled
>                                     ; by compiling with --enable-trans-sid
> url_rewriter.tags         =
> "a=href,area=href,frame=src,input=src,form=fakeentry"
>
> What's wrong with /tmp ? Where's that map located? Do I need to change the
> entry? Should I create the dir? If so, where?
>
>
>
> --
> PHP General 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]
>





Sorry, hit the submit button too soon :-)

The session.save_path must exist on your system.
Try session.save_path = C:\winnt\temp (if you're on NT/2000) or
C:\windows\temp instead of /tmp

Pavel

----- Original Message -----
From: "Pavel Kalian" <[EMAIL PROTECTED]>
To: "[Inf] F!RE-WALL" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, March 28, 2001 12:17 PM
Subject: Re: [PHP] session handling


>
> ----- Original Message -----
> From: "[Inf] F!RE-WALL" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, March 28, 2001 12:10 PM
> Subject: [PHP] session handling
>
>
> > Every time I want to initiate a session i get this:
> >
> > Warning: open(/tmp\sess_b18426d4011c38e033bd0ed54bd2d2f1, O_RDWR)
failed:
> m
> > (2) in e:\webserver\phptest\page1.php on line 2
> >
> > Warning: open(/tmp\sess_b18426d4011c38e033bd0ed54bd2d2f1, O_RDWR)
failed:
> m
> > (2) in Unknown on line 0
> >
> > Warning: Failed to write session data (files). Please verify that the
> > current setting of session.save_path is correct (/tmp) in Unknown on
line
> 0
> >
> > I run an Apache webserver under Windows and I have the latest version of
> > PHP. I looked up the "session.save_path" in the php.ini file and it
sais:
> >
> > [Session]
> > session.save_handler      = files   ; handler used to store/retrieve
data
> > session.save_path         = /tmp    ; argument passed to save_handler
> >                                     ; in the case of files, this is the
> >                                     ; path where data files are stored
> > session.use_cookies       = 1       ; whether to use cookies
> > session.name              = PHPSESSID
> >                                     ; name of the session
> >                                     ; is used as cookie name
> > session.auto_start        = 0       ; initialize session on request
> startup
> > session.cookie_lifetime   = 1814400       ; lifetime in seconds of
cookie
> >                                     ; or if 0, until browser is
restarted
> > session.cookie_path       = /       ; the path the cookie is valid for
> > session.cookie_domain     =         ; the domain the cookie is valid for
> > session.serialize_handler = php     ; handler used to serialize data
> >                                     ; php is the standard serializer of
> PHP
> > session.gc_probability    = 1       ; percentual probability that the
> >                                     ; 'garbage collection' process is
> > started
> >                                     ; on every session initialization
> > session.gc_maxlifetime    = 1440    ; after this number of seconds,
stored
> >                                     ; data will be seen as 'garbage' and
> >                                     ; cleaned up by the gc process
> > session.referer_check     =         ; check HTTP Referer to invalidate
> >                                     ; externally stored URLs containing
> ids
> > session.entropy_length    = 0       ; how many bytes to read from the
file
> > session.entropy_file      =         ; specified here to create the
session
> > id
> > ; session.entropy_length    = 16
> > ; session.entropy_file      = /dev/urandom
> > session.cache_limiter     = nocache ; set to {nocache,private,public} to
> >                                     ; determine HTTP caching aspects
> > session.cache_expire      = 180     ; document expires after n minutes
> > session.use_trans_sid     = 1       ; use transient sid support if
enabled
> >                                     ; by compiling
with --enable-trans-sid
> > url_rewriter.tags         =
> > "a=href,area=href,frame=src,input=src,form=fakeentry"
> >
> > What's wrong with /tmp ? Where's that map located? Do I need to change
the
> > entry? Should I create the dir? If so, where?
> >
> >
> >
> > --
> > PHP General 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]
> >
>





thanx dude

""Pavel Kalian"" <[EMAIL PROTECTED]> wrote in message
02aa01c0b770$b7d7d790$8361d4c2@pavelk">news:02aa01c0b770$b7d7d790$8361d4c2@pavelk...
> Sorry, hit the submit button too soon :-)
>
> The session.save_path must exist on your system.
> Try session.save_path = C:\winnt\temp (if you're on NT/2000) or
> C:\windows\temp instead of /tmp
>
> Pavel
>
> ----- Original Message -----
> From: "Pavel Kalian" <[EMAIL PROTECTED]>
> To: "[Inf] F!RE-WALL" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Wednesday, March 28, 2001 12:17 PM
> Subject: Re: [PHP] session handling
>
>
> >
> > ----- Original Message -----
> > From: "[Inf] F!RE-WALL" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, March 28, 2001 12:10 PM
> > Subject: [PHP] session handling
> >
> >
> > > Every time I want to initiate a session i get this:
> > >
> > > Warning: open(/tmp\sess_b18426d4011c38e033bd0ed54bd2d2f1, O_RDWR)
> failed:
> > m
> > > (2) in e:\webserver\phptest\page1.php on line 2
> > >
> > > Warning: open(/tmp\sess_b18426d4011c38e033bd0ed54bd2d2f1, O_RDWR)
> failed:
> > m
> > > (2) in Unknown on line 0
> > >
> > > Warning: Failed to write session data (files). Please verify that the
> > > current setting of session.save_path is correct (/tmp) in Unknown on
> line
> > 0
> > >
> > > I run an Apache webserver under Windows and I have the latest version
of
> > > PHP. I looked up the "session.save_path" in the php.ini file and it
> sais:
> > >
> > > [Session]
> > > session.save_handler      = files   ; handler used to store/retrieve
> data
> > > session.save_path         = /tmp    ; argument passed to save_handler
> > >                                     ; in the case of files, this is
the
> > >                                     ; path where data files are stored
> > > session.use_cookies       = 1       ; whether to use cookies
> > > session.name              = PHPSESSID
> > >                                     ; name of the session
> > >                                     ; is used as cookie name
> > > session.auto_start        = 0       ; initialize session on request
> > startup
> > > session.cookie_lifetime   = 1814400       ; lifetime in seconds of
> cookie
> > >                                     ; or if 0, until browser is
> restarted
> > > session.cookie_path       = /       ; the path the cookie is valid for
> > > session.cookie_domain     =         ; the domain the cookie is valid
for
> > > session.serialize_handler = php     ; handler used to serialize data
> > >                                     ; php is the standard serializer
of
> > PHP
> > > session.gc_probability    = 1       ; percentual probability that the
> > >                                     ; 'garbage collection' process is
> > > started
> > >                                     ; on every session initialization
> > > session.gc_maxlifetime    = 1440    ; after this number of seconds,
> stored
> > >                                     ; data will be seen as 'garbage'
and
> > >                                     ; cleaned up by the gc process
> > > session.referer_check     =         ; check HTTP Referer to invalidate
> > >                                     ; externally stored URLs
containing
> > ids
> > > session.entropy_length    = 0       ; how many bytes to read from the
> file
> > > session.entropy_file      =         ; specified here to create the
> session
> > > id
> > > ; session.entropy_length    = 16
> > > ; session.entropy_file      = /dev/urandom
> > > session.cache_limiter     = nocache ; set to {nocache,private,public}
to
> > >                                     ; determine HTTP caching aspects
> > > session.cache_expire      = 180     ; document expires after n minutes
> > > session.use_trans_sid     = 1       ; use transient sid support if
> enabled
> > >                                     ; by compiling
> with --enable-trans-sid
> > > url_rewriter.tags         =
> > > "a=href,area=href,frame=src,input=src,form=fakeentry"
> > >
> > > What's wrong with /tmp ? Where's that map located? Do I need to change
> the
> > > entry? Should I create the dir? If so, where?
> > >
> > >
> > >
> > > --
> > > PHP General 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]
> > >
> >
>
>
> --
> 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 there. I wonder how i can use the date function to end up with the
following format
dd.mm.yyyy eg:17.05.2001 I am not sure how to insert this in a mysql
database as a date field
Thanks





Set the column up in MySQL as a CHAR column, not an AUTO_INCREMENT

and use this:

$conn = mysql_connect(DB_HOST_HERE,DB_USER_HERE,DB_PASS_HERE); 
mysql_select_db("DB_NAME_HERE",$conn);
$howmanyrows = mysql_query("SELECT * FROM YOUR TABLE where YOUR 
CONDITION",$conn); 
$howmanyrows = mysql_num_rows($howmanyrows);

if ($howmanyrows == '0') { $auto_inc_id = '0'; } else {
$auto_inc_id = (($howmanyrows+1));
};

I'm not sure if that will work, but its a start.

-- Ben Cairns - Head Of Technical Operations
intasept.COM
Tel: 01332 365333
Fax: 01332 346010
E-Mail: [EMAIL PROTECTED]
Web: http://www.intasept.com

"MAKING sense of
the INFORMATION
TECHNOLOGY age
@ WORK......"





This sounds dodgy unless you can be sure that there will be no more than one
person accessing the system at the same time, otherwise several users could
calculate the same $howmanyrows.

I think that AUTO_INCREMENT is a better idea altogether!

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org


-----Original Message-----
From: Ben Cairns <[EMAIL PROTECTED]>
To: Fai <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, March 28, 2001 11:50 AM
Subject: [PHP-WIN] RE: [PHP-DB] auto_increment in mysql


>Set the column up in MySQL as a CHAR column, not an AUTO_INCREMENT
>
>and use this:
>
>$conn = mysql_connect(DB_HOST_HERE,DB_USER_HERE,DB_PASS_HERE);
>mysql_select_db("DB_NAME_HERE",$conn);
>$howmanyrows = mysql_query("SELECT * FROM YOUR TABLE where YOUR
>CONDITION",$conn);
>$howmanyrows = mysql_num_rows($howmanyrows);
>
>if ($howmanyrows == '0') { $auto_inc_id = '0'; } else {
>$auto_inc_id = (($howmanyrows+1));
>};
>
>I'm not sure if that will work, but its a start.
>
>-- Ben Cairns - Head Of Technical Operations
>intasept.COM
>Tel: 01332 365333
>Fax: 01332 346010
>E-Mail: [EMAIL PROTECTED]
>Web: http://www.intasept.com
>
>"MAKING sense of
>the INFORMATION
>TECHNOLOGY age
>@ WORK......"
>
>
>--
>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]
>
>





Another question....

I've got a script that is supposed to read URLs out of a text file, open the
image at the URL, then copy it to the local computer.  The code follows:

<?php

$input = fopen("d:\\webs\\sportspotonline.com\\data\\images.txt", "r");
while (!feof($input))
{
 $buffer = trim(fgets($input, 4096));
 if ($buffer != "Navigation")
 {
  $fnArray = explode("/", $buffer);
  $fn = $fnArray[sizeof($fnArray)-1];
  $fn = "d:\\webs\\sportspotonline.com\\data\\images\\".$fn;
  $output = fopen($fn, "wb");
  $grab = fopen($buffer, "rb");
  while ($grabbed = fread($grab, 4096);)
  {
   $grabbed = stripslashes($grabbed);
   fwrite($output, $grabbed, strlen($grabbed));
  }
  fclose($output);
  fclose($grab);
 }
}
fclose($input);

?>

The images this saves are all corrupt.... openable, partially viewable, but
corrupt.  Any idea?

--TWB


---
Thomas W. Badera
WebTeam Manager
Clarkson University
< [EMAIL PROTECTED] >






Because when I didn't stripslashes I got a blank image...

--TWB

----- Original Message -----
From: "Frank M. Kromann" <[EMAIL PROTECTED]>
To: "Thomas W. Badera" <[EMAIL PROTECTED]>
Sent: Wednesday, March 28, 2001 12:13 PM
Subject: Re: [PHP-WIN] PHP and Filesystem


> Why are you striping slasches ? I would just read the file and save them
to disk.
>
> - Frank
>
> > Another question....
> >
> > I've got a script that is supposed to read URLs out of a text file, open
the
> > image at the URL, then copy it to the local computer.  The code follows:
> >
> > <?php
> >
> > $input = fopen("d:\\webs\\sportspotonline.com\\data\\images.txt", "r");
> > while (!feof($input))
> > {
> >  $buffer = trim(fgets($input, 4096));
> >  if ($buffer != "Navigation")
> >  {
> >   $fnArray = explode("/", $buffer);
> >   $fn = $fnArray[sizeof($fnArray)-1];
> >   $fn = "d:\\webs\\sportspotonline.com\\data\\images\\".$fn;
> >   $output = fopen($fn, "wb");
> >   $grab = fopen($buffer, "rb");
> >   while ($grabbed = fread($grab, 4096);)
> >   {
> >    $grabbed = stripslashes($grabbed);
> >    fwrite($output, $grabbed, strlen($grabbed));
> >   }
> >   fclose($output);
> >   fclose($grab);
> >  }
> > }
> > fclose($input);
> >
> > ?>
> >
> > The images this saves are all corrupt.... openable, partially viewable,
but
> > corrupt.  Any idea?
> >
> > --TWB
> >
> >
> > ---
> > Thomas W. Badera
> > WebTeam Manager
> > Clarkson University
> > < [EMAIL PROTECTED] >
> >
> >
> >
> > --
> > 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]
> >
> >
> >
>
>
>





Is anyone using the IIS Index server with PHP docs?

Is there a way to for the Index Server to parse the documents before
indexing?  Every PHP doc has all of the PHP info in its abstract and I want
to get rid of it.

Thanks in advance,

John

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Aut insanit homo, aut versus facit





I was wondering if anyone got the fdf to work.  I installed the fdf toolkit
on my IIS 5.0 Server on win 2K, and uncommented the dll for it in the
php.ini file but it does not seem to work. Did I set it up right?  Any
suggestions.

Ryan Conver


Reply via email to