Re: [PHP] Re: preg_grep Help (Regular expresion)

2002-05-12 Thread Brian C. Doyle

Hello all,

I did foget to mention that I had $file as
$file=file(Status.htm);
and it reads the file as 1 line it seams.


At 11:31 PM 5/12/02 +1200, Jason Morehouse wrote:
$file needs to be an array:

 $file = file(myfile.txt);

On Sun, 12 May 2002 12:56:08 +1200, Brian C. Doyle wrote:

  Hello all,
 
  I have a file that has ip address in it.. I need to pull those ip
  addresses out.
  Currently I am trying:
 
  $ips=preg_grep(/^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/,$file);
  print_r(array_values ($ips));
 
  And well i am getting nothing!
 
  Anyone?


--
  Jason Morehouse ([EMAIL PROTECTED])
  Netconcepts LTD, Auckland, New Zealand
  - Linux: because rebooting is for adding hardware.

--
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] preg_grep Help (Regular expresion)

2002-05-11 Thread Brian C. Doyle

Hello all,

I have a file that has ip address in it.. I need to pull those ip addresses 
out.
Currently I am trying:

$ips=preg_grep(/^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/,$file);
print_r(array_values ($ips));

And well i am getting nothing!

Anyone?



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




[PHP] PHP and Postgresql with out local Postgresql

2002-04-04 Thread Brian C. Doyle

Hello all,

How can I get linux php binary to access a remote postgresql server with 
out building postgresql on the local system

I want to do it like it is done on windows.
Example just load a dll file well .so in the script?

dl('extensions/php_pgsql.dll');
but
dl('what_ever.so');
  


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




[PHP] 8 bit check sum???? Not 32 bit

2002-01-16 Thread Brian C. Doyle

Hello all,

I currently have a perl subroutine that uses an 8 bit check sum.
 From what I have found, in books and the site, php will only do 32 bit.

Here is what I have currently

sub _hash_domain {
return uc(
unpack('H2',
pack('C',
unpack(%8C*, shift)
)   
)
);
}

This works fine in perl but I would like to get this to work in PHP
What am I missing.

Thanks for you help

Brian C. Doyle


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] phpinfo() returning Zero Sized Reply

2001-12-04 Thread Brian C. Doyle

Okay so i got rid of the echo and still no go..

I am using version 4.0.6

At 08:11 PM 12/4/2001 +0200, Valentin V. Petruchek wrote:
phpinfo() is a function itself. It needn't echo:
?
phpinfo();
?

Zliy Pes, http://www.zliypes.com.ua
- Original Message -
From: Brian C. Doyle [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, December 04, 2001 8:07 PM
Subject: [PHP] phpinfo() returning Zero Sized Reply


  hello all,
 
  I have a script with
  ?
  echo phpinfo();
  ?
  and getting Zero Sized Reply
 
  i have increased my timeout in php.ini and no change.
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Serial Port Programing

2001-11-12 Thread Brian C. Doyle

Hello all,

Does PHP have the ability to control a serial port?  I see we can use the 
Printer but that was All I saw.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] List of files?

2001-08-21 Thread Brian C. Doyle

Here is some code that I use to do what you wanted and attach is the files 
for the folders.
This uses javascript that works well with Internet Explorer and creates 
sublist that appear in the folder.


?
error_reporting (E_ALL ^ E_NOTICE);
?
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN

html
head
 titleUntitled/title
style
!--
#foldheader{cursor:hand ; font-weight:bold ;
list-style-image:url(fold.gif)}
#foldinglist{list-style-image:url(list.gif)}
#file{list-style-image:url(list01.gif)}
A:link{ color: #8000ff; }
A:visited { color: #80;background:#a9a8bd }
A:active  { color: #0080ff;font-weight:bold;background:#bcbbcc}
A:hover   { color: #0080ff;font-weight:bold;background:#FF}
//--
/style
script language=JavaScript1.2
var head=display:''
img1=new Image()
img1.src=fold.gif
img2=new Image()
img2.src=open.gif

function change(){
if(!document.all)
   return
if (event.srcElement.id==foldheader) {
   var srcIndex = event.srcElement.sourceIndex
   var nested = document.all[srcIndex+1]
   if (nested.style.display==none) {
  nested.style.display=''
  event.srcElement.style.listStyleImage=url(open.gif)
   }
   else {
  nested.style.display=none
  event.srcElement.style.listStyleImage=url(fold.gif)
   }
}
}
document.onclick=change
/script
/head
?
$dir=../;
$handle=opendir($dir);
while ($file = readdir($handle)) {
$local=$dir/$file;
if (is_dir($local)) {
   if ($file != .  $file != ..) {
   $dirArray[] = $file;
   }
}
elseif(is_file($local)){
$ext=substr($file,$strlen-4,4);
  if 
($ext==.jpg||$ext==jpeg||$ext==.JPG||$ext==JPEG||$ext==.gif||$ext==.GIF||$ext==png||$ext==PNG){
   $imageinfo_Array[]=$file;
   }
  elseif ($file!=.  $file!=..){
   $fileinfo_Array[]=$file;
   };
   };
};
closedir($handle);

asort($dirArray);
asort($imageinfo_Array);
asort($fileinfo_Array);
?

BODY BGCOLOR=#ff TOPMARGIN=10 LEFTMARGIN=5
ul
?
$dirArray;
while (list($key,$value) = each($dirArray)) {
$dir_info=base64_encode($value);
$subdir=../$value;
?
li id=foldheadernbsp;?$dirinfo=explode(-,$value);while 
(list($key,$info)=each($dirinfo)){echo ucfirst($info),nbsp;;};?
?
$open_subdir=opendir($subdir);
$file_info_Array=array();
while ($file = readdir($open_subdir)) {if (is_dir($img_file)) {}
else{
  $ext=substr($file,$strlen-4,4);
  if 
($ext==.jpg||$ext==jpeg||$ext==.JPG||$ext==JPEG||$ext==.gif||$ext==.GIF||$ext==png||$ext==PNG){
   $image_info_Array[]=$file;
   }
  elseif ($file!=.  $file!=..){
   $file_info_Array[]=$file;
   };
   };
};
closedir($open_subdir);
natcasesort($file_info_Array);
natcasesort($image_info_Array);
?nbsp;nbsp;?echo $count?/li
ul id=foldinglist style=display:none style={head};
?
while (list($key,$value) = each($file_info_Array)) {
?
 LI id=filenbsp;A HREF=edit.php?dir_info=?echo 
$subdir?file=?echo $value? TARGET=right ?echo $value;?/A/LI
?
};
?
?
while (list($key,$value) = each($image_info_Array)) {
?
 LInbsp;?echo $value;?/LI
?
};
?/ul
?
}
while (list($key,$value) = each($fileinfo_Array)) {
?
 LI id=filenbsp;A HREF=edit.php?dir_info=../file=?echo 
$value? TARGET=right ?echo $value;?/A/LI
?
};
while (list($key,$value) = each($imageinfo_Array)) {
?
 LI id=foldinglistnbsp;?echo $value;?/LI
?
};
?/ul
DIV ALIGN=center
TABLE
TR
 TD COLSPAN=2 ALIGN=centerA HREF=new.php?new=yes 
TARGET=right BNew PageB/ATD
/TR
TR
 TD COLSPAN=2 ALIGN=centerA HREF=index.html 
TARGET=_parent BMain PageB/ATD
/TR
/TABLE
/DIV
/BODY
/HTML


At 01:26 PM 8/21/01 +0100, Seb Frost wrote:
OK so I'vebeen reading about reading and writing to/from files, but what I
want to do is (I think) simpler than this.

Basically I want to look at a directory and be able to get a list of all
subdirectories and then a list of the files in each directory.  Can someone
give me a hint?

cheers

- seb


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

 filelist.zip

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


Re: [PHP] PNG support...

2001-08-20 Thread Brian C. Doyle

I have had the same problem with no resolution is this a BUG?

At 10:21 AM 8/20/01 -0400, Jeff Lewis wrote:
With 4.04 I had PNG working fine and could create images in a cron job I 
was running.  When we upgraded to 4.06 we seemed to have lost the 
ability.  While calling my PHP file up in the browser, it creates the 
image but my cron job keeps failing with this error:

ImageCreateFromPng: No PNG support in this PHP build

Anyone have any hints on how to fix this?

Jeff


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] fwrite????

2001-08-20 Thread Brian C. Doyle

Hello all,

Is is possible to just append to the end of a file using 
fwrite???  Currently I am reading the contents for the file into an array 
then add to the array what I want and rewrite the file from the array... 
And well that is just silly... How else would I do this??



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] fwrite????

2001-08-20 Thread Brian C. Doyle

Thank you for your time

I did not even look at the fopen... DUH

Sorry about not researching properly...

At 11:14 AM 8/20/01 -0700, Anton Stroganov wrote:
when you open the file with fopen(), use the 'a' (writing only) or 'a+'
(reading and writing) arguments
ie:
int fopen (somefile.txt, a);

...
*'a' - Open for writing only; place the file pointer at the end of the
file.
   If the file does not exist, attempt to create it.
*'a+' - Open for reading and writing; place the file pointer at the end
   of the file. If the file does not exist, attempt to create it.
...

info from
http://www.php.net/manual/en/function.fopen.php

- Original Message -
From: Brian C. Doyle [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 20, 2001 11:06
Subject: [PHP] fwrite


  Hello all,
 
  Is is possible to just append to the end of a file using
  fwrite???  Currently I am reading the contents for the file into an array
  then add to the array what I want and rewrite the file from the array...
  And well that is just silly... How else would I do this??
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Date function

2001-08-15 Thread Brian C. Doyle

I use

$date = explode(-, $msql_date);
$date = date(d F,mktime(0,0,0,$date[1],$date[2],$date[0]));

At 08:08 AM 8/15/01 -0700, Mike Mike wrote:
Hello,
I'm pulling a date out of MySQL as 2001-10-18.
How do I make it print October 18 in php?
Thanks much
   --Mike

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] ...No PNG support in this PHP build ....

2001-07-25 Thread Brian C. Doyle

Hello all,

I have some code that I have in 2 different directories on my server in the 
one directory it runs and draws the Image.  In another directory it will not?

I have both directorys chmod the same the 2 directories are with different 
owners.

What am I doing wrong?

The error I am getting is Warning: ImagePng: No PNG support in this PHP 
build in /home/user1/www/map/map_graphic.php on line 77

My config comand for PHP was
./configure' '--with-swf=../dist' '--with-pgsql=/usr/local/pgsql' 
'--with-apache=../apache_1.3.17' '--with-gd=../gd-1.8.4' 
'--with-mcrypt=../libmcrypt-2.2.6' '--with-imap=../imap-4.7c' 
'--with-pspell=../pspell-.11.0.1--enable-track-vars' 
'--disable-posix-threads' '--with-xml' '--enable-ftp'

and as I said in one case it works fine and another it errors.

Thanks for all the help.



[PHP] IRC Gateway Functions

2001-07-03 Thread Brian C. Doyle

Hello all,

I am trying to use the IRC Gateway Functions and am concerned that I may 
not have PHP configured correctly.  The problem with that is that i can not 
find anything to add to the configure line to add the functions.  Currently 
all I have in my code is
?
error_reporting (E_ALL);
$irc_open=ircg_pconnect('boots','127.0.0.1','6667');
?
and i get
Fatal error: Call to undefined function: ircg_pconnect() in 
/home/httpd/jbbent/ircopen.php on line 3

as my out put.

What am I missing

Thanks for your help.





[PHP] Compairing Times

2001-03-29 Thread Brian C. Doyle

Hello All,

how do I compare 2 times.
What i want to do is
$time=date("H:i:s",mktime(0,1,03,0,0,0));
IF ($time  00:00:35) { echo "Too High"};

when I do this all i ever get is
Too High no matter what the value of time is


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] file grabber help

2001-02-20 Thread Brian C. Doyle

Hello all,

I need to write a script to grab files via a web port.   Is there any way 
to do this??



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]