php-general Digest 8 Dec 2002 04:31:57 -0000 Issue 1750

Topics (messages 127378 through 127413):

save file from outside url
        127378 by: Jeremiah Breindel
        127382 by: Jason Wong
        127383 by: Jeremiah Breindel

Re: redirect URL
        127379 by: John W. Holmes

Simple text editor for Windows?
        127380 by: John W. Holmes
        127381 by: Tim Ward
        127386 by: Tom Rogers
        127388 by: DL Neil
        127389 by: Tom Rogers
        127395 by: Jonathan
        127398 by: John W. Holmes

passing argument between scripts
        127384 by: Geert Arts
        127385 by: Andrew Brampton

Re: Repeating Decimals
        127387 by: Tom Rogers
        127390 by: Stephen

Re: PHP includes without access to the default directory
        127391 by: Gundamn

Spaces
        127392 by: Patrick McKinley
        127393 by: Leif K-Brooks
        127394 by: Patrick McKinley
        127397 by: John W. Holmes

Help on OOP
        127396 by: Mohd_Q
        127399 by: Khalid El-Kary
        127400 by: Khalid El-Kary
        127407 by: Matt Giddings
        127408 by: Khalid El-Kary

PHP trouble out of the box
        127401 by: Dennis Putnam

Re: Good eve
        127402 by: rolf vreijdenberger

Re: Middle Number
        127403 by: Stephen
        127409 by: Rick Widmer

Finding Mode
        127404 by: Stephen
        127410 by: Rick Widmer
        127412 by: Stephen

Re: String to an Array
        127405 by: Justin French
        127411 by: Rick Widmer

Re: Question about displaying directories and files
        127406 by: Justin French

Just Curious
        127413 by: conbud

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 am trying to save a dynamically generated image on an outside server to a
local file on my server using the code below:

 $fc = fopen($image_filename, "wb");
 $file = fopen ($image_url, "rb");

 if (!$file) {
  echo "<p>Unable to open remote file.\n";
  exit;
 }else{
  while (!feof ($file)) {
   $line = fread ($file, 1028);
   fwrite($fc,$line);
  }
 }
 fclose($fc);
        fclose($file);


$image_filename is a locally referred to file, such as "../images/file1.png"
and $image_url is an absolute address, such as
"http://www.whatever.com/imagecreate.php";.

Instead of saving when I run the script through a browser, the image
displays within the browser, and the script creates a file containing only
"427" on the server.  Any ideas why or what I can do to correct this?

Jeremiah


--- End Message ---
--- Begin Message ---
On Saturday 07 December 2002 05:12, Jeremiah Breindel wrote:
> I am trying to save a dynamically generated image on an outside server to a
> local file on my server using the code below:
>
>  $fc = fopen($image_filename, "wb");
>  $file = fopen ($image_url, "rb");
>
>  if (!$file) {
>   echo "<p>Unable to open remote file.\n";
>   exit;
>  }else{
>   while (!feof ($file)) {
>    $line = fread ($file, 1028);
>    fwrite($fc,$line);
>   }
>  }
>  fclose($fc);
>         fclose($file);
>
>
> $image_filename is a locally referred to file, such as
> "../images/file1.png" and $image_url is an absolute address, such as
> "http://www.whatever.com/imagecreate.php";.
>
> Instead of saving when I run the script through a browser, the image
> displays within the browser, and the script creates a file containing only
> "427" on the server.  Any ideas why or what I can do to correct this?

Hmm, I don't see how the above code can make the remote image *display* your 
browser. The code itself looks OK, are there some parts of the code that you 
haven't shown us? 

If the above is indeed your complete code, then what is your $image_url?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Things will be bright in P.M.  A cop will shine a light in your face.
*/

--- End Message ---
--- Begin Message ---
Thanks for responing Jason!

There is other code in there for updating some database entries and
producing a confirmation page, but I had them working perfectly before I
added the image code below.  Only when acessing the outside script and
saving to file did it start doing the odd things.  I didn't write the image
creation script, only hard coded in some values for font and bg colors in
it.  I have attached that script at the bottom of this, away from everything
else.  Maybe a header problem from that script?  Any idea what 427 is from?
Thanks for all your help!

The $image_url is like this - "$rollover_image_url =
"http://www.anysite.com//pngmake.php?msg="; . $rollover .
"&rot=0&size=12&font=fonts/ARIAL.TTF";

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Saturday 07 December 2002 05:12, Jeremiah Breindel wrote:
> > I am trying to save a dynamically generated image on an outside server
to a
> > local file on my server using the code below:
> >
> >  $fc = fopen($image_filename, "wb");
> >  $file = fopen ($image_url, "rb");
> >
> >  if (!$file) {
> >   echo "<p>Unable to open remote file.\n";
> >   exit;
> >  }else{
> >   while (!feof ($file)) {
> >    $line = fread ($file, 1028);
> >    fwrite($fc,$line);
> >   }
> >  }
> >  fclose($fc);
> >         fclose($file);
> >
> >
> > $image_filename is a locally referred to file, such as
> > "../images/file1.png" and $image_url is an absolute address, such as
> > "http://www.whatever.com/imagecreate.php";.
> >
> > Instead of saving when I run the script through a browser, the image
> > displays within the browser, and the script creates a file containing
only
> > "427" on the server.  Any ideas why or what I can do to correct this?
>
> Hmm, I don't see how the above code can make the remote image *display*
your
> browser. The code itself looks OK, are there some parts of the code that
you
> haven't shown us?
>
> If the above is indeed your complete code, then what is your $image_url?
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Things will be bright in P.M.  A cop will shine a light in your face.
> */
>

<?
/*
To draw the PNG - call this script with a URL like the following:

pngmake.php3?msg=testing+class&rot=15&size=48&font=fonts/ARIAL.TTF
*/


class textPNG {
    var $font = 'fonts/ARIAL.TTF'; //default font. put in full path.
    var $msg = "undefined"; // default text to display.
    var $size = 24;
    var $rot = 0; // rotation in degrees.
    var $pad = 0; // padding.
    var $transparent = 1; // transparency set to on.
    var $red = 0; // white text...
    var $grn = 0;
    var $blu = 0;
    var $bg_red = 255; // on black background.
    var $bg_grn = 255;
    var $bg_blu = 255;

function draw() {
    $width = 499;
    $height = 39;
    $offset_x = 0;
    $offset_y = 0;
    $bounds = array();
    $image = "";

    //$this->msg = date ("h:i:s");

    // determine font height.
    $bounds = ImageTTFBBox($this->size, $this->rot, $this->font, "W");
    if ($this->rot < 0) {
        $font_height = abs($bounds[7]-$bounds[1]);
    } else if ($this->rot > 0) {
        $font_height = abs($bounds[1]-$bounds[7]);
    } else {
        $font_height = abs($bounds[7]-$bounds[1]);
    }

    // determine bounding box.
    $bounds = ImageTTFBBox($this->size, $this->rot, $this->font,
$this->msg);
    if ($this->rot < 0) {
//        $width = abs($bounds[4]-$bounds[0]);
//        $height = abs($bounds[3]-$bounds[7]);
        $offset_y = $font_height;
        $offset_x = 0;

    } else if ($this->rot > 0) {
//        $width = abs($bounds[2]-$bounds[6]);
//        $height = abs($bounds[1]-$bounds[5]);
        $offset_y = abs($bounds[7]-$bounds[5])+$font_height;
        $offset_x = abs($bounds[0]-$bounds[6]);

    } else {
//        $width = abs($bounds[4]-$bounds[6]);
//        $height = abs($bounds[7]-$bounds[1]);
        $offset_y = $font_height;;
        $offset_x = 0;
    }

    $image = imagecreate($width+($this->pad*2)+1,$height+($this->pad*2)+1);

    $background = ImageColorAllocate($image, $this->bg_red, $this->bg_grn,
$this->bg_blu);
    $foreground = ImageColorAllocate($image, $this->red, $this->grn,
$this->blu);

    if ($this->transparent) ImageColorTransparent($image, $background);
    ImageInterlace($image, false);

    // render it.
    ImageTTFText($image, $this->size, $this->rot, $offset_x+$this->pad,
$offset_y+$this->pad, $foreground, $this->font, $this->msg);

    // output PNG object.
    imagePNG($image);
}
}

$text = new textPNG; // instantiate new textPNG class.

if (isset($msg)) $text->msg = $msg; // text to display
if (isset($font)) $text->font = $font; // font to use (include directory if
needed).
if (isset($size)) $text->size = $size; // size in points
if (isset($rot)) $text->rot = $rot; // rotation
if (isset($pad)) $text->pad = $pad; // padding in pixels around text.
if (isset($tr)) $text->transparent = $tr; // transparency flag (boolean).
if (isset($clr)) { // text colour
  $text->red = hexdec(substr($clr, 0, 2));
  $text->grn = hexdec(substr($clr, 2, 2));
  $text->blu = hexdec(substr($clr, 4, 2));
}
if (isset($bg)) { // background colour
  $text->bg_red = hexdec(substr($bg, 0, 2));
  $text->bg_grn = hexdec(substr($bg, 2, 2));
  $text->bg_blu = hexdec(substr($bg, 4, 2));
}



// make up some expiry information. say, 60 secs to ive.
$now = mktime (date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"));
$expires = mktime (date("H"),date("i"),date("s") + 60
,date("m"),date("d"),date("Y")); // add 60 secs.
$expires_gmt = gmdate('D, d M Y H:i:s', $expires).' GMT';
$last_modified_gmt  = gmdate('D, d M Y H:i:s', $now).' GMT';

header('Content-type:image/png');
header('Expires: '.$expires_gmt);
header('last-modified: '.$last_modified_gmt);

$text->draw();
?>


--- End Message ---
--- Begin Message ---
> On Saturday 07 December 2002 04:26, 1LT John W. Holmes wrote:
> > >I don't can redirect my page to new url
> > >please help me
> > >
> > >Carlos Alberto Pinto Hurtado
> >
> > I posted the answer on my web page.
> 
> Can you redirect the answer to the list so we can all see?
> 
> Only joking ;-)

Heh... I was hoping my answer would be about as useful and informative
as his question... :)

John


--- End Message ---
--- Begin Message ---
I know the text editor question has been beat to death, but I'm looking
for a simple editor with syntax highlighting that can be installed in
Windows by a general user. It would have to be something that didn't
access the registry, as normal users can't do that. Does anyone know of
a program like this? Thanks.

---John Holmes...

PS: Yes, I already know what program you use and it's the best and I use
it every day to... does it answer the question above?? ;)


--- End Message ---
--- Begin Message ---
I like arachnophilia.

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
----- Original Message ----- 
From: John W. Holmes <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 07, 2002 4:11 PM
Subject: [PHP] Simple text editor for Windows?


> I know the text editor question has been beat to death, but I'm looking
> for a simple editor with syntax highlighting that can be installed in
> Windows by a general user. It would have to be something that didn't
> access the registry, as normal users can't do that. Does anyone know of
> a program like this? Thanks.
> 
> ---John Holmes...
> 
> PS: Yes, I already know what program you use and it's the best and I use
> it every day to... does it answer the question above?? ;)
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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

Sunday, December 8, 2002, 2:27:20 AM, you wrote:
TW> I like arachnophilia.

TW> Tim Ward
TW> http://www.chessish.com
TW> mailto:[EMAIL PROTECTED]
TW> ----- Original Message ----- 
TW> From: John W. Holmes <[EMAIL PROTECTED]>
TW> To: <[EMAIL PROTECTED]>
TW> Sent: Saturday, December 07, 2002 4:11 PM
TW> Subject: [PHP] Simple text editor for Windows?


>> I know the text editor question has been beat to death, but I'm looking
>> for a simple editor with syntax highlighting that can be installed in
>> Windows by a general user. It would have to be something that didn't
>> access the registry, as normal users can't do that. Does anyone know of
>> a program like this? Thanks.
>> 
>> ---John Holmes...
>> 
>> PS: Yes, I already know what program you use and it's the best and I use
>> it every day to... does it answer the question above?? ;)
>> 
>> 
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 

Take a look at this one it seemed to be pretty good, the closest I've seen to
homesite functionality without the bloat.
http://www.crimsoneditor.com/


-- 
regards,
Tom

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

> >> I know the text editor question has been beat to death, but I'm looking
> >> for a simple editor with syntax highlighting that can be installed in
> >> Windows by a general user. It would have to be something that didn't
> >> access the registry, as normal users can't do that. Does anyone know of
> >> a program like this? Thanks.
>
> Take a look at this one it seemed to be pretty good, the closest I've seen
to
> homesite functionality without the bloat.
> http://www.crimsoneditor.com/


Looks interesting - and no registry finagling you say!
One expects that John meant PHP syntax highlighting. From where is the PHP
control file made available?

Please advise,
=dn

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

Sunday, December 8, 2002, 4:22:52 AM, you wrote:
DN> Hi Tom,

>> >> I know the text editor question has been beat to death, but I'm looking
>> >> for a simple editor with syntax highlighting that can be installed in
>> >> Windows by a general user. It would have to be something that didn't
>> >> access the registry, as normal users can't do that. Does anyone know of
>> >> a program like this? Thanks.
>>
>> Take a look at this one it seemed to be pretty good, the closest I've seen
DN> to
>> homesite functionality without the bloat.
>> http://www.crimsoneditor.com/


DN> Looks interesting - and no registry finagling you say!
DN> One expects that John meant PHP syntax highlighting. From where is the PHP
DN> control file made available?

DN> Please advise,
DN> =dn


>From the same site
http://www.crimsoneditor.com/board/data/user0/php.zip

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
Try Winsyntax (http://winsyntax.com/)

It's not as robust and colorful as others, but it's simplicity has won
me over.

It's great is you just want to code.

-----Original Message-----
From: Tom Rogers [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, December 07, 2002 12:51 PM
To: DL Neil
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re[4]: [PHP] Simple text editor for Windows?

Hi,

Sunday, December 8, 2002, 4:22:52 AM, you wrote:
DN> Hi Tom,

>> >> I know the text editor question has been beat to death, but I'm
looking
>> >> for a simple editor with syntax highlighting that can be installed
in
>> >> Windows by a general user. It would have to be something that
didn't
>> >> access the registry, as normal users can't do that. Does anyone
know of
>> >> a program like this? Thanks.
>>
>> Take a look at this one it seemed to be pretty good, the closest I've
seen
DN> to
>> homesite functionality without the bloat.
>> http://www.crimsoneditor.com/


DN> Looks interesting - and no registry finagling you say!
DN> One expects that John meant PHP syntax highlighting. From where is
the PHP
DN> control file made available?

DN> Please advise,
DN> =dn


>From the same site
http://www.crimsoneditor.com/board/data/user0/php.zip

-- 
regards,
Tom


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

--- End Message ---
--- Begin Message ---
> >> Take a look at this one it seemed to be pretty good, the closest
I've
> seen
> DN> to
> >> homesite functionality without the bloat.
> >> http://www.crimsoneditor.com/

This appears to work perfectly. Thank you. Hopefully it works at work.

> DN> Looks interesting - and no registry finagling you say!
> DN> One expects that John meant PHP syntax highlighting. From where is
the
> PHP
> DN> control file made available?

It has PHP syntax highlighting (although not the best) with the default
install.

---John Holmes...


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

I use the following, very common construct:
In script A I do a require of script B:

require("http://www.domain.nl/test/inc/scriptB.php";);

in scriptB I define a constant:

define("CONSTANT_X", "VALUE_1");

I try to use this constant in scriptA, but it seems that the value is not passed:

echo(CONSTANT_X); in srciptA

display CONSTANT_X

In scriptB the echo displays the correct value.

My hostprovider has the following setting, which in my view should make it possible to pass arguments as
shown above.

register_globals = on
safemode = on
open_basedir refers to the htdoc folder of the domain.

Kind regards,
Geert Arts


--- End Message ---
--- Begin Message ---
try:
require("test/inc/scriptB.php");

I beleive that you may be including scriptB after it has been displayed by
apache (ie with all the PHP executed)

Andrew

----- Original Message -----
From: "Geert Arts" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 07, 2002 4:53 PM
Subject: [PHP] passing argument between scripts


> Hi All,
>
> I use the following, very common construct:
> In script A I do a require of script B:
>
>     require("http://www.domain.nl/test/inc/scriptB.php";);
>
> in scriptB I define a constant:
>
>     define("CONSTANT_X", "VALUE_1");
>
> I try to use this constant in scriptA, but it seems that the value is not
> passed:
>
>     echo(CONSTANT_X); in srciptA
>
> display CONSTANT_X
>
> In scriptB the echo displays the correct value.
>
> My hostprovider has the following setting, which in my view should make it
> possible to pass arguments as
> shown above.
>
> register_globals = on
> safemode = on
> open_basedir refers to the htdoc folder of the domain.
>
> Kind regards,
> Geert Arts
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

Sunday, December 8, 2002, 1:46:07 AM, you wrote:
S> Ok, I'm getting some weird errors. Here's the website:

S> http://check.melchior.us/module.php?id=3

S> I attached the output file. What am I doing wrong!?


S> ----- Original Message -----
S> From: "Tom Rogers" <[EMAIL PROTECTED]>
S> To: "Stephen" <[EMAIL PROTECTED]>
S> Cc: "PHP List" <[EMAIL PROTECTED]>
S> Sent: Friday, December 06, 2002 11:26 PM
S> Subject: Re[2]: [PHP] Repeating Decimals


>> Hi,
>>
>> Saturday, December 7, 2002, 6:36:18 AM, you wrote:
>> S> How would I run the functions though and then print the repeating
S> decimal to
>> S> the screen?
>>
>> The function returns the string ready to print
>> You will need to comment out the echo $s line, it was there for debugging.
>>
>> just do <?php echo repeat($nuber to check)?>  where ever you need it
>>
>>
>>
>> --
>> regards,
>> Tom
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>

You chopped off this line at the very begining of the function

$s = substr(number_format($num,16),0,-1); //make a string

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
That's ok. The user needs to use some of his/her brain too. :P

Thanks again!


----- Original Message -----
From: "Tom Rogers" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>
Sent: Saturday, December 07, 2002 2:03 PM
Subject: Re[8]: [PHP] Repeating Decimals


> Hi,
>
> Sunday, December 8, 2002, 4:51:37 AM, you wrote:
> S> Thanks! I works now.
>
>
> S> ----- Original Message -----
> S> From: "Tom Rogers" <[EMAIL PROTECTED]>
> S> To: "Stephen" <[EMAIL PROTECTED]>
> S> Sent: Saturday, December 07, 2002 1:46 PM
> S> Subject: Re[6]: [PHP] Repeating Decimals
>
> Good :)
> One problem is rounding which screws things up as it can round up the last
> digit giving a false answer. 1/13 for example which gives 0.0769230769231
<<< 07
> rounded up to 1
> Not sure what to do about that...
>
> --
> regards,
> Tom
>
>

--- End Message ---
--- Begin Message ---
thank you


--- End Message ---
--- Begin Message ---
Is there a way of getting a php to display all the spaces in a file.
i have used this to display an nfo file on my site:

-------------------nfoload.php
<?
$fol = $_GET['fol']; 
$nfono = $_GET['nfono'];
require("nfo/".$fol."/ind.txt")
?>
<title><? echo $nfo ?></title>
<body background="images/backg.jpg">

<?
$file = "nfo/".$fol."/".$nfo."";
$fp = fopen($file, "r"); 
$fc = fread($fp, filesize($file));
echo nl2br($fc);
fclose($fp); 
?>
--------------------------------------------nfo/$fol/ind.txt (tells the script 
filenames for the nfo files)
<?
if $nfono == "1" {
$nfo = "nfo_file_1.nfo
}
else if $nfono == "2" {
$nfo = "nfo_file_2.nfo
}
?>
----

now since nfo files tend to include a fair bit of of ASCII art in them, i was 
wandering if there's a way to preserve the spaces in this file, so the ASCII art is 
preserved.

thanks


--- End Message ---
--- Begin Message ---
This isn't really a PHP question, but look at the <pre> html tag.

Patrick McKinley wrote:

Is there a way of getting a php to display all the spaces in a file.
i have used this to display an nfo file on my site:

-------------------nfoload.php
<?
$fol = $_GET['fol']; $nfono = $_GET['nfono'];
require("nfo/".$fol."/ind.txt")
?>
<title><? echo $nfo ?></title>
<body background="images/backg.jpg">

<?
$file = "nfo/".$fol."/".$nfo."";
$fp = fopen($file, "r"); $fc = fread($fp, filesize($file));
echo nl2br($fc);
fclose($fp); ?>
--------------------------------------------nfo/$fol/ind.txt (tells the script filenames for the nfo files)
<?
if $nfono == "1" {
$nfo = "nfo_file_1.nfo
}
else if $nfono == "2" {
$nfo = "nfo_file_2.nfo
}
?>
----

now since nfo files tend to include a fair bit of of ASCII art in them, i was wandering if there's a way to preserve the spaces in this file, so the ASCII art is preserved.

thanks




--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.



--- End Message ---
--- Begin Message ---
uhm, i feel silly now, ignore my question please
:D


----- Original Message -----
From: "Leif K-Brooks" <[EMAIL PROTECTED]>
To: "Patrick McKinley" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, December 07, 2002 8:08 PM
Subject: Re: [PHP] Spaces


> This isn't really a PHP question, but look at the <pre> html tag.
>
> Patrick McKinley wrote:
>
> >Is there a way of getting a php to display all the spaces in a file.
> >i have used this to display an nfo file on my site:
> >
> >-------------------nfoload.php
> ><?
> >$fol = $_GET['fol'];
> >$nfono = $_GET['nfono'];
> >require("nfo/".$fol."/ind.txt")
> >?>
> ><title><? echo $nfo ?></title>
> ><body background="images/backg.jpg">
> >
> ><?
> >$file = "nfo/".$fol."/".$nfo."";
> >$fp = fopen($file, "r");
> >$fc = fread($fp, filesize($file));
> >echo nl2br($fc);
> >fclose($fp);
> >?>
> >--------------------------------------------nfo/$fol/ind.txt (tells the
script filenames for the nfo files)
> ><?
> >if $nfono == "1" {
> >$nfo = "nfo_file_1.nfo
> >}
> >else if $nfono == "2" {
> >$nfo = "nfo_file_2.nfo
> >}
> >?>
> >----
> >
> >now since nfo files tend to include a fair bit of of ASCII art in them, i
was wandering if there's a way to preserve the spaces in this file, so the
ASCII art is preserved.
> >
> >thanks
> >
> >
> >
> >
> >
>
> --
> The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.
>
--- End Message ---
--- Begin Message ---
> now since nfo files tend to include a fair bit of of ASCII art in
them, i
> was wandering if there's a way to preserve the spaces in this file, so
the
> ASCII art is preserved.

This is an HTML issue. HTML will only show one space. You can convert
all spaces to &nbsp; or you can use the <pre> tags. <pre> is probably
better so everything will line up correctly.

---John Holmes...


--- End Message ---
--- Begin Message ---
I can't distinguish between objects, classes, and functions.
Here is a question - sorry if appear to be rediculous :

--  Can we have a function inside another function?

if anyone can suggest the best tutorial on OBJECTS and CLASSES, I'll be grateful.

--- End Message ---
--- Begin Message --- hi,
a function can be defined from inside another function!
this works here:

<?php

function howru()
{
function hi()
{
echo "hi,";
}
hi();echo "how r u";
}

howru();
hi();

?>

this gives the same result:

<?php
function hi()
{
echo "hi,";
}
function howru()
{
hi();echo "how r u";
}

howru();
hi();

?>

It seems that even calling the function again from any place works!

Regards,
Khalid al-kary

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

--- End Message ---
--- Begin Message --- hi again,

about functions wholly, here is the php manual functions section
http://www.php.net/manual/en/functions.php

about classes and objects:
http://www.php.net/manual/en/language.oop.php

Note: an object is an instance of a class!

Regards,
Khalid Al-kary





_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus

--- End Message ---
--- Begin Message ---

> -----Original Message-----
> From: Khalid El-Kary [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, December 07, 2002 6:03 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Help on OOP
> 
> hi,
> a function can be defined from inside another function!
> this works here:
> 
> <?php
> 
> function howru()
> {
> function hi()
> {
> echo "hi,";
> }
> hi();echo "how r u";
> }
> 
> howru();
> hi();
> 
> ?>
> 
> this gives the same result:
> 
> <?php
> function hi()
> {
> echo "hi,";
> }
> function howru()
> {
> hi();echo "how r u";
> }
> 
> howru();
> hi();
> 
> ?>
> 
> It seems that even calling the function again from any place works!


So what your saying is that the hi() function's scope in the top example
is not limited to the howru() function.



> 
> Regards,
> Khalid al-kary
> 
> _________________________________________________________________
> Protect your PC - get McAfee.com VirusScan Online
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.426 / Virus Database: 239 - Release Date: 12/2/2002
>

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.426 / Virus Database: 239 - Release Date: 12/2/2002
 

--- End Message ---
--- Begin Message --- hi,
right, this is exactly what i mean

Khalid

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail

--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I just installed PHP 4.3.ORC2 on Windows ME and manually added the sapi to 
Apache 1.3.27. Apache was installed first and verified. PHP was installed 
using the Windows installer. The sapi was installed using the directions 
that came with PHP. Apparently Apache now recognizes PHP request but gets a 
fatal error on a php page:

"Apache has caused an error in
PHP4APACHE.DLL
Apache will now close."

I couldn't find anything on the FAQ or digest that was similar. Can someone 
point me in the right direction? Thanks.

For what its worth here is my httpd.conf:

#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://www.apache.org/docs/> for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.
#
# After this file is processed, the server will look for and process
# C:/Program Files/HTTPD/Apache/conf/srm.conf and then C:/Program 
Files/HTTPD/Apache/conf/access.conf
# unless you have overridden these with ResourceConfig and/or
# AccessConfig directives here.
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as a
#     whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default' server,
#     which responds to requests that aren't handled by a virtual host.
#     These directives also provide default values for the settings
#     of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
#     different IP addresses or hostnames and have them handled by the
#     same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "/usr/local/apache" will be interpreted by the
# server as "/usr/local/apache/logs/foo.log".
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which Apache.exe is located
# will be used by default.  It is recommended that you always supply
# an explicit drive letter in absolute paths, however, to avoid
# confusion.
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerType is either inetd, or standalone.  Inetd mode is only supported on
# Unix platforms.
#
ServerType standalone

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
ServerRoot "C:/Program Files/HTTPD/Apache"

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
PidFile logs/httpd.pid

#
# ScoreBoardFile: File used to store internal server process information.
# Not all architectures require this.  But if yours does (you'll know because
# this file will be  created when you run Apache) then you *must* ensure that
# no two invocations of Apache share the same scoreboard file.
#
ScoreBoardFile logs/apache_runtime_status

#
# In the standard configuration, the server will process httpd.conf (this
# file, specified by the -f command line option), srm.conf, and access.conf
# in that order.  The latter two files are now distributed empty, as it is
# recommended that all directives be kept in a single file for simplicity.
# The commented-out values below are the built-in defaults.  You can have the
# server ignore these files altogether by using "/dev/null" (for Unix) or
# "nul" (for Win32) for the arguments to the directives.
#
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

#
# Apache on Win32 always creates one child process to handle requests.  If it
# dies, another child process is created automatically.  Within the child
# process multiple threads handle incoming requests.  The next two
# directives control the behaviour of the threads and processes.
#

#
# MaxRequestsPerChild: the number of requests each child process is
# allowed to process before the child dies.  The child will exit so
# as to avoid problems after prolonged use when Apache (and maybe the
# libraries it uses) leak memory or other resources.  On most systems, this
# isn't really needed, but a few (such as Solaris) do have notable leaks
# in the libraries.  For Win32, set this value to zero (unlimited)
# unless advised otherwise.
#
# NOTE: This value does not include keepalive requests after the initial
#       request per connection. For example, if a child process handles
#       an initial request and 10 subsequent "keptalive" requests, it
#       would only count as 1 request towards this limit.
#
MaxRequestsPerChild 0

#
# Number of concurrent threads (i.e., requests) the server will allow.
# Set this value according to the responsiveness of the server (more
# requests active at once means they're all handled more slowly) and
# the amount of system resources you'll allow the server to consume.
#
ThreadsPerChild 50

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
#Listen 3000
#Listen 12.34.56.78:80

#
# BindAddress: You can support virtual hosts with this option. This directive
# is used to tell the server which IP address to listen to. It can either
# contain "*", an IP address, or a fully qualified Internet domain name.
# See also the <VirtualHost> and Listen directives.
#
#BindAddress *

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Please read the file README.DSO in the Apache 1.3 distribution for more
# details about the DSO mechanism and run `apache -l' for the list of already
# built-in (statically linked and thus always available) modules in your Apache
# binary.
#
# Note: The order in which modules are loaded is important.  Don't change
# the order below without expert advice.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule status_module modules/mod_status.so
#LoadModule info_module modules/mod_info.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule anon_auth_module modules/mod_auth_anon.so
#LoadModule dbm_auth_module modules/mod_auth_dbm.so
#LoadModule digest_auth_module modules/mod_auth_digest.so
#LoadModule digest_module modules/mod_digest.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule php4_module c:/progra~1/HTTPD/PHP/sapi/php4apache.dll

#
#  Reconstruction of the complete module list from all available modules
#  (static and shared ones) to achieve correct module execution order.
#
# The modules listed below, without a corresponding LoadModule directive,
# are static bound into the standard Apache binary distribution for Windows.
#
# Note: The order in which modules are loaded is important.  Don't change
# the order below without expert advice.
#
# [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE, UPDATE THIS TOO!]
ClearModuleList
#AddModule mod_vhost_alias.c
AddModule mod_env.c
AddModule mod_log_config.c
#AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c
#AddModule mod_status.c
#AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_isapi.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
#AddModule mod_speling.c
AddModule mod_userdir.c
AddModule mod_alias.c
#AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
#AddModule mod_auth_anon.c
#AddModule mod_auth_dbm.c
#AddModule mod_auth_digest.c
#AddModule mod_digest.c
#AddModule mod_proxy.c
#AddModule mod_cern_meta.c
#AddModule mod_expires.c
#AddModule mod_headers.c
#AddModule mod_usertrack.c
#AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c
AddModule mod_php4.c


#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
#ExtendedStatus On

### Section 2: 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

#
# Port: The port to which the standalone server listens.  Certain firewall
# products must be configured before Apache can listen to a specific port.
# Other running httpd servers will also interfere with this port.  Disable
# all firewall, security, and other services if you encounter problems.
# To help diagnose problems use the Windows NT command NETSTAT -a
#
Port 80

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.
#
ServerAdmin [EMAIL PROTECTED]

#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and this will make redirections work in a sensible way.
#
# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
# machine always knows itself by this address. If you use Apache strictly for
# local testing and development, you may use 127.0.0.1 as the server name.
#
ServerName localhost


#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:/Program Files/HTTPD/Apache/htdocs"

#
# Each directory to which Apache has access, can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# permissions.
#
<Directory />
     Options FollowSymLinks
     AllowOverride None
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/Program Files/HTTPD/Apache/htdocs">

#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
     Options Indexes FollowSymLinks MultiViews

#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
     AllowOverride None

#
# Controls who can get stuff from this server.
#
     Order allow,deny
     Allow from all
</Directory>

#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
# Under Win32, we do not currently try to determine the home directory of
# a Windows login, so a format such as that below needs to be used.  See
# the UserDir documentation for details.
#
<IfModule mod_userdir.c>
     UserDir "C:/Program Files/HTTPD/Apache/users/"
</IfModule>

#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
#<Directory "C:/Program Files/HTTPD/Apache/users">
#    AllowOverride FileInfo AuthConfig Limit
#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
#    <Limit GET POST OPTIONS PROPFIND>
#        Order allow,deny
#        Allow from all
#    </Limit>
#    <LimitExcept GET POST OPTIONS PROPFIND>
#        Order deny,allow
#        Deny from all
#    </LimitExcept>
#</Directory>

#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
     DirectoryIndex index.html
</IfModule>

#
# AccessFileName: The name of the file to look for in each directory
# for access control information.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess files from being viewed by
# Web clients.  Since .htaccess files often contain authorization
# information, access is disallowed for security reasons.  Comment
# these lines out if you want Web visitors to see the contents of
# .htaccess files.  If you change the AccessFileName directive above,
# be sure to make the corresponding changes here.
#
# Also, folks tend to use names such as .htpasswd for password
# files, so this will protect those as well.
#
<Files ~ "^\.ht">
     Order allow,deny
     Deny from all
     Satisfy All
</Files>

#
# CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each
# document that was negotiated on the basis of content. This asks proxy
# servers not to cache the document. Uncommenting the following line disables
# this behavior, and proxies will be allowed to cache the documents.
#
#CacheNegotiatedDocs

#
# UseCanonicalName:  (new for 1.3)  With this setting turned on, whenever
# Apache needs to construct a self-referencing URL (a URL that refers back
# to the server the response is coming from) it will use ServerName and
# Port to form a "canonical" name.  With this setting off, Apache will
# use the hostname:port that the client supplied, when possible.  This
# also affects SERVER_NAME and SERVER_PORT in CGI scripts.
#
UseCanonicalName On

#
# TypesConfig describes where the mime.types file (or equivalent) is
# to be found.
#
<IfModule mod_mime.c>
     TypesConfig conf/mime.types
</IfModule>

#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain

#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type.  The MIMEMagicFile
# directive tells the module where the hint definitions are located.
# mod_mime_magic is not part of the default server (you have to add
# it yourself with a LoadModule [see the DSO paragraph in the 'Global
# Environment' section], or recompile the server and include mod_mime_magic
# as part of the configuration), so it's enclosed in an <IfModule> container.
# This means that the MIMEMagicFile directive will only be processed if the
# module is part of the server.
#
<IfModule mod_mime_magic.c>
     MIMEMagicFile conf/magic
</IfModule>

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error.log

#
# LogLevel: Control the number of messages logged to the error.log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" 
combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here.  Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog logs/access.log common

#
# If you would like to have agent and referer logfiles, uncomment the
# following directives.
#
#CustomLog logs/referer.log referer
#CustomLog logs/agent.log agent

#
# If you prefer a single logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog logs/access.log combined

#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (error documents, FTP directory listings,
# mod_status and mod_info output etc., but not CGI generated documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of:  On | Off | EMail
#
ServerSignature On

#
# Apache parses all CGI scripts for the shebang line by default.
# This comment line, the first line of the script, consists of the symbols
# pound (#) and exclamation (!) followed by the path of the program that
# can execute this specific script.  For a perl script, with perl.exe in
# the C:\Program Files\Perl directory, the shebang line should be:

    #!c:/program files/perl/perl

# Note you _must_not_ indent the actual shebang line, and it must be the
# first line of the file.  Of course, CGI processing must be enabled by
# the appropriate ScriptAlias or Options ExecCGI directives for the files
# or directory in question.
#
# However, Apache on Windows allows either the Unix behavior above, or can
# use the Registry to match files by extention.  The command to execute
# a file of this type is retrieved from the registry by the same method as
# the Windows Explorer would use to handle double-clicking on a file.
# These script actions can be configured from the Windows Explorer View menu,
# 'Folder Options', and reviewing the 'File Types' tab.  Clicking the Edit
# button allows you to modify the Actions, of which Apache 1.3 attempts to
# perform the 'Open' Action, and failing that it will try the shebang line.
# This behavior is subject to change in Apache release 2.0.
#
# Each mechanism has it's own specific security weaknesses, from the means
# to run a program you didn't intend the website owner to invoke, and the
# best method is a matter of great debate.
#
# To enable the this Windows specific behavior (and therefore -disable- the
# equivilant Unix behavior), uncomment the following directive:
#
#ScriptInterpreterSource registry
#
# The directive above can be placed in individual <Directory> blocks or the
# .htaccess file, with either the 'registry' (Windows behavior) or 'script'
# (Unix behavior) option, and will override this server default option.
#

#
# Aliases: Add here as many aliases as you need (with no limit). The format is
# Alias fakename realname
#
<IfModule mod_alias.c>

     #
     # Note that if you include a trailing / on fakename then the server will
     # require it to be present in the URL.  So "/icons" isn't aliased in this
     # example, only "/icons/".  If the fakename is slash-terminated, then the
     # realname must also be slash terminated, and if the fakename omits the
     # trailing slash, the realname must also omit it.
     #
     Alias /icons/ "C:/Program Files/HTTPD/Apache/icons/"

     <Directory "C:/Program Files/HTTPD/Apache/icons">
         Options Indexes MultiViews
         AllowOverride None
         Order allow,deny
         Allow from all
     </Directory>

     # This Alias will project the on-line documentation tree under /manual/
     # even if you change the DocumentRoot. Comment it if you don't want to
     # provide access to the on-line documentation.
     #
     Alias /manual/ "C:/Program Files/HTTPD/Apache/htdocs/manual/"

     <Directory "C:/Program Files/HTTPD/Apache/htdocs/manual">
         Options Indexes FollowSymlinks MultiViews
         AllowOverride None
         Order allow,deny
         Allow from all
     </Directory>

     #
     # ScriptAlias: This controls which directories contain server scripts.
     # ScriptAliases are essentially the same as Aliases, except that
     # documents in the realname directory are treated as applications and
     # run by the server when requested rather than as documents sent to 
the client.
     # The same rules about trailing "/" apply to ScriptAlias directives as to
     # Alias.
     #
     ScriptAlias /cgi-bin/ "C:/Program Files/HTTPD/Apache/cgi-bin/"

     #
     # "C:/Program Files/HTTPD/Apache/cgi-bin" should be changed to 
whatever your ScriptAliased
     # CGI directory exists, if you have that configured.
     #
     <Directory "C:/Program Files/HTTPD/Apache/cgi-bin">
         AllowOverride None
         Options None
         Order allow,deny
         Allow from all
     </Directory>

</IfModule>
# End of aliases.

#
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Format: Redirect old-URI new-URL
#

#
# Directives controlling the display of server-generated directory listings.
#
<IfModule mod_autoindex.c>

     #
     # FancyIndexing is whether you want fancy directory indexing or standard
     #
     # Note, add the option TrackModified to the IndexOptions default list only
     # if all indexed directories reside on NTFS volumes.  The 
TrackModified flag
     # will report the Last-Modified date to assist caches and proxies to 
properly
     # track directory changes, but it does _not_ work on FAT volumes.
     #
     IndexOptions FancyIndexing

     #
     # AddIcon* directives tell the server which icon to show for different
     # files or filename extensions.  These are only displayed for
     # FancyIndexed directories.
     #
     AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

     AddIconByType (TXT,/icons/text.gif) text/*
     AddIconByType (IMG,/icons/image2.gif) image/*
     AddIconByType (SND,/icons/sound2.gif) audio/*
     AddIconByType (VID,/icons/movie.gif) video/*

     AddIcon /icons/binary.gif .bin .exe
     AddIcon /icons/binhex.gif .hqx
     AddIcon /icons/tar.gif .tar
     AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
     AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
     AddIcon /icons/a.gif .ps .ai .eps
     AddIcon /icons/layout.gif .html .shtml .htm .pdf
     AddIcon /icons/text.gif .txt
     AddIcon /icons/c.gif .c
     AddIcon /icons/p.gif .pl .py
     AddIcon /icons/f.gif .for
     AddIcon /icons/dvi.gif .dvi
     AddIcon /icons/uuencoded.gif .uu
     AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
     AddIcon /icons/tex.gif .tex
     AddIcon /icons/bomb.gif core

     AddIcon /icons/back.gif ..
     AddIcon /icons/hand.right.gif README
     AddIcon /icons/folder.gif ^^DIRECTORY^^
     AddIcon /icons/blank.gif ^^BLANKICON^^

     #
     # DefaultIcon is which icon to show for files which do not have an icon
     # explicitly set.
     #
     DefaultIcon /icons/unknown.gif

     #
     # AddDescription allows you to place a short description after a file in
     # server-generated indexes.  These are only displayed for FancyIndexed
     # directories.
     # Format: AddDescription "description" filename
     #
     #AddDescription "GZIP compressed document" .gz
     #AddDescription "tar archive" .tar
     #AddDescription "GZIP compressed tar archive" .tgz

     #
     # ReadmeName is the name of the README file the server will look for by
     # default, and append to directory listings.
     #
     # HeaderName is the name of a file which should be prepended to
     # directory indexes.
     #
     # If MultiViews are amongst the Options in effect, the server will
     # first look for name.html and include it if found.  If name.html
     # doesn't exist, the server will then look for name.txt and include
     # it as plaintext if found.
     #
     ReadmeName README
     HeaderName HEADER

     #
     # IndexIgnore is a set of filenames which directory indexing should ignore
     # and not include in the listing.  Shell-style wildcarding is permitted.
     #
     IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

</IfModule>
# End of indexing directives.

#
# Document types.
#
<IfModule mod_mime.c>

     #
     # AddEncoding allows you to have certain browsers (Mosaic/X 2.1+) 
uncompress
     # information on the fly. Note: Not all browsers support this.
     # Despite the name similarity, the following Add* directives have nothing
     # to do with the FancyIndexing customization directives above.
     #
     AddEncoding x-compress Z
     AddEncoding x-gzip gz tgz
     #
     # AddLanguage allows you to specify the language of a document. You can
     # then use content negotiation to give a browser a file in a language
     # it can understand.
     #
     # Note 1: The suffix does not have to be the same as the language
     # keyword --- those with documents in Polish (whose net-standard
     # language code is pl) may wish to use "AddLanguage pl .po" to
     # avoid the ambiguity with the common suffix for perl scripts.
     #
     # Note 2: The example entries below illustrate that in quite
     # some cases the two character 'Language' abbreviation is not
     # identical to the two character 'Country' code for its country,
     # E.g. 'Danmark/dk' versus 'Danish/da'.
     #
     # Note 3: In the case of 'ltz' we violate the RFC by using a three char
     # specifier. But there is 'work in progress' to fix this and get
     # the reference data for rfc1766 cleaned up.
     #
     # Danish (da) - Dutch (nl) - English (en) - Estonian (ee)
     # French (fr) - German (de) - Greek-Modern (el)
     # Italian (it) - Korean (kr) - Norwegian (no) - Norwegian Nynorsk (nn)
     # Portugese (pt) - Luxembourgeois* (ltz)
     # Spanish (es) - Swedish (sv) - Catalan (ca) - Czech(cz)
     # Polish (pl) - Brazilian Portuguese (pt-br) - Japanese (ja)
     # Russian (ru)
     #
     AddLanguage da .dk
     AddLanguage nl .nl
     AddLanguage en .en
     AddLanguage et .ee
     AddLanguage fr .fr
     AddLanguage de .de
     AddLanguage el .el
     AddLanguage he .he
     AddCharset ISO-8859-8 .iso8859-8
     AddLanguage it .it
     AddLanguage ja .ja
     AddCharset ISO-2022-JP .jis
     AddLanguage kr .kr
     AddCharset ISO-2022-KR .iso-kr
     AddLanguage nn .nn
     AddLanguage no .no
     AddLanguage pl .po
     AddCharset ISO-8859-2 .iso-pl
     AddLanguage pt .pt
     AddLanguage pt-br .pt-br
     AddLanguage ltz .lu
     AddLanguage ca .ca
     AddLanguage es .es
     AddLanguage sv .sv
     AddLanguage cz .cz
     AddLanguage ru .ru
     AddLanguage tw .tw
     AddLanguage zh-tw .tw
     AddCharset Big5         .Big5    .big5
     AddCharset WINDOWS-1251 .cp-1251
     AddCharset CP866        .cp866
     AddCharset ISO-8859-5   .iso-ru
     AddCharset KOI8-R       .koi8-r
     AddCharset UCS-2        .ucs2
     AddCharset UCS-4        .ucs4
     AddCharset UTF-8        .utf8

     # LanguagePriority allows you to give precedence to some languages
     # in case of a tie during content negotiation.
     #
     # Just list the languages in decreasing order of preference. We have
     # more or less alphabetized them here. You probably want to change this.
     #
     <IfModule mod_negotiation.c>
         LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru 
ltz ca es sv tw
     </IfModule>

     #
     # AddType allows you to tweak mime.types without actually editing it, 
or to
     # make certain files to be certain types.
     #
     AddType application/x-tar .tgz
     AddType image/x-icon .ico
     AddType application/x-httpd-php .php
     AddType application/x-httpd-php-source .phps

     #
     # AddHandler allows you to map certain file extensions to "handlers",
     # actions unrelated to filetype. These can be either built into the server
     # or added with the Action command (see below)
     #
     # If you want to use server side includes, or CGI outside
     # ScriptAliased directories, uncomment the following lines.
     #
     # To use CGI scripts:
     #
     #AddHandler cgi-script .cgi

     #
     # To use server-parsed HTML files
     #
     #AddType text/html .shtml
     #AddHandler server-parsed .shtml

     #
     # Uncomment the following line to enable Apache's send-asis HTTP file
     # feature
     #
     #AddHandler send-as-is asis

     #
     # If you wish to use server-parsed imagemap files, use
     #
     #AddHandler imap-file map

     #
     # To enable type maps, you might want to use
     #
     #AddHandler type-map var

</IfModule>
# End of document types.

#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#

#
# MetaDir: specifies the name of the directory in which Apache can find
# meta information files. These files contain additional HTTP headers
# to include when sending the document
#
#MetaDir .web

#
# MetaSuffix: specifies the file name suffix for the file containing the
# meta information.
#
#MetaSuffix .meta

#
# Customizable error response (Apache style)
#  these come in three flavors
#
#    1) plain text
#ErrorDocument 500 "The server made a boo boo.
#  n.b.  the single leading (") marks it as text, it does not get output
#
#    2) local redirects
#ErrorDocument 404 /missing.html
#  to redirect to local URL /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
#  N.B.: You can redirect to a script or a document using server-side-includes.
#
#    3) external redirects
#ErrorDocument 402 http://some.other-server.com/subscription_info.html
#  N.B.: Many of the environment variables associated with the original
#  request will *not* be available to such a script.

#
# Customize behaviour based on the browser
#
<IfModule mod_setenvif.c>

     #
     # The following directives modify normal HTTP response behavior.
     # The first directive disables keepalive for Netscape 2.x and browsers 
that
     # spoof it. There are known problems with these browser implementations.
     # The second directive is for Microsoft Internet Explorer 4.0b2
     # which has a broken HTTP/1.1 implementation and does not properly
     # support keepalive when it is used on 301 or 302 (redirect) responses.
     #
     BrowserMatch "Mozilla/2" nokeepalive
     BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0

     #
     # The following directive disables HTTP/1.1 responses to browsers which
     # are in violation of the HTTP/1.0 spec by not being able to grok a
     # basic 1.1 response.
     #
     BrowserMatch "RealPlayer 4\.0" force-response-1.0
     BrowserMatch "Java/1\.0" force-response-1.0
     BrowserMatch "JDK/1\.0" force-response-1.0

</IfModule>
# End of browser customization directives

#
# Allow server status reports, with the URL of http://servername/server-status
# Change the "mindspring.com" to match your domain to enable.
#
#<Location /server-status>
#    SetHandler server-status
#    Order deny,allow
#    Deny from all
#    Allow from mindspring.com
#</Location>

#
# Allow remote server configuration reports, with the URL of
# http://servername/server-info (requires that mod_info.c be loaded).
# Change the "mindspring.com" to match your domain to enable.
#
#<Location /server-info>
#    SetHandler server-info
#    Order deny,allow
#    Deny from all
#    Allow from mindspring.com
#</Location>

#
# There have been reports of people trying to abuse an old bug from pre-1.1
# days.  This bug involved a CGI script distributed as a part of Apache.
# By uncommenting these lines you can redirect these attacks to a logging
# script on phf.apache.org.  Or, you can record them yourself, using the script
# support/phf_abuse_log.cgi.
#
#<Location /cgi-bin/phf*>
#    Deny from all
#    ErrorDocument 403 http://phf.apache.org/phf_abuse_log.cgi
#</Location>

#
# Proxy Server directives. Uncomment the following lines to
# enable the proxy server:
#
#<IfModule mod_proxy.c>
#    ProxyRequests On

#    <Directory proxy:*>
#        Order deny,allow
#        Deny from all
#        Allow from mindspring.com
#    </Directory>

     #
     # Enable/disable the handling of HTTP/1.1 "Via:" headers.
     # ("Full" adds the server version; "Block" removes all outgoing Via: 
headers)
     # Set to one of: Off | On | Full | Block
     #
#    ProxyVia On

     #
     # To enable the cache as well, edit and uncomment the following lines:
     # (no cacheing without CacheRoot)
     #
#    CacheRoot "C:/Program Files/HTTPD/Apache/proxy"
#    CacheSize 5
#    CacheGcInterval 4
#    CacheMaxExpire 24
#    CacheLastModifiedFactor 0.1
#    CacheDefaultExpire 1
#    NoCache a-domain.com another-domain.edu joes.garage-sale.com

#</IfModule>
# End of proxy directives.

### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at <URL:http://www.apache.org/docs/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
#NameVirtualHost *

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *>
#    ServerAdmin [EMAIL PROTECTED]
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>




- 
--------------------------------------------------------------------------------------------------
Dennis Putnam           Public Key can be obtained from:
Loganville, Ga.         <http://www.geocities.com/Heartland/Estates/8573>
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>

iQA/AwUBPfKIwMwfv3uipHMVEQLcVQCg0bnmnHavFZaaAeJZpFLWi3CFPxcAoMZe
lN2EZSyn1CJcu+S0GZaZodKw
=3o4Q
-----END PGP SIGNATURE-----


--- End Message ---
--- Begin Message ---

sorry, I read your post wrong!

don't use php functions, but use native database functions.
in mysql you can use date_format()

 SELECT field from table where  date=DATE_FORMAT(now(), '%d/%m/%y);

this makes the format of now(), which is 2002-12-07 into a format with first
the days of the week in numeric form (%d) followed by a / (/) followed by
the months of the year in numeric form(%m) etc


--- End Message ---
--- Begin Message ---
Wouldn't this only work for an even ammount of numbers? Like 1, 2, 3, 4 has
4 numbers...


----- Original Message -----
From: "Rick Widmer" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: "Stephen" <[EMAIL PROTECTED]>; "PHP List"
<[EMAIL PROTECTED]>
Sent: Friday, December 06, 2002 10:59 PM
Subject: Re: [PHP] Middle Number


> At 09:45 PM 12/6/02 -0500, Stephen wrote:
> >How can you find the meadian (or middle number) of a list of numbers? If
> >there is an even amount of numbers, how would I still find it?
>
>
> load the list into an array, in numeric order...
>
> then:
>
> $List = array( 1,2,3,4,5,6 );
>
> $Middle = ( count( $List ) - 1 ) / 2;
>
> $median = ( $List[ floor( $Middle ) ] + $List[ ceil( $Middle ) ] ) / 2;
>

--- End Message ---
--- Begin Message ---
At 07:05 PM 12/7/02 -0500, Stephen wrote:
Wouldn't this only work for an even ammount of numbers? Like 1, 2, 3, 4 has
4 numbers...
Did you try it? I'd hate to think I've done more work to solve your problem than you have...



Even:

$List = array( 1,2,3,4,5,6 );
$Middle = ( count( $List ) - 1 ) / 2;
2.5 = ( 6 - 1 ) / 2

$median = ( $List[ floor( $Middle ) ] + $List[ ceil( $Middle ) ] ) / 2;

( $List[ 2 ] + $List[ 3 ] ) / 2

3.5 = 3 + 4 /2




Odd:

$List = array( 1,2,3,4,5 );
$Middle = ( count( $List ) - 1 ) / 2;
2 = ( 5 - 1 ) / 2

$median = ( $List[ floor( $Middle ) ] + $List[ ceil( $Middle ) ] ) / 2;

( $List[ 2 ] + $List[ 2 ] ) / 2

3 = ( 3 + 3 ) / 2


It looks like it works to me. For details see:

http://mathforum.org/library/drmath/view/57598.html


>
>
>
>



> At 09:45 PM 12/6/02 -0500, Stephen wrote:
> >How can you find the meadian (or middle number) of a list of numbers? If
> >there is an even amount of numbers, how would I still find it?
>
>
> load the list into an array, in numeric order...
>
> then:
>
> $List = array( 1,2,3,4,5,6 );
>
> $Middle = ( count( $List ) - 1 ) / 2;
>
> $median = ( $List[ floor( $Middle ) ] + $List[ ceil( $Middle ) ] ) / 2;
>


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

--- End Message ---
--- Begin Message ---
Another math question... How would I find the mode (number that repeats most
often) of an array? Then, if there isn't a number that repeats most often,
tell the user that.

Thanks,
Stephen Craton
http://www.melchior.us

"What is a dreamer that cannot persevere?" -- http://www.melchior.us
--- End Message ---
--- Begin Message ---
At 07:12 PM 12/7/02 -0500, Stephen wrote:
Another math question... How would I find the mode (number that repeats most
often) of an array? Then, if there isn't a number that repeats most often,
tell the user that.

For each entry in the array, count the number of times a value occurs:


while( list( , $Value ) = each( $MyArray )) {
$NumberHits[ $Value ] ++;
}

sort $NumberHits keeping the key/value pairs together. You can find a sort function that will do it here:

http://www.php.net/manual/en/ref.array.php


The first or last entry in the sorted array is the mode. If all the entries have the same number of hits there is no mode. I'm not sure what the mode of (1, 1, 2, 5, 9, 19, 19) would be, but I'm suspect a good definition of mode will tell what to do if more than one value ties for having the most hits.

Rick

--- End Message ---
--- Begin Message ---
Thanks, but I'm having some trouble. I try to print the mode but there is no
value. Here's the code:

while( list( , $Value ) = each($_POST['nums'])) {
     $NumberHits[$Value]++;
    }
 array_multisort($NumberHists, SORT_DESC);
 $mode = $NumberHits[0];
echo $mode;


----- Original Message -----
From: "Rick Widmer" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>; "PHP List"
<[EMAIL PROTECTED]>
Sent: Saturday, December 07, 2002 9:14 PM
Subject: Re: [PHP] Finding Mode


> At 07:12 PM 12/7/02 -0500, Stephen wrote:
> >Another math question... How would I find the mode (number that repeats
most
> >often) of an array? Then, if there isn't a number that repeats most
often,
> >tell the user that.
>
>
> For each entry in the array, count the number of times a value occurs:
>
>
> while( list( , $Value ) = each( $MyArray )) {
>     $NumberHits[ $Value ] ++;
>     }
>
> sort $NumberHits keeping the key/value pairs together.  You can find a
sort
> function that will do it here:
>
>     http://www.php.net/manual/en/ref.array.php
>
>
> The first or last entry in the sorted array is the mode.  If all the
> entries have the same number of hits there is no mode.  I'm not sure what
> the mode of  (1, 1, 2, 5, 9, 19, 19) would be, but I'm suspect a good
> definition of mode will tell what to do if more than one value ties for
> having the most hits.
>
> Rick
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
I *think* either:

<?
$str = "im the one trying to do this";
echo $str[0];
?>

OR

<?
$str = "im the one trying to do this";
echo $str{0};
?>

Works -- you'll have to experiment, but I believe the second way is correct,
and will echo the first (0th) character in the string.


If you want to get more than 1 character from a string (example, characters
2-5), then use substr() -- check out the manual.


So far, I don't think you've shown a need for the string to be converted to
to an array...


Justin



on 06/12/02 5:50 AM, Rodrigo de Oliveira Costa ([EMAIL PROTECTED])
wrote:

> Hi guys, I got a string that I need to be transformed into na array of
> characters, something like:
> 
> 
> $str      ="im the one trying to do this";
> 
> //this is the string
> 
> I'd like to get an array that I can access something like $array[0] and
> get the value " i ". And this foward. Anyone have any clues on this?
> 
> Thanks,
> Rodrigo
> 
> 

Justin French
--------------------
http://Indent.com.au
Web Development & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message ---
At 11:15 AM 12/8/02 +1100, Justin French wrote:
I *think* either:

<?
$str = "im the one trying to do this";
echo $str[0];
?>

OR

<?
$str = "im the one trying to do this";
echo $str{0};
?>

Works -- you'll have to experiment, but I believe the second way is correct,
and will echo the first (0th) character in the string.
This depends on PHP version. In the bad old days you had to use $str[0]. Sometime since PHP4 came out they added the preferred $str{0} option, which is the only one that should be used in new code. Extracting characters from a string with [] is depreciated, and may stop working someday.

Rick

--- End Message ---
--- Begin Message ---
Is your question about dynamically listing the contents of all directories
and/or files below the /members/ dir, or is your question about unzipping
zipped files?

I *think* it's the former, in which case, you should play around with some
of the code examples on zend.com (http://www.zend.com/codex.php?CID=283).

Cheers,

Justin


on 07/12/02 4:58 AM, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:

> Hi. I have studied the manual, and have scripts that indivudually display a
> directory (or list of them) and a script that displays scripts in a folder
> However, I am curious as to how to take all folders in /members directory (It
> will grow over time, now I have 3) and no matter how many folders are there
> (each with a zip and gzip file)I want it to display all folders and files
> inside it on one page Such as, a dynamic way to do this:Directory Azip | gzip
> Directory Bzip | gzip ... So if there are 10 directories, you see 10 listings
> like that. If 4, 4 listings and so on. I go to the manual, but can't figure
> out how to do this *dynamically* what would I physically have to do to make
> sure a list of directories in my 'list director' script includes the spitout
> of files and then link to them?
> 
> _______________________________________________
> Join Excite! - http://www.excite.com
> The most personalized portal on the Web!
> 

Justin French
--------------------
http://Indent.com.au
Web Development & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message ---
I was just curious, but what program or website do you all use to view and
reply to the newsgroups with ?

Lee


--- End Message ---

Reply via email to