[PHP] Re: Help! Stuck! Perm denied w/ fopen.

2002-12-07 Thread psy berpunk
That worked! Thank you!


Dave wrote:

 i thought (could be wrong) that directories need execute to read within
 them, files only need r+w,
 to make a directory readable.. i always chmod 755 my directories and 644 my
 files (or in your case
 chmod 777 directories and 666 files, but i don't recommend that at all).

 sometimes, i chgrp nobobdy [file/dir] and then 775 [dir] or 664 [file] so
 that apache can have access,
 and your user, but not anybody else. make sure that doesn't mess anything
 else that might want access
 locally up.

 Psy Berpunk [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I am running using php with apache and curl on a redhat machine.
  All the installs are very recent with recent versions.
  Processing of .phtml from the html directory is working great except:
 
  I am getting perm denied with fopen for a directory that is set to 666
  for permissions, and owned by the same user and group as specified in
  httpd.conf: apache
 
  Something strange is going on here, as I have verified and reverified
  the paths and httpd config and test code, and either 666 or ownership
  should
  be enough and I'm still getting permission denied.
 


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




Re: [PHP] mail() problems...

2002-12-07 Thread Anthony Ritter
Jason Wong wrote:
 Would you mind disclosing what you did to make it work? Those searching
the
 archives in generations to come would appreciate what the conclusion was.
.

Sure.

1. I put it the _correct _name of my ISP's mailserver.

No more errros.

However...that sent out the mail but I didn't receive it back.

Then...

2. I received a nice e-mail from Ms. Meloni explaining that I forget to
replace the string in the variable:

$to

with _my_ e-mail address - not _hers_.

She was getting my test e-mails.

Oh brother...
Happy holidays and thank you for your help.
TR





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




Re: Re[2]: [PHP] Repeating Decimals

2002-12-07 Thread Stephen
Ok, I'm getting some weird errors. Here's the website:

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

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


- Original Message -
From: Tom Rogers [EMAIL PROTECTED]
To: Stephen [EMAIL PROTECTED]
Cc: PHP List [EMAIL PROTECTED]
Sent: Friday, December 06, 2002 11:26 PM
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
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




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


php-general Digest 7 Dec 2002 15:46:03 -0000 Issue 1749

2002-12-07 Thread php-general-digest-help

php-general Digest 7 Dec 2002 15:46:03 - Issue 1749

Topics (messages 127352 through 127377):

Re: mail() problems...
127352 by: Anthony Ritter
127372 by: Jason Wong
127376 by: Anthony Ritter

Date again
127353 by: Miguel Brás
127356 by: Stephen
127371 by: Jason Wong

Re: XSLT failing when DOCTYPE declaration present
127354 by: Dave
127355 by: Dave
127368 by: Chris Wesley

Re: Help! Stuck! Perm denied w/ fopen.
127357 by: Dave
127375 by: psy berpunk

Re: Middle Number
127358 by: Rick Widmer

Re: HOW GET ALL HTML CONTENT
127359 by: Dave

Re: Repeating Decimals
127360 by: Tom Rogers
127377 by: Stephen

Humour me
127361 by: John Taylor-Johnston
127363 by: . Edwin
127369 by: Jerry M. Howell II

Re: Generating forms using OOP
127362 by: Peter J. Schoenster
127367 by: Tom Rogers
127373 by: Davy Obdam
127374 by: Davy Obdam

Re: Output page cut off after 7000 characters
127364 by: Tom Rogers

Re: PHP includes without access to the default directory
127365 by: Tom Rogers

Re: Confused about $_SESSION and $_COOKIE scope..
127366 by: Tom Rogers

Re: Allowed memory size exhausted
127370 by: . Edwin

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]


--

---BeginMessage---
To all who assisted me today.

I finally managed to get the mail () funtion to work.

Thank you and happy holidays to you all...
TR





---End Message---
---BeginMessage---
On Saturday 07 December 2002 12:16, Anthony Ritter wrote:
 To all who assisted me today.

 I finally managed to get the mail () funtion to work.

Would you mind disclosing what you did to make it work? Those searching the 
archives in generations to come would appreciate what the conclusion was.

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

/*
Reply hazy, ask again later.
*/


---End Message---
---BeginMessage---
Jason Wong wrote:
 Would you mind disclosing what you did to make it work? Those searching
the
 archives in generations to come would appreciate what the conclusion was.
.

Sure.

1. I put it the _correct _name of my ISP's mailserver.

No more errros.

However...that sent out the mail but I didn't receive it back.

Then...

2. I received a nice e-mail from Ms. Meloni explaining that I forget to
replace the string in the variable:

$to

with _my_ e-mail address - not _hers_.

She was getting my test e-mails.

Oh brother...
Happy holidays and thank you for your help.
TR





---End Message---
---BeginMessage---
Ok guys,

having a problem here. I did my table with 6 fields, they are:
id  position  name  timein  timeout  date

I have a form to insert the info on the fields, and at the date field, I
have a drop down menu that returns me the next 7 days (the date in d/m/y),
people will choose the date they want and that will be stored on the table.

Now I want to retrieve the position, name, timein and timeout from by table
and display it on a page. But I want only the records for the present date.
I inserted the info on my table and on the date's field I inserted 07/12/02
and 06/12/02 just for testing

I called the data via a query: SELECT position, name, timein, timeout, date
FROM table WHERE date=NOW()
It was supposed that only the record from the present date was shown. But
not, I can't have anything. Only the custom message I did if nothing was
available

What is missing here? Looked at PHP manual, time, date mktime and so on
functions, but nothing.
Anybody for a hand?

One more thing, how can I do to prevent that different people apply for a
same position, on the same day and during the shift of the first one that
applied?

I mean, I decide to occupy the FSS position from 21:00 to 23:00 on 08th
Decemeber.
Someone come and try to apply also for FSS but from 19:00 to 20:30 or from
21:30 to 22:30. Since the position is occupied during a portion of the
requested time or during all the requested time, how can I prevent this to
be added on the table??

Thx
Miguel



---End Message---
---BeginMessage---
Not sure but I think now() doesn't return the date formate you'd want
assuming your date section is classified as a date. Here's what I would do:

$date = date(Y-m-d);
$sql = SELECT * FROM table WHERE date='.$date';
$result = mysql_query($sql, $connection);

Hope it works!


- Original Message -
From: Miguel Brás [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 06, 2002 10:39 PM
Subject: [PHP] Date again


 Ok guys,

 having a problem here. I did my table with 6 fields, they are:
 id  position  

[PHP] save file from outside url

2002-12-07 Thread Jeremiah Breindel
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 pUnable 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



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




RE: [PHP] redirect URL

2002-12-07 Thread John W. Holmes
 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



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




[PHP] Simple text editor for Windows?

2002-12-07 Thread John W. Holmes
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




Re: [PHP] Simple text editor for Windows?

2002-12-07 Thread Tim Ward
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
 
 


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




Re: [PHP] save file from outside url

2002-12-07 Thread Jason Wong
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 pUnable 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.
*/


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




Re: [PHP] save file from outside url

2002-12-07 Thread Jeremiah Breindel
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=0size=12font=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 pUnable 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+classrot=15size=48font=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 = 

[PHP] passing argument between scripts

2002-12-07 Thread Geert Arts
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



Re: [PHP] passing argument between scripts

2002-12-07 Thread Andrew Brampton
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




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




Re[2]: [PHP] Simple text editor for Windows?

2002-12-07 Thread Tom Rogers
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


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




Re[4]: [PHP] Repeating Decimals

2002-12-07 Thread Tom Rogers
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


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




Re: Re[2]: [PHP] Simple text editor for Windows?

2002-12-07 Thread DL Neil
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


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




Re[4]: [PHP] Simple text editor for Windows?

2002-12-07 Thread Tom Rogers
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




Re: Re[8]: [PHP] Repeating Decimals

2002-12-07 Thread Stephen
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




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




Re: Re[2]: [PHP] PHP includes without access to the default directory

2002-12-07 Thread Gundamn
thank you



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




[PHP] Spaces

2002-12-07 Thread Patrick McKinley
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





Re: [PHP] Spaces

2002-12-07 Thread Leif K-Brooks
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.




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




Re: [PHP] Spaces

2002-12-07 Thread Patrick McKinley
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.


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




RE: Re[4]: [PHP] Simple text editor for Windows?

2002-12-07 Thread Jonathan
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


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




[PHP] Help on OOP

2002-12-07 Thread Mohd_Q
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.




RE: [PHP] Spaces

2002-12-07 Thread John W. Holmes
 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...



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




RE: Re[4]: [PHP] Simple text editor for Windows?

2002-12-07 Thread John W. Holmes
  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...



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




Re: [PHP] Help on OOP

2002-12-07 Thread Khalid El-Kary
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


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



Re: [PHP] Help on OOP

2002-12-07 Thread Khalid El-Kary
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


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



[PHP] PHP trouble out of the box

2002-12-07 Thread Dennis Putnam

-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 

Re: [PHP] Good eve

2002-12-07 Thread rolf vreijdenberger


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



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




Re: [PHP] Middle Number

2002-12-07 Thread Stephen
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;



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




[PHP] Finding Mode

2002-12-07 Thread Stephen
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


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


Re: [PHP] String to an Array

2002-12-07 Thread Justin French
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



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




Re: [PHP] Question about displaying directories and files

2002-12-07 Thread Justin French
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



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




RE: [PHP] Help on OOP

2002-12-07 Thread Matt Giddings


 -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
 


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




RE: [PHP] Help on OOP

2002-12-07 Thread Khalid El-Kary
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


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



Re: [PHP] Middle Number

2002-12-07 Thread Rick Widmer
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



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




Re: [PHP] Finding Mode

2002-12-07 Thread Rick Widmer
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



Re: [PHP] String to an Array

2002-12-07 Thread Rick Widmer
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


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



Re: [PHP] Finding Mode

2002-12-07 Thread Stephen
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




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




[PHP] Just Curious

2002-12-07 Thread conbud
I was just curious, but what program or website do you all use to view and
reply to the newsgroups with ?

Lee



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




Re: [PHP] Just Curious

2002-12-07 Thread Leif K-Brooks
I use the mailing list.

conbud wrote:


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

Lee



 


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




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




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

2002-12-07 Thread php-general-digest-help

php-general Digest 8 Dec 2002 04:31:57 - 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]


--

---BeginMessage---
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 pUnable 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---
---BeginMessage---
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 pUnable 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---
---BeginMessage---
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=0size=12font=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 

Re: [PHP] Just Curious

2002-12-07 Thread Justin French
I use the e-mailing list, not the newsgroup... but I think there is an
*experimental* web based interface to the newsgroup at http://news.php.net,
and most mail readers (outlook, outlook express and netscape I know for
sure) can all read news.

on 08/12/02 3:31 PM, conbud ([EMAIL PROTECTED]) wrote:

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

Justin French

http://Indent.com.au
Web Development  
Graphic Design



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




[PHP] Question about Trim

2002-12-07 Thread Dade Register
Hey... I have a question about trim. I don't know if
trim() is the right funtion to use, but here is my
problem.

I am recieving a textarea input from a form and
writing it to a data file. I need to change any line
breaks or (enter) if you will into a br or something
else. When it's in my text file, it screws it up.
Please, someone give me an idea of how to oversome
this. I can't seem to make trim() work at all. It does
remove a \n if you type that in, but won't actually
remove an (enter). Thanx for your help in advance.

-Dade

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] Free Util: apxDebug

2002-12-07 Thread Weston Houghton

Hey all,

I've been meaning to write a simple debug tracking class for use in my 
own projects. So this week I finally did. I have no clue if anyone else 
would ever use it, or have any interest in looking at it, but I've set 
it up for people to download it if you have any interest. Regardless, I 
would love if people wanted to take a look at it and just give me 
general comments on the code.

http://www.anapraxis.com/os/apxDebug/

What does it do?
It's just a simple tool for logging debug messages from within any 
other php development. Being a MacOS X user for developing and serving, 
I find that many of the nice tools, such as Zend's aren't available for 
real debugging. So I frequently am writing values out to screen for 
debugging. This tool separates them mostly from whatever you are 
working on and let's you classify them, and show/hide groups of them 
when browsing. I've set up a simple online demo, but since it really is 
for development it may be hard to understand without just trying it out 
in your own code.

I've been developing tools for installations on clients intranet 
servers lately too, to where I cannot see in, but they can see out. So 
I have written the tool to both log the debug info to a text file, as 
well as email the logfile to an address through the browser pop-up. 
Right now it only does html emails, but I am working on getting it 
setup to handle plain text and mixed mode as well.

It uses css, dhtml, and javascript for the display so likely requires 
gecko or MSIE 5 or higher. Also, if you are just interested in seeing 
php and javascript work together, it might be a good introduction for 
you, nothing complicated, I just use php to feed in some of the js 
variables.

Anyhow, drop me a line with any questions if you have them, or feature 
requests, I'd love to know if anyone else besides me would actually use 
this thing. :) Oh, and if it just completely screws up for you, let me 
know too. I'd call this a 0.9 beta version, so I'm sure it will find a 
way to surprise me.

Cheers,
Wes


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



Re: [PHP] Question about Trim

2002-12-07 Thread Justin French
To convert \n's to br /\n's on any string, use nl2br().

To trim excess white space (\n, \r, [space] \t, etc) from both the beginning
and end of a string, use trim().

Eg:

?
$str = this is a string with an\nenter in the middle, and two at the
end\n\n;
$str = trim($str);
$str = nl2br($str);
echo $str;
?

This should echo:
---
this is a string with anbr /
enter in the middle
---

What do you actually want to do, and what's the problem?

Justin


on 08/12/02 5:28 PM, Dade Register ([EMAIL PROTECTED]) wrote:

 Hey... I have a question about trim. I don't know if
 trim() is the right funtion to use, but here is my
 problem.
 
 I am recieving a textarea input from a form and
 writing it to a data file. I need to change any line
 breaks or (enter) if you will into a br or something
 else. When it's in my text file, it screws it up.
 Please, someone give me an idea of how to oversome
 this. I can't seem to make trim() work at all. It does
 remove a \n if you type that in, but won't actually
 remove an (enter). Thanx for your help in advance.
 
 -Dade
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com

Justin French

http://Indent.com.au
Web Development  
Graphic Design



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




[PHP] Re: Just Curious

2002-12-07 Thread Kyle Gibson
I was just curious, but what program or website do you all use to view and
reply to the newsgroups with ?



Fun Fact # 14:
Netscape 7.0

;)

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


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