Re: [PHP] Array within array

2005-09-30 Thread Chris Blake
On Fri, 2005-09-30 at 15:33, Emil Novak wrote:
 ?php
 $array_file = file(path/to/file);
 foreach($array_file as $line)
 {
   $e_array = explode(',',$line);
   {
   // do update on db for each line of array
   }
 }
 ?
 
 Like this?

Hi Emil,

That`s exactly how I figured it out eventuallysometimes you just
need to step away from the monitor and take a break before the answer
slaps you on the forehead... :)

Thanks

--
Chris Blake 
Cell: 082 775 1492
Work: +27 11 880 2825
Fax : +27 11 782 0841
Mail: [EMAIL PROTECTED]

If a camel flies, no one laughs if it doesn't get very far. -- Paul
White

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



[PHP] php wget: Return an empty file

2005-04-08 Thread Chris Blake
Greetings PHP(eople),

I have a wget process that runs to download a file from a web site,
however, if no file exists at the location I`m pulsing, how do I get it
to abort ?

Here is the code :

?php
$getfile = 'wget -dv -o log.txt http://www.somesite.co.za/somefile.php';
$get = shell_exec($getfile);
?

I looked at filesize(), but if no file is brought back then there is
nothing for the function to check.

If someone could point me to the right PHP function, or a link
somewhere...

Regards

--
Chris Blake 
Cell: 082 775 1492
Work: +27 11 782 0840
Fax : +27 11 782 0841
Mail: [EMAIL PROTECTED]

I have a very good DENTAL PLAN. Thank you.

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



Re: [PHP] php wget: Return an empty file [Solved]

2005-04-08 Thread Chris Blake
On Fri, 2005-04-08 at 09:47, Chris Blake wrote:
 Greetings PHP(eople),
 
 I have a wget process that runs to download a file from a web site,
 however, if no file exists at the location I`m pulsing, how do I get it
 to abort ?
 
 Here is the code :
 
 ?php
 $getfile = 'wget -dv -o log.txt http://www.somesite.co.za/somefile.php';
 $get = shell_exec($getfile);
 ?
 
 I looked at filesize(), but if no file is brought back then there is
 nothing for the function to check.
 
 If someone could point me to the right PHP function, or a link
 somewhere...

No worries, file_exists() was what I was looking for.

Regards

--
Chris Blake 
Cell: 082 775 1492
Work: +27 11 782 0840
Fax : +27 11 782 0841
Mail: [EMAIL PROTECTED]

When managers hold endless meetings, the programmers write games. When
accountants talk of quarterly profits, the development budget is about
to be cut. When senior scientists talk blue sky, the clouds are about to
roll in. Truly, this is not the Tao of Programming. When managers make
commitments, game programs are ignored. When accountants make long-range
plans, harmony and order are about to be restored. When senior
scientists address the problems at hand, the problems will soon be
solved. Truly, this is the Tao of Programming. -- Geoffrey James, The
Tao of Programming

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



Re: [PHP] php wget: Return an empty file

2005-04-08 Thread Chris Blake
On Fri, 2005-04-08 at 13:52, Josip Dzolonga wrote:
 Chris Blake wrote:
 
 Greetings PHP(eople),
 
 I have a wget process that runs to download a file from a web site,
 
 
 Why would you do that ? There're bultin functions in PHP for doing it.

wget was the first thing I thought of  :)

--
Chris Blake 
Cell: 082 775 1492
Work: +27 11 782 0840
Fax : +27 11 782 0841
Mail: [EMAIL PROTECTED]

A woman was in love with fourteen soldiers. It was clearly platoonic.

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



RE: [PHP] shell_exec question - Solved

2003-10-09 Thread Chris Blake
To all who contributed to this thread, many thanks...

I tried all the suggestions offered but still had the same problem.
Today I copied php.ini-dist over to /etc, restarted Apache and
everything works. This process was repeated many times during the last
day or so, so I don`t know what happened to make it work this time.

Anyhowze, my shell_exec`s are working now, so I`m a happy camper...

Thanks again to all who assisted, muchly apreciated.

-- 
Chris Blake
Support Consultant
Office : (011) 782-0840
Fax: (011) 782-0841
Mobile : 083 985 0379
Website: http://www.pbpc.co.za

THE LESSER-KNOWN PROGRAMMING LANGUAGES #10: SIMPLE

SIMPLE is an acronym for Sheer Idiot's Monopurpose Programming Language
Environment.  This language, developed at the Hanover College for
Technological Misfits, was designed to make it impossible to write code
with errors in it.  The statements are, therefore, confined to BEGIN,
END and STOP.  No matter how you arrange the statements, you can't make
a syntax error.  Programs written in SIMPLE do nothing useful.  Thus
they achieve the results of programs written in other languages without
the tedious, frustrating process of testing and debugging.

10:29:53 up 22 days,  1:59,  3 users,  load average: 0.52, 0.19, 0.13

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



[PHP] shell_exec question

2003-10-08 Thread Chris Blake
Greetings learned PHP(eople);

I`m using a shell_exec to get a list of files from a specified
directory.

When I run it locally on my machine i works. When I run it on the other
machine I get

=
Warning: shell_exec() [function.shell-exec]: Cannot execute using
backquotes in Safe Mode in /var/www/html/search.php on line 9
=

In /etc/php.ini Safe Mode is offI read some postings in the archives
and on the advice given checked that the owner of the script has the
relevant permissions on the directory/files trying to be accessed, and
they are the same i.e. root

Any ideas ?


-- 
Chris Blake
Support Consultant
Office : (011) 782-0840
Fax: (011) 782-0841
Mobile : 083 985 0379
Website: http://www.pbpc.co.za

What does education often do?  It makes a straight cut ditch of a
free meandering brook.
-- Henry David Thoreau


13:10:21 up 21 days,  4:40,  3 users,  load average: 0.48, 0.33, 0.28

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



Re: [PHP] shell_exec question

2003-10-08 Thread Chris Blake
On Wed, 2003-10-08 at 13:56, David Otton wrote:

 However, is there any reason you're not using readdir()?
 
 http://uk.php.net/manual/en/function.readdir.php

I`ve got a whole bunch of other stuff happening using shell_exec, eg
file searches etc

I changed php.ini entry for safemode=on , restarted Apache, but that
didn`t help.opendir() returns the following :

=

Warning: opendir() [function.opendir]: SAFE MODE Restriction in effect.
The script whose uid is 0 is not allowed to access /home owned by uid 0
in /var/www/html/backups.php on line 8

Warning: opendir(/home/chris/PBPCBackup/) [function.opendir]: failed to
open dir: No such file or directory in /var/www/html/backups.php on line
8

=

I got this error as well prior to changing the safe mode parameter...

Still lost, but searching   :(


-- 
Chris Blake
Support Consultant
Office : (011) 782-0840
Fax: (011) 782-0841
Mobile : 083 985 0379
Website: http://www.pbpc.co.za

Women want their men to be cops.  They want you to punish them and tell
them what the limits are.  The only thing that women hate worse from a
man
than being slapped is when you get on your knees and say you're sorry.
-- Mort Sahl


14:40:40 up 21 days,  6:10,  3 users,  load average: 0.32, 0.14, 0.25

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



Re: [PHP] shell_exec question

2003-10-08 Thread Chris Blake
On Wed, 2003-10-08 at 14:51, Marek Kilimajer wrote:
 Did you edit the right php.ini? Check out phpinfo() output for 
 Configuration File (php.ini) Path
 

Yep, tried that...it states /etc/php.ini, and lists other location of
/etc/php/, but that directory doesn`t contain a php.ini file

-- 
Chris Blake
Support Consultant
Office : (011) 782-0840
Fax: (011) 782-0841
Mobile : 083 985 0379
Website: http://www.pbpc.co.za

Campus sidewalks never exist as the straightest line between two points.
-- M. M. Johnston

14:56:07 up 21 days,  6:26,  3 users,  load average: 0.48, 0.25, 0.21

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



Re: [PHP] shell_exec question

2003-10-08 Thread Chris Blake
On Wed, 2003-10-08 at 15:02, Marek Kilimajer wrote:
 I think that ALL files in other location are parsed, it does not need to 
 be named php.ini
 

I checked in /etc/php/ and it lists the following files :

23_gid.ini
26_imap.ini
27_ldap.ini
34_mysql.ini and
41_readline.ini

All these files contain single entries e.g

extension =readline.so

and so on.

Is there another file I should look for in /etc ?

-- 
Chris Blake
Support Consultant
Office : (011) 782-0840
Fax: (011) 782-0841
Mobile : 083 985 0379
Website: http://www.pbpc.co.za

A person forgives only when they are in the wrong.


15:08:37 up 21 days,  6:38,  3 users,  load average: 0.33, 0.16, 0.14

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



Re: [PHP] shell_exec question

2003-10-08 Thread Chris Blake
On Wed, 2003-10-08 at 15:23, Marek Kilimajer wrote:
 Then check your httpd.conf for php_(admin_)?(flag|value)

I checked it but there is nothing for php whatsoever.

-- 
Chris Blake
Support Consultant
Office : (011) 782-0840
Fax: (011) 782-0841
Mobile : 083 985 0379
Website: http://www.pbpc.co.za

Anybody with money to burn will easily find someone to tend the fire.

15:35:56 up 21 days,  7:05,  3 users,  load average: 0.08, 0.08, 0.14

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



Re: [PHP] shell_exec question

2003-10-08 Thread Chris Blake
On Wed, 2003-10-08 at 15:23, Marek Kilimajer wrote:
 Then check your httpd.conf for php_(admin_)?(flag|value)
 

OK, so I`ve tried all the suggestions posted, thanks guys...but then I
went and deleted the php.ini file in /etc, and still when I use
phpinfo(); it gives me the usual phpinfo page...

So where is the info coming from...another php.ini located somewhere
else on my drive ?

A search revealed naddaso I`m out of ideas right now.

-- 
Chris Blake
Support Consultant
Office : (011) 782-0840
Fax: (011) 782-0841
Mobile : 083 985 0379
Website: http://www.pbpc.co.za

buzzword, n:
The fly in the ointment of computer literacy.


16:16:41 up 21 days,  7:46,  3 users,  load average: 0.43, 0.20, 0.24

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



[PHP] PHP Worldwide Stats

2003-09-17 Thread Chris Blake
Greetings learned PHP(eople);

Where can I find stats, if any, on the number of sites using PHP as a
server side language ?

I been googling around using PHP global statistics and other
combinations but can`t find anything.

Regards
 
-- 
Chris Blake
Support Consultant
Office : (011) 782-0840
Fax: (011) 782-0841
Mobile : 083 985 0379
Website: http://www.pbpc.co.za

Flame on!
-- Johnny Storm

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



Re: [PHP] PHP Worldwide Stats

2003-09-17 Thread Chris Blake
On Wed, 2003-09-17 at 16:55, Jason Wong wrote:
 On Wednesday 17 September 2003 22:44, Chris Blake wrote:
 
  Where can I find stats, if any, on the number of sites using PHP as a
  server side language ?
 
  I been googling around using PHP global statistics and other
  combinations but can`t find anything.
 
 www.netcraft.com
 
Thank you Mr. Wong..I was such a dumbass...I coulda just gone to
PHP.net in the first place, the link is on the front page...


-- 
Chris Blake
Support Consultant
Office : (011) 782-0840
Fax: (011) 782-0841
Mobile : 083 985 0379
Website: http://www.pbpc.co.za

Data, n.:
Computerspeak for information.  Properly pronounced
the way Bostonians pronounce the word for a female child.

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



Re: [PHP] PHP Worldwide Stats

2003-09-17 Thread Chris Blake
On Wed, 2003-09-17 at 17:11, Curt Zirzow wrote:
 [snip]
  
  Flame on!
   -- Johnny Storm
  
 
 Is this an invite :)
 

I have no idea who Johnny Storm is...but best he stay away from starting
a flame war on my behalf...I`m a lover, not a fighter
:)


-- 
Chris Blake
Support Consultant
Office : (011) 782-0840
Fax: (011) 782-0841
Mobile : 083 985 0379
Website: http://www.pbpc.co.za

Default, n.:
The hardware's, of course.

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



[PHP] Directory Size

2003-08-15 Thread Chris Blake
Greetings learned PHP(eople);

Is there a way to calculate the size of directory in PHP ?

I searched php.net and only found ways of opening directories and
reading file sizes

One suggestion on there was to do the following :

$mstrng = shell_exec('du -sc /backup/');
echo 'pre' . $mstrng . 'pre';

When I do that my browser hangs endlesslymind you, it also hangs
when I run du -sc from the command line...

Any pointers muchly appreciated...

-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379

Anger kills as surely as the other vices.


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



Re: [PHP] Directory Size

2003-08-15 Thread Chris Blake
On Fri, 2003-08-15 at 12:36, Marek Kilimajer wrote:
 Are you sure it hangs? It might take a long time to get occupied size. 
 This also depends on the filesystem used, I heard reserfs is best at this.
 
Well, I thought it was hanging cuz 15 mins went past without any
return...then I figured it had something to do with the fact that its
reading 20Gb of directories and files...

I`m busy investigating some other options :
`du $file -c` seems to workI`ll try playing around a bit and will
report back later...

I`m not sure what you mean re the filsystem type, I`m using MDK, which I
understand uses ext3 (newbie)

Thanks for trying to assist...
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379

If we men married the women we deserved, we should have a very bad time
of it.
-- Oscar Wilde


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



[PHP] Parse error not understood

2003-08-14 Thread Chris Blake
Greetings learned PHP(eople);

My HTML :
--
input type=input class=input name=usernamebox value=Enter user
name../inputbr
input type=radio name=useroption value=addAdd User/inputbr
input type=radio name=useroption value=editEdit User/inputbr
input type=radio name=useroption value=deleteDelete
User/inputbr

My PHP Code :

?php
include('pbpc_client_connect_db');
//If usernamebox is empty--
if ($_REQUEST['usernamebox'] ==)
{
header('location: user_blank.php');
exit();
}

//If default value is left in
if($_REQUEST['usernamebox'] ==Enter user name..)
{
header('location: user_blank.php');
exit();
}

//If 'Add New User' is selected-
if ( $_REQUEST['useroption'] == 'add')
{
//First, check that the username doesn`t exist already
$query = select count(*) from pbpc_client where username = ' .
$_REQUEST['usernamebox'] . ';;
$result = mysql_query($query);
if(!$result)
{
echo 'Cannot run query.';
exit();
}
$count = mysql_result($result, 0, 0);
if($count0)
{
//User already exists in database
header('location: user_exists.php');
exit();
}   
header(location:add_new_user.php?usernamebox= .
$_REQUEST['usernamebox']);
exit();
}
// If Edit User is selected-
if ( $_REQUEST['useroption'] == 'edit')
{

//First, check that this user account actually exisits in the database
$query = select count(*) from pbpc_client where username = ' .
$_REQUEST['usernamebox'] . ';;
$result = mysql_query($query);
if(!$result)
{
echo 'Cannot run query.';
exit();
}

$count = mysql_result($result, 0, 0);
if($count==0)
{
//User does not exist in the database
header('location: user_not_exists.php');
exit();
}

}
//If Delete User is selected--
if ( $_REQUEST['useroption'] == 'delete')
{
//First, check that the user already exists
$query = select count(*) from pbpc_client where username = ' .
$_REQUEST['usernamebox'] . ';;
$result = mysql_query($query);
if(!$result)
{
echo 'Cannot run query.';
exit();
}

$count = mysql_result($result, 0, 0);
if($count==0)
{
//User does not exist in the database
header('location: user_not_exists.php');
exit();

header('location:del_new_user.php');
exit();
}
//header('location: content.php');
?

No matter which option I select I get the following output :
--
Parse error: parse error, unexpected $ in
/var/www/html/Sessions/userman.php on line 83

Line 83 is '?'..

Any ideas and help greatly appreciatedI been staring at this for an
hour now and can`t see whats wrong.

Thanks


-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379

Injustice anywhere is a threat to justice everywhere.
-- Martin Luther King, Jr.


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



[PHP] Re: Parse error not understood

2003-08-14 Thread Chris Blake
Holy schmoley...something so small.I must get off this green tea,
all this good health stuff is causing havoc in my brain...

Thanks Fokkema, and Johnfor pointing out an obvious error...

Regards


On Wed, 2003-08-06 at 14:48, Fokkema, I.F.A.C. (HKG) wrote:
  //If Delete User is selected--
  if ( $_REQUEST['useroption'] == 'delete')
  {
  //First, check that the user already exists
  $query = select count(*) from pbpc_client where username = ' .
  $_REQUEST['usernamebox'] . ';;
  $result = mysql_query($query);
  if(!$result)
  {
  echo 'Cannot run query.';
  exit();
  }
 
  $count = mysql_result($result, 0, 0);
  if($count==0)
  {
  //User does not exist in the database
  header('location: user_not_exists.php');
  exit();
 
  header('location:del_new_user.php');
  exit();
  }
  //header('location: content.php');
  ?
 
  No matter which option I select I get the following output :
  --
  Parse error: parse error, unexpected $ in
  /var/www/html/Sessions/userman.php on line 83
 
  Line 83 is '?'..
 You missed a '}' at lines :
 
 
 if($count==0)
 {
 //User does not exist in the database
 header('location: user_not_exists.php');
 exit();
 
 Add a '}' after this, and your problem is fixed!
 
 
 --
 Ivo Fokkema
 PHP  MySQL programmer
 Leiden University Medical Centre
 Netherlands
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379

None of our men are experts.  We have most unfortunately found it
necessary 
to get rid of a man as soon as he thinks himself an expert -- because no
one 
ever considers himself expert if he really knows his job.  A man who
knows a 
job sees so much more to be done than he has done, that he is always
pressing 
forward and never gives up an instant of thought to how good and how
efficient 
he is.  Thinking always ahead, thinking always of trying to do more,
brings a 
state of mind in which nothing is impossible. The moment one gets into
the
expert state of mind a great number of things become impossible.
-- From Henry Ford Sr., My Life and Work, p. 86 (1922):


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



Re: [PHP] Running script produces no output

2003-08-07 Thread Chris Blake
Hi Jacob,

The script does indeed run, and I have since added the following :

$shell_return = shell_exec(./info.sh .  21);

This pointed out to me that the error was in the script itself, and not
the php...

I have now sorted this out so it works as expected...

Thanks for your time in assisting..

Regards

Chris

On Wed, 2003-08-06 at 08:58, Jacob Vennervald Madsen wrote:
 Does the script work when you run it by hand?
 
 Try to insert an echo TESTER in the top the shell script to make sure
 something is sent to stdout. And then check in your php script that you
 receive the message.
 
 Best regards,
 Jacob Vennervald
 
 On Wed, 2003-08-06 at 08:38, Chris Blake wrote:
  Greetings learned PHP(eople);
  
  I have a small script sitting in my web directory which I have called
  upon as follows :
  
  ?php
  shell_exec('./info.sh');
  ?
  
  The script is not being run, yet I can do things like
  
  ?php
  $info=shell_exec('ls -l');
  echo 'pre$info/pre';
  ?
  
  ..which produce output to the browser...
  
  I have tried 'chown apache:apache info.sh' but this doesn`t change
  anything
  I have also tried using './info.sh' with no result
  
  Any pointers much appreciated as to why this won`t work. The permissions
  are as follows for the script file :
  
  -rwxrwxrwx1 root root 2456 Aug  5 16:35 info.sh
  
  Regards
  
  -- 
  Chris Blake
  Office : (011) 782-0840
  Cell : 083 985 0379
  
  Join the army, see the world, meet interesting, exciting people, and
  kill them.
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379

We're mortal -- which is to say, we're ignorant, stupid, and sinful --
but those are only handicaps.  Our pride is that nevertheless, now and
then, we do our best.  A few times we succeed.  What more dare we ask
for?
-- Ensign Flandry


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



[PHP] Running script produces no output

2003-08-06 Thread Chris Blake
Greetings learned PHP(eople);

I have a small script sitting in my web directory which I have called
upon as follows :

?php
shell_exec('./info.sh');
?

The script is not being run, yet I can do things like

?php
$info=shell_exec('ls -l');
echo 'pre$info/pre';
?

..which produce output to the browser...

I have tried 'chown apache:apache info.sh' but this doesn`t change
anything
I have also tried using './info.sh' with no result

Any pointers much appreciated as to why this won`t work. The permissions
are as follows for the script file :

-rwxrwxrwx1 root root 2456 Aug  5 16:35 info.sh

Regards

-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379

Join the army, see the world, meet interesting, exciting people, and
kill them.


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



[PHP] Variable not passed twixt pages..

2003-07-18 Thread Chris Blake
Greetings learned PHP(eople),

Scenario : User fills in text box, pushes Submit and textbox data gets
passed to MySQL database..

=
The code from the HTML page :

form action=savemail.php method=GET target=main
input type=text class=mailinput name=mailaddress value=Your
Email Address
==

The code from savemail.php :

?php
  $result = @mysql_pconnect('localhost', 'user', 'pass'); 
  $query = insert into email values (' . $_REQUEST['mailaddress']
. ');
   //Error stuff-
  $ResSaveMail = mysql_query($query);
  if (!$ResSaveMail)
   {
  echo(PError performing query:  . mysql_error() . /P);
  echo(Your email has not been saved to the Delta Database.);
  exit();
   }
//
?
===

THe problem :
The variable 'mailaddress' is not getting passed to savemail.php

echo $_REQUEST['mailaddress'] reveals blank

On another programmers advice I tried using POST in my form, but that
don`t work either..

The database is getting populated with blank values...is my problem in
the php code somewhere..I been playing with this for a while now and no
joy has yet surfaced..

Any ideas greatly appreciated...

-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379

Then there was the Formosan bartender named Taiwan-On.


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



Re: [PHP] Variable not passed twixt pages..

2003-07-18 Thread Chris Blake
Thanks to all who contributed, I managed to get it to work using just
$mailaddress.

Much appreciated.

-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379

One learns to itch where one can scratch.
-- Ernest Bramah


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



RE: [PHP] Missing php.ini file

2003-07-15 Thread Chris Blake
Greetings again,

Did as Ralph suggested...here is the output :

[EMAIL PROTECTED] php]# find / -name php.ini -print
/home/chris/Documents/Mein Stuph/PHP 4
Package/php-4.3.1/pear/tests/php.ini
find: /mnt/floppy: Input/output error
find: /mnt/cdrom: Input/output error
/mnt/ClientWebs/knowledgeTree/etc/php.ini
/mnt/Users/CBlake/Backup/Documents/Mein Stuph/PHP 4
Package/php-4.3.1/pear/tests
/php.ini
/usr/local/Zend/bin/php.ini
---

With the exception of the .ini located in the last entry, all others are
merely blank files

I then copied the php.ini-dist to /etc as suggested, renamed it and all
is OK now

Thanks to everyone who helped out on this onemuchly appreciated.

Regards


Chris

On Mon, 2003-07-14 at 23:22, Ralph Guzman wrote:
 Chris,
 
 Not sure how you went about searching for php.ini, but you can type in
 the following find command in your command prompt and it will search
 your entire system:
 
 find / -name php.ini -print
 
 You may also want to look for php.in in /usr/local/lib. This is where
 php install php.ini by default.
 
 If phpinfo() is showing php.ini in /etc and you can't find it, simply
 look for a copy of the original php.ini-dist in the php source directory
 and copy it to /etc. Just be sure to rename it from php.ini-dist to
 php.ini.
 
 To copy, in your php source directory type:
 
 cp php.ini-dist /etc/php.ini 
 
 Hope this helps.
 
 -Original Message-
 From: Chris Blake [mailto:[EMAIL PROTECTED] 
 Sent: Monday, July 14, 2003 3:30 AM
 To: PHP Mailing List
 Subject: [PHP] Missing php.ini file
 
 Greetings learned PHP(eople),
 
 My php.ini file has gone awol, how or why I don`t know
 
 The only php.ini file I can find on my system (MDK 9.1) is located in 
 '/usr/local/ZEND/bin' and only contains the following entries :
 ===
 zend_extension=/usr/local/Zend/lib/ZendDebuggerLocal.so
 zend_debugger.allow_hosts=127.0.0.1/32
 session.save_path=/tmp
 ===
 
 I did phpinfo() on a test page and it reports the following..
 
 ---
 Configuration File (php.ini) Path /etc  
 
 Scan this dir for additional .ini files /etc/php  
 
 additional .ini files parsed /etc/php/23_gd.ini, /etc/php/26_imap.ini,
 /etc/php/27_ldap.ini, /etc/php/34_mysql.ini, /etc/php/41_readline.ini 
 
 
 Could the file be hidden in one of these directoriesI`m kinda new to
 both MDK and php, so would appreciate any ideas if you have some as to
 how I can get my php.ini file back
 
 Do I need to re-install/recompile PHP ?
 
 Many thanks
 -- 
 Chris Blake
 Office : (011) 782-0840
 Cell : 083 985 0379
 
 Just because the message may never be received does not mean it is
 not worth sending.


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



Re: [PHP] Missing php.ini file

2003-07-15 Thread Chris Blake
On Tue, 2003-07-15 at 11:05, Joel Rees wrote:
 ..here is the output :
  
  [EMAIL PROTECTED] php]# find / -name php.ini -print
 
 sudo is your friend.
Not knowing much about Linux, at the moment sudo is very confusing, but
I`ll be looking into it :)
 
  /home/chris/Documents/Mein Stuph/PHP 4
  Package/php-4.3.1/pear/tests/php.ini
  find: /mnt/floppy: Input/output error
  find: /mnt/cdrom: Input/output error
  /mnt/ClientWebs/knowledgeTree/etc/php.ini
  /mnt/Users/CBlake/Backup/Documents/Mein Stuph/PHP 4
  Package/php-4.3.1/pear/tests
  /php.ini
      What was that?
Just a blank file...

-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379

The greatest of faults is to be conscious of none.


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



[PHP] Missing php.ini file

2003-07-14 Thread Chris Blake
Greetings learned PHP(eople),

My php.ini file has gone awol, how or why I don`t know

The only php.ini file I can find on my system (MDK 9.1) is located in 
'/usr/local/ZEND/bin' and only contains the following entries :
===
zend_extension=/usr/local/Zend/lib/ZendDebuggerLocal.so
zend_debugger.allow_hosts=127.0.0.1/32
session.save_path=/tmp
===

I did phpinfo() on a test page and it reports the following..

---
Configuration File (php.ini) Path /etc  

Scan this dir for additional .ini files /etc/php  

additional .ini files parsed /etc/php/23_gd.ini, /etc/php/26_imap.ini,
/etc/php/27_ldap.ini, /etc/php/34_mysql.ini, /etc/php/41_readline.ini 


Could the file be hidden in one of these directoriesI`m kinda new to
both MDK and php, so would appreciate any ideas if you have some as to
how I can get my php.ini file back

Do I need to re-install/recompile PHP ?

Many thanks
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379

Just because the message may never be received does not mean it is
not worth sending.


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



Re: [PHP] Missing php.ini file

2003-07-14 Thread Chris Blake
On Mon, 2003-07-14 at 14:13, John W. Holmes wrote:
 .
 
 You can normally just get a new php.ini from here:
 
 http://cvs.php.net/co.php/php4/php.ini-dist
 
 but it's giving a 505 error right now. May have to wait a bit.
 
 First, create a PHP page with just the function ? phpinfo(); ? on it. 
 Load up that page and look in the first block. Look for the line that 
 says: Configuration File (php.ini) Path. If a php.ini file is listed 
 there, that's the one that PHP is using. If just a path is shown, then 
 PHP is using its defaults and that's where you should place the php.ini 
 file when you get one. You can download the appropriate distro for your 
 OS and just copy the php.ini from there, also. They are normally called 
 php.ini-dist and php.ini-recommended that you rename into php.ini.
 
 -- 
 ---John Holmes...


Thanks John,

I`m also getting the 505 and will check back later..

Thanks for the tip/link, much appreciated...
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379

Oppernockity tunes but once.


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



[PHP] Creating Images

2003-06-09 Thread Chris Blake
Greetings learned PHP(eople),

I am using the code below to create buttons based on entries that are
inserted into a text field from the preceding page.

I got this code from my trusty tome PHP and MySQL Web Development by
Luke Wellign/Laura Thomson.

Problem is this :

If I type in more than 18 characters the image creation fails with :

The image http://xx..xx.xx/Generic/Admin/make_buttons.php;
cannot be displayed, because it contains errors

When I view the HTML page source code, it simply states
Text given is too large for button 

Any ideas on how to make it so that the error I specified comes up and
not the The image http://xxx.xxx.xxx.xxx.x blah blah part.

Here`s the code :
---
?php
  Header('Content-type: image/png');
   
  //Posted from previous page
  //Button text and colour
  $button_text = $HTTP_POST_VARS['button_text'];
  $colour = $HTTP_POST_VARS['colour'];

  if (empty($button_text) || empty($colour))
 {
 echo 'Could not create button';
 exit;
 }
  
  //Create image from existing image
  $image = imagecreatefrompng ('images/purple.png');

  $image_width = ImageSX($image);
  $image_height = ImageSY($image);

  //Image needs 18 pixel margin in from the edge image 
  $image_width_wo_margins = $image_width - (2 * 18);
  $image_height_wo_margins = $image_height - (2 * 18);

  //Work out if the font size will fit and make it
  //smaller until it does. Start with large size and scale down
  $font_size = 33;
  
  //Set font name and location
  $fontname =
/home/data/ClientWebs/chrisplay/Generic/Admin/a_d_mono.ttf;

  do
   {
   $font_size--;

   //Find out the size of the text at that font size
   $bbox = imagettfbbox ($font_size, 0, $fontname, $button_text);

   $right_text = $bbox[2]; //Right co-ordinate
   $left_text = $bbox[0]; //Left co-ordinate
   $width_text = $right_text - $left_text; //How wide is it ?
   $height_text = abs($bbox[7] - $bbox[1]); //How tall is it ?
   }

  while ($font_size  8 
($height_text  $image_height_wo_margins || $width_text 
$image_width_wo_margins)
);
  
 if ($height_text  $image_height_wo_margins || $width_text 
$image_width_wo_margins)
  {
  //No readable font size will fit on button
  echo 'Text given is too large for button';
  }
 else
  {
  //The font size fits
  //Now where to put it
  $text_x = $image_width/2.0 - $width_text/2.0;
  $text_y = $image_height/2.0 - $height_text/2.0;
  if ($left_text  0 )
  
  $text_x += abs($left_text); //Factor for left overhang
  $above_line_text = abs($bbox[7]); //How far above the baseline
  $text_y += $above_line_text; //Add baseline factor

  $text_y -= 2; //Adjustment factor for shape of our template
  $white = ImageColorAllocate($image, 0,0,255);

  ImageTTFText ($image, $font_size, 0, $text_x, $text_y, $white,
$fontname , $button_text);

  ImagePng($image);
  }
   ImageDestroy($image);
   ?
  
  
Thanks in advance for any assistance..

Regards
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379

All most men really want in life is a wife, a house, two kids and a car,
a cat, no maybe a dog.  Ummm, scratch one of the kids and add a dog.
Definitely a dog.


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



[PHP] Zend Gone missing

2003-05-30 Thread Chris Blake
Greetings learned PHP(eople),

I just downloaded and installed the Zend Studio trial package as I`m
tired of usign vim for all my PHP stuff, and during the install process
it asked if I wanted a shortcut/link placed on the desktop (Manrake 9.1
running here).

I said yep, and install finished.

Now I closed the app down but can`t find a way to start it up again. My
desktop contains no link.

Any ideas ?

Regards

Chris


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



Re: [PHP] Zend Gone missing

2003-05-30 Thread Chris Blake

Howdy David,

I also got this info from Zends`site, but can`t find the file to run.
I also checked around on their FAQ`s but found nothing related to my
problem.
I`ll send them mail to get it sorted, just thought someone knew
off-the-bat what to do.

Many thanks for replying, much appreciated.

Regards
Chris

On Fri, 2003-05-30 at 13:24, David Grant wrote:
 Chris Blake wrote:
  Any ideas ?
 
 From: http://www.zend.com/install_instruct.php:
 
 To start the ZDE (Zend Development Environment), run the zde in the 
 directory where you installed it (typically, /usr/local/Zend/bin)
 
 Looks like you'll have to create your own shortcut (advice on how to is 
 beyond the scope of this list).  Perhaps you should write them an e-mail 
 detailing your problems?
 
 Regards,
 
 David
 
 -- 
 David Grant
 Web Developer
 
 [EMAIL PROTECTED]
 http://www.wiredmedia.co.uk
 
 Tel: 0117 930 4365, Fax: 0870 169 7625
 
 Wired Media Ltd
 Registered Office: 43 Royal Park, Bristol, BS8 3AN
 Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD
 
 Company registration number: 4016744
 
 **
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the system manager.
 
 **
 


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



[PHP] Ximian Mail on PHP

2003-04-03 Thread Chris Blake
Greetings learned PHP(eople),

I want to create a PHP page that can pull all the messages from my
PHP-list inbox, and display them on the local intranet.

There are a few users who use PHP and I want to create a system where
they simply log into the intranet, and view the messages with related
answers. Rather than having three machines downloading 100`s of postings
per day from our mail server, I would like to make one point of access
for them.

Ximian stores messages locally in
../evolution/Local/Inbox/subfolders/PHP.there is one large file in
there with everything.

Is this a gigantic task, has anyone done this before, am I re-inventing
the wheel, barking up the wrong tree, or what ?

Where to start ?

-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
Linux vs. Windows is a no-WIN situation.


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



Re: [PHP] chill out

2003-04-02 Thread Chris Blake
My two cents,

I`ve  been on the list a month now and I think it`s really cool that
this type of thing exists.

I`m new to PHP, read all the posts that come through, and 98% of the
time don`t have a clue what is being spoken about, so the flaming and
other comments provide a welcome relief from my daily stress of working
this PHP thing out.

I learned the ins and outs of the list by reading all the posts, so I
guess this has helped me do my homework before simply requesting someone
give me an answer to a problem I could have solved simply by RTFM.

Anyone who can`t handle sarcasm.well.that`s another thing


On Thu, 2003-04-03 at 07:20, Jason Wong wrote:
 On Thursday 03 April 2003 11:14, [EMAIL PROTECTED] wrote:
 
  We subscribe to a few email lists on various languages.
 
  This list would have to be the worst for anyone learning
  - the amount of sarcasm and flaming that goes on is huge.
 
 Try subscribing to the qmail list for a day or two.
 
  Just try and remember - everyone has to learn,
 
 Exactly ...
 
  if you feel a question is off topic 
 
 ... that is why people need to learn that this list is for the discussion of 
 PHP and not HTML/Javascript/Whathaveyou.
 
  or stupid 
 
 Off-topic is pretty easy to define. 'Stupid' posts are more subjective, but 
 ...
 
 - ignore it,
 
 ... the OP usually feels the urge to repost and repost. In any case this list 
 is tolerant enough that people usually get the answer that they're looking 
 for.
 
  theres no need to make the poster feel like an idiot.
 
 If you feel like an idiot when someone points out something wrong with your 
 post then you have pretty low self-esteem.
 
  We all know your smarter than the rest of us ;-)
 
 I hope you don't think I'm making you stupid, but I think you mean you're.
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Tact in audacity is knowing how far you can go without going too far.
   -- Jean Cocteau
 */
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
Linux vs. Windows is a no-WIN situation.


 eggs.


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



Re: [PHP] PHP grep

2003-03-26 Thread Chris Blake
Ok...I checked php.ini and I`m not running safe mode..

I`ll take your advice and use fopen

Thanks for the help.

On Wed, 2003-03-26 at 14:31, David T-G wrote:
 Chris --
 
 Don't reply just to me; you're much more likely to get useful answers, or
 even answers at all, if you keep it on the mailing list!
 
 ...and then Chris Blake said...
 % 
 % Howdy David,
 
 Hiya!
 
 
 % 
 % Thanks for the reply
 
 Sure thing :-)
 
 
 % 
 % I`m totally new to this PHP stuffdefine running in safe mode.
 
 I don't know much about it, since my server runs without it.  It's not a
 bad idea, though.  It just tells php to be more cautious, which in turns
 sometimes prevents you from doing what you think you want to do.
 
 Check the manual; it's where I saw the comment that safe mode disables
 backticks (and, therefore, shell_exec).  You can still make a system()
 call, though.
 
 Meanwhile, why bother to use a call to grep at all?  Just fopen the file
 and match on its contents...
 
 
 % 
 % The only safe mode I knew of was under WindowsI`ve since converted
 
 Heh :-)
 
 
 % to Linuxis this a setting I need to change in php.ini ?
 
 Yep.  Look for
 
   safe_mode = ...
 
 to see how you're set.
 
 
 % 
 % Thanks for the help...
 
 Sure thing!
 
 
 HTH  HAND
 
 :-D
 -- 
 David T-G  * There is too much animal courage in 
 (play) [EMAIL PROTECTED] * society and not sufficient moral courage.
 (work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
 http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
 
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
A chicken is the eggs way of producing more eggs.


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



[PHP] Spooky numbers

2003-03-25 Thread Chris Blake
Greetings learned PHP(eople),

This is what my lines look like in my text file :

===
   Source : D:\
 Dest : E:\
Files : *.*
  Options : *.* /S /E /V /R:5 /W:5


When I run the following code it takes the lines above and places them
in an HTML table :


$source = `grep Source : logs/$file`;
$dest = `grep Dest : logs/$file`;
$criteria = `grep Files : logs/$file`;
$options = `grep Options : logs/$file`;


This is the output on the HTML file :

Source : F:\INETPUB\
Dest : D:\BACKUP\INETPUB\
Files : *.* Files : 12911 0 12911 0 0 0
Options : *.* /S /E /V /R:5 /W:5


Question is :

What are those numbers  that are inserted after the Files entry...and
how do I get rid of `em...?

Thanks for any assistance

-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
A chicken is the eggs way of producing more eggs.


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



[PHP] PHP grep

2003-03-25 Thread Chris Blake
Greetings learned PHP(eople)

I`m using the following to strip values out of a file, however, the file
I`m accessing contains multiple instance of the search criteria, and I
only wanna return the first instance
I`m just getting an empty variable and can`t figure it out...

$criteria = `grep Files : logs/$file`;

I`ve tried other things like 'grep --max-count=1 Files :...etc etc,
and that don`t work

Also tried shellexecarg (`grep blah blah blah);..still not working

Any ideas
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
A chicken is the eggs way of producing more eggs.


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



[PHP] PHP Books

2003-03-12 Thread Chris Blake
Greetings learned PHP(eople),

Can anyone offer comment on the following books on PHP.
I`m in the early stages of PHP and am looking for a suitable guide to
begin with.
=
Sams Teach Yourself PHP MYSQL and Apache in 24 Hours
Publisher:  Sams Publishing
ISBN:  067232489X
Publishing Date:  2003
Format:  Paperback
=
PHP BIBLE
Author:  Tim Converse
Publisher:  WILEY
ISBN:  0764549553
Pages:  875
Format:  Paperback
==
Beginner's Guides (Osborne): PHP 4: A Beginner's Guide
Author:  Bill McCarty and William McCarty
Publisher:  MCGRAW HILL
ISBN:  0072133716
Publishing Date:  2001
Pages:  544
Format:  Paperback


If anyone has used these manuals I would appreciate your input as I
don`t wanna spend a fortune on a manual and then find out it`s [EMAIL PROTECTED]
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
Your mouse has moved. Windows must be restarted for the change to take
effect. Reboot now? [ OK ]


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



RE: [PHP] Search for keyword in txt file

2003-03-12 Thread Chris Blake
Greetings,

Sorry for the delay in responding to your posting, I have been grappling
with your suggestion for a while and still things are not working out.

I have included all my code below and seek your advice..

As it stands, the resultant HTML page prints out the content of each
file, but it puts it all in the right table row, as opposed to splitting
it up for each row(file).also, my code, when viewed in vim, is all
in blue after inserting the $result string you gave me.
By taking out the * at the end of your statement, it reverts back to
showing things in the proper colours, but the page is blank with the
exception of the table formatting

I have tried a lot of different things with your code but am now ready
to start kicking the cat out of frustration.


===
?php

if ($handle = opendir('logs')) 

{
 echo Directory handle: $handle.'br';
 echo 'table border=1' ;
 echo 'tr';
 echo 'tdcenterbfont size=3 color=navyLog Files on
'.$HTTP_SERVER_VARS['HTTP_HOST'] .'/td/center/b/font';
 echo 'tdcenterbfont size=3
color=navyCreated/td/center/b/font';
 echo '/tr';

 {
 // Loop over the directory -
 while (false !== ($file = readdir($handle)))
 echo $file . 'br';
 $result= `grep -n Started logs/*` ;
 //Take out upper directory pointers 
 if ($file != . and $file != ..) 
 
 //Start filename insertion--
  {
  echo 'trtdfont size=2a href=/logs/'.$file.'' . $file .
'/td/font/a'.
  'td' . $result . 'br' . '/td';
  }

 }

 echo '/tr';
 echo '/table';
 closedir($handle); 
} 

   ?


Thanks for taking the time to assist on this one.

Chris

On Fri, 2003-03-07 at 12:38, Ernest E Vogelsinger wrote:
 At 11:36 07.03.2003, Chris Blake said:
 [snip]
 Ok, it`s not that easy..here`s my code...I wanna search all the
 files in the logs directory and for each file found I want it to
 search for the word started and print that line into a table row. 
 
 I will probably need to do like a for each loopbut where do I
 insert it ?
 [snip] 
 
 In case you're _not_ in safe mode:
 
 $result = `grep -n started logs/*`;
 
 
 -- 
O Ernest E. Vogelsinger
(\)ICQ #13394035
 ^ http://www.vogelsinger.at/
 
 
 
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
Your mouse has moved. Windows must be restarted for the change to take
effect. Reboot now? [ OK ]


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



Re: [PHP] PHP Books

2003-03-12 Thread Chris Blake
Thanks for the reply...I`ll be getting the one by Luke Flemming PHP 
MySQL

Late nights, here we come !!



On Wed, 2003-03-12 at 14:25, Chris Hewitt wrote:
 Petre Agenbag wrote:
 
 There is also a new book by Rasmus Lerdorf and it's cheaper than the
 book I mention, unfortunately I don't have insight into that book, and
 what would the guy that wrote PHP know about it anyway heh? ;p
 
 Its Programming PHP by Rasmus Lerdorf and Kevin Tatroe, O'Reilly, 
 March 2002, ISBN: 1-56592-610-2. Its the only PHP book I have so I can't 
 make a comparison, but I get on well with it and can recommend it.
 
 I also think the manual is good. It does take some searching through to 
 find things until you know what there is and where to find them. I 
 initially only used this, until I got Rasmus's book.
 
 I also learnt (am still learning) a lot by simply monitoring this list. 
 I have been able to avoid several pitfalls because of it so I recommend 
 continuing to stay on it.
 
 HTH
 Chris
 
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
Your mouse has moved. Windows must be restarted for the change to take
effect. Reboot now? [ OK ]


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



RE: [PHP] Search for keyword in txt file

2003-03-12 Thread Chris Blake
Re my earlier post...

I seem to have figured it out by changing the following lines :

//===
  {
  $result= `grep -n Started logs/$file` ;
  echo 'trtdfont size=2a href=/logs/'.$file.'' . $file .
'/td/font/a'.
  'td' . $result . '/td';
  }
//

Now it works the way it`s supposed to..



On Fri, 2003-03-07 at 12:38, Ernest E Vogelsinger wrote:
 At 11:36 07.03.2003, Chris Blake said:
 [snip]
 Ok, it`s not that easy..here`s my code...I wanna search all the
 files in the logs directory and for each file found I want it to
 search for the word started and print that line into a table row. 
 
 I will probably need to do like a for each loopbut where do I
 insert it ?
 [snip] 
 
 In case you're _not_ in safe mode:
 
 $result = `grep -n started logs/*`;
 
 
 -- 
O Ernest E. Vogelsinger
(\)ICQ #13394035
 ^ http://www.vogelsinger.at/
 
 
 
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
Your mouse has moved. Windows must be restarted for the change to take
effect. Reboot now? [ OK ]


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



[PHP] Search for keyword in txt file

2003-03-07 Thread Chris Blake
Greetings learned PHP(eople),

What is the best method to search a text file for a specific string and
return it to a form ?

I`m not looking for you guys (and gals) to give me the answer, just
point me in the right direction

So long and thanks for all the fish..


-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
Your mouse has moved. Windows must be restarted for the change to take
effect. Reboot now? [ OK ]


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



RE: [PHP] Search for keyword in txt file

2003-03-07 Thread Chris Blake
Ok, it`s not that easy..here`s my code...I wanna search all the
files in the logs directory and for each file found I want it to
search for the word started and print that line into a table row. 

I will probably need to do like a for each loopbut where do I
insert it ?

=== 
?php 

if ($handle = opendir('logs')) 

{ 
 echo Directory handle: $handle.'br'; 
 echo 'table border=1' ; 
 echo 'tr'; 
 echo 'tdcenterbfont size=3 color=navyLog Files on
'.$HTTP_SERVER_VARS['HTTP_HOST'] .'/td/center/b/font'; 
 echo 'tdcenterbfont size=3
color=navyCreated/td/center/b/font'; 
 echo '/tr'; 

 { 
 // Loop over the directory - 
 while (false !== ($file = readdir($handle))) 
 //Take out upper directory pointers first--- 
 if ($file != . and $file != ..) 
 
 //Start filename insertion-- 
  { 
  echo 'trtdfont size=2a href=/logs/'.$file.'' . $file .
'/td/font/a'. 
  'td' . '/td'; 
  } 

 } 

 echo '/tr'; 
 echo '/table'; 
 closedir($handle); 
} 

   ? 

===

Thanks

Chris

 
On Fri, 2003-03-07 at 11:21, Niklas Lampén wrote: 
 Dolphins are gone. ;)
 
 Here is your direction: preg_match(). If you need help with it (it can be
 compicated at first), ask. :)
 
 
 Niklas
 
 
 -Original Message-
 From: Chris Blake [mailto:[EMAIL PROTECTED] 
 Sent: 7. maaliskuuta 2003 11:16
 To: [EMAIL PROTECTED]
 Subject: [PHP] Search for keyword in txt file
 
 
 Greetings learned PHP(eople),
 
 What is the best method to search a text file for a specific string and
 return it to a form ?
 
 I`m not looking for you guys (and gals) to give me the answer, just point me
 in the right direction
 
 So long and thanks for all the fish..
 
 
 -- 
 Chris Blake
 Office : (011) 782-0840
 Cell : 083 985 0379
 Your mouse has moved. Windows must be restarted for the change to take
 effect. Reboot now? [ OK ]
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 ###
 This message has been scanned by F-Secure Anti-Virus for Internet Mail.
 For more information, connect to http://www.F-Secure.com/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
Your mouse has moved. Windows must be restarted for the change to take
effect. Reboot now? [ OK ]


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



[PHP] Text File open and display

2003-03-03 Thread Chris Blake
Greetings learned PHP(eople),

There have been a number of postings recently on opening and reading
files, and whilst I have read `em all I fail to make sense of it all.

Basicaly...I have a text file with entries in it...I wish to display the
contents of this file line by line in an HTML table :
At present all I get is a table with 1 row and all the text in it in a
large messy blob.
=
html
body

  ?php
   $handle = fopen(fopen.txt,r);
  
   echo 'table border=1'.\n;
   echo ' tr'.\n;
   echo '   td width=15%bFile Entries/b/td'.\n;
   echo ' /tr'.\n.\n;
   //
   //For each line in the file
   // while (fpassthru($handle));
   //{
   //Print them out to Table-
   echo 'tr'.\n;
   echo '   td width=15%font size=2';
   echo fpassthru($handle);
   echo '/td/tr'. \n;
   //}
   echo '/table';
   //fclose($handle);
  
  ?
  
  /body
  /html
=
I have commented out those lines which fail and am stuck as to what the
correct syntax should be. I have read up on nl2br,fgets and other posts
on php.net, but ..harump

Thanks 


-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
It is reported that somewhere in the world, every 15 seconds, a woman
gives birth to a child. She must be found and stopped.


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



RE: [PHP] Text File open and display

2003-03-03 Thread Chris Blake
Muchos grassy arse...works perfectly



On Mon, 2003-03-03 at 11:06, Niklas Lampén wrote:
 You get a file to an array of lines with file().
 
 Example:
 ?
 $myFile = file(text_file.txt);
 // Now $myFile is an array looking like
 // [0] = row 1;
 // [1] = row 2;
 // [2] = row 3;
 // .
 
 for ($i = 0; $i  count($myFile); $i++)
 {
   print Row .($i+1).: .$myFile[$i];
 };
 ?
 
 
 Niklas
 
 -Original Message-
 From: Chris Blake [mailto:[EMAIL PROTECTED] 
 Sent: 3. maaliskuuta 2003 10:58
 To: [EMAIL PROTECTED]
 Subject: [PHP] Text File open and display
 
 
 Greetings learned PHP(eople),
 
 There have been a number of postings recently on opening and reading files,
 and whilst I have read `em all I fail to make sense of it all.
 
 Basicaly...I have a text file with entries in it...I wish to display the
 contents of this file line by line in an HTML table : At present all I get
 is a table with 1 row and all the text in it in a large messy blob.
 =
 html
 body
 
   ?php
$handle = fopen(fopen.txt,r);
   
echo 'table border=1'.\n;
echo ' tr'.\n;
echo '   td width=15%bFile Entries/b/td'.\n;
echo ' /tr'.\n.\n;
//
//For each line in the file
// while (fpassthru($handle));
//{
//Print them out to Table-
echo 'tr'.\n;
echo '   td width=15%font size=2';
echo fpassthru($handle);
echo '/td/tr'. \n;
//}
echo '/table';
//fclose($handle);
   
   ?
   
   /body
   /html
 =
 I have commented out those lines which fail and am stuck as to what the
 correct syntax should be. I have read up on nl2br,fgets and other posts on
 php.net, but ..harump
 
 Thanks 
 
 
 -- 
 Chris Blake
 Office : (011) 782-0840
 Cell : 083 985 0379
 It is reported that somewhere in the world, every 15 seconds, a woman gives
 birth to a child. She must be found and stopped.
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 ###
 This message has been scanned by F-Secure Anti-Virus for Internet Mail. For
 more information, connect to http://www.F-Secure.com/
 
 ###
 This message has been scanned by F-Secure Anti-Virus for Internet Mail.
 For more information, connect to http://www.F-Secure.com/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
It is reported that somewhere in the world, every 15 seconds, a woman
gives birth to a child. She must be found and stopped.


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



[PHP] IP Addesses on local network

2003-03-03 Thread Chris Blake
Greetings,

Th command 

echo gethostbyaddr(ip.number.inserted.here); 

returns the name of the server when it`s an internet address.
Is there a similar command that will return host names on a local
network

I tried using the above command putting in a LAN address, but it just
returned the IP address.

-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
It is reported that somewhere in the world, every 15 seconds, a woman
gives birth to a child. She must be found and stopped.


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



[PHP] Reading files

2003-02-27 Thread Chris Blake
Greetings...

When the following runs..
===
?php

 $handle = fopen (fopen.txt, r);
 $date = date(l dS of F Y h:i:s: A);

   while (!feof ($handle)) ;
   {
 $buffer = fgets($handle, 4096);
 echo 'textarea'. $buffer. '/textarea';
  
  }
   fclose($handle);
  ?


.it gives out



Fatal error: Maximum execution time of 30 seconds exceeded in
/home/data/ClientWebs/chrisplay/Things/fopen.php on line 16


I used the example from php.net/fget() and have tried a few changes
based on other stuff I read, but to no avail.

Line 16 is =while (!feof ($handle)) ;   

Suggestions ?


-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
It is reported that somewhere in the world, every 15 seconds, a woman
gives birth to a child. She must be found and stopped.


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



[PHP] fopen woes....

2003-02-24 Thread Chris Blake
Greetings,

According to PHP manual example this is supposed to open a file and
write a line of text to itbut it doesn`t.
===
html
head
titleFile Open/title
/head

body
?php

$handle = fopen (/home/data/ClientWebs/chrisplay/Things/fopen.txt,
rw);
fwrite($handle, Hello there!);
fclose($handle);


?

/body
/html


But my text file is blank..some of the other code samples I looked
at on www.php.net/fopen don`t provide specific help..


-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
It is reported that somewhere in the world, every 15 seconds, a woman
gives birth to a child. She must be found and stopped.


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



[PHP] Passing info to forms

2003-02-19 Thread Chris Blake
Greetings all,

Whenever I run the code below, it bombs out with error


Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in /home/data/ClientWebs/chrisplay/CustAmend.php on line
15
=

Basically, I am trying to pass info from an array from a previous page,
where $row['ClientID'] is one of the fields I want to populate my page
with...here`s the code for the whole page ..

===

?php
  //Create SQL to get Client Info
  $sSQLGetClient = Select * FROM Client  .
  $sSQLGetClient = where ClientID =  . '$row['ClientID']' ;
  
  $ResGetClient = mysql_query($sSQLGetClient);
  if (!$ResGetClient) {
echo(PError performing query:  . mysql_error() .
/P);
  exit();
   }

  $row = mysql_fetch_array($ResGetClient);
  
  ?

===

5 days into PHP so this stuff is all new...perhaps I`m missing the boat
totally. I visited PHP.com and phpfreaks but couldn`t find info on
passing variables between forms.

Thanks in advance for any assistance.

-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
It is reported that somewhere in the world, every 15 seconds, a woman
gives birth to a child. She must be found and stopped.


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




[PHP] Array not working

2003-02-17 Thread Chris Blake
Greetings all,

My database has one table with three fields i.e. ClientID, ClientName
and Distance .

I`m trying to get all the field data printed to a form but whenever I
try to add the ClientID and Distance fields to the code below it
bombs out with the following error :

Parse error: parse error in /home/data/ClientWebs/chrisplay/main.php on
line 27

Full code is below :

?php
  //Connect to DB  
  include(inc_ConnectDB.php) ;

  //Make SQL Statement
  $SqlGetClient = Select * from Client ;
  $ResGetClient = mysql_query($SqlGetClient) ;


  //If any errors then print `em out
  if (!$ResGetClient)
   {
   echo(PError performing query:  . mysql_error() . /P);
 exit();
   }

  //While there are records to fetch.
  while ( $row = mysql_fetch_array($ResGetClient) )
  {
   //  THIS IS LINE 27
  //print them out to page
  echo $row['ClientID'].['ClientName'].['Distance']. 'hr';
  } 
?  

Muchos grassy-arse for any assistance.. 


-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
It is reported that somewhere in the world, every 15 seconds, a woman
gives birth to a child. She must be found and stopped.


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