Re: [PHP] looking for a good FormMail PHP script

2004-08-14 Thread raditha dissanayake
Juan Nin wrote:
Hi
I'm looking for a good FormMail PHP script which beheaves like Matt 
Wright's FormMail.pl script (but lacks it's exploitable problems :)

I found several on the net, but didn't like them too much...
any recommendations?
you have obviously not looked at the PHP manual.
--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Getting the size of a mysql table using php

2004-08-14 Thread Brent Clements
How does one get the size of a mysql table using php? I tried taking a look at how 
phpmyadmin does it but got lost in the code. Anyone have any simple or elegant ways of 
doing this?

-Thanks
Brent

Re: [PHP] Getting the size of a mysql table using php

2004-08-14 Thread Greg Donald
On Sat, 14 Aug 2004 01:52:31 -0500, Brent Clements
[EMAIL PROTECTED] wrote:
 How does one get the size of a mysql table using php? I tried taking a look at how 
 phpmyadmin does it but got lost in the code. Anyone have any simple or elegant ways 
 of doing this?


show table status like 'table_name';

size = Data_length + Index_length


-- 
Greg Donald
http://destiney.com/

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



[PHP] Open all subdirectories in a directory

2004-08-14 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hello Professionals,
Can anybody help me to open all subdirectories in a directory,
I used is_dir() to check whether it is a dir, and if yes,
I recursively called it with the new dir name.
But  all subdirectories are not open the recursion is not working for more
than 1 level.
I tested it in windows server.
Expecting your help,
Jacob.

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



[PHP] Open all subdirectories in a directory

2004-08-14 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hello Professionals,
Can anybody help me to open all subdirectories in a directory,
I used is_dir() to check whether it is a dir, and if yes,
I recursively called it with the new dir name.
But  all subdirectories are not open the recursion is not working for more
than 1 level.
I tested it in windows server.
Expecting your help,
Jacob.

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



[PHP] Open all subdirectories in a directory

2004-08-14 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hello Professionals,
Can anybody help me to open all subdirectories in a directory,
I used is_dir() to check whether it is a dir, and if yes,
I recursively called it with the new dir name.
But  all subdirectories are not open the recursion is not working for more
than 1 level.
I tested it in windows server.
Expecting your help,
Jacob.

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



[PHP] Re: Open all subdirectories in a directory

2004-08-14 Thread Hannes Magnusson

On 14 Aug 2004 12:52:12 -
[EMAIL PROTECTED] (Phpdiscuss - Php Newsgroups And Mailing Lists) wrote:

 Hello Professionals,
 Can anybody help me to open all subdirectories in a directory,
 I used is_dir() to check whether it is a dir, and if yes,
 I recursively called it with the new dir name.
 But  all subdirectories are not open the recursion is not working for more
 than 1 level.
Try to call is_dir() with full/path/to/dir ( realpath() may come in handy ) and/or 
chdir() to the dir.

 I tested it in windows server.
 Expecting your help,
 Jacob.

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



Re: [PHP] Open all subdirectories in a directory

2004-08-14 Thread John Holmes
PHPDiscuss - PHP Newsgroups and mailing lists wrote:
Hello Professionals,
Can anybody help me to open all subdirectories in a directory,
I used is_dir() to check whether it is a dir, and if yes,
I recursively called it with the new dir name.
But  all subdirectories are not open the recursion is not working for more
than 1 level.
I tested it in windows server.
Expecting your help,
Expecting your code...
Have you looked at the opendir manual page to see if there are any 
examples, there?

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: str_replace - is it case sensitive

2004-08-14 Thread Hannes Magnusson
On Sat, 14 Aug 2004 14:37:09 +0100
[EMAIL PROTECTED] (Andrew W) wrote:

 Is the str_replace function case sensitive, I cant seem to find any 
 answer on the PHP manual website or in my books.
Yes. For case in-sensitve use str_ireplace
Look at the PHP manual one more time under See also

 
 If it is, is there anyway to make it case insensitive so it can handle 
 mIxEd CaSe woRdS in any combination?
 
 Thanks
 AW

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



[PHP] php die function for MySQL connection errors

2004-08-14 Thread John Gostick
Hi,

I have a quick question about using the PHP die() function. I'm building a
site around a MySQL database, and when I connect to the database from a PHP
page I use the following code:




  $connection = mysql_connect($host, $user, $password)
   or  die(Error connecting to SQL server);
  $db = mysql_select_db($database, $connection)
   or die('Error connecting to database);



Simple enough so far right? So if there is a problem connecting in anyway,
an error message appears. What I want though is to redirect to a properly
separate error page, rather than just have a basic text mesage.



I changed the code to this:



  $connection = mysql_connect($host, $user, $password)
   or die(Error connecting to SQL server);
  $db = mysql_select_db($database, $connection)
   or header('Location: ../errors/databaseselect.php');



Which works fine (tested by deliberately misnaming database so it can't find
it).


However if I then use the same approach for the server connection error,
like below, it doesn't work.


  $connection = mysql_connect($host, $user, $password)
   or header('Location: ../errors/servererror.php');
  $db = mysql_select_db($database, $connection)
   or header('Location: ../errors/databaseselect.php');

I get a variety of error messages dependant on what I tweek to try and make
it work. I've tried all I can think of, and I've tried putting the header
function inside a die function to no avail. I don't understand why it works
for the database connect error but not the server error.

If anyone has any suggestions as to what the problem is or how I could
improve my technique I'd love to know. I'm sure I can't be the only person
who has wanted to do something like this, but I can't find any references
online to anything other than simple text error messages. I'm relatively new
to PHP but not programming in general so please don't be afraid to fire big
words at me.




Thanks in advance!

John G


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



[PHP] Problem with submit form if type is image

2004-08-14 Thread fkeessen
Dear all,

Can you please help me with the following?

I have written the following script: If i have a input type image; the script doesn't 
go to the prospect2.php. If i have a input type=submit everything works super! Can 
someone help me?

Frank
_
?
$_POST[submit]=isset($_POST[submit])?$_POST[submit]:;
if($_POST['submit']!=)
{
//$printresse=$_POST['printresse'];
session_start();
$_SESSION[printresse] = $_POST['printresse'];
header(Location: prospect2.php);
exit;
}
?
html
body
form name=form1 method=post id=form1 enctype=multipart/form-data 
action=?=$_SERVER['PHP_SELF']?
select name=printresse
OPTIONValue1/OPTION
OPTIONValue2/OPTION
/SELECT
?
echotd align=\right\input type=\image\ src=\images/next_button.jpg\ 
name=\submit\ value=\submit\/td/tr;
?
/form

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



Re: [PHP] php die function for MySQL connection errors

2004-08-14 Thread raditha dissanayake
John Gostick wrote:
Hi,
I have a quick question about using the PHP die() function. I'm building a
site around a MySQL database, and when I connect to the database from a PHP
page I use the following code:

 $connection = mysql_connect($host, $user, $password)
  or  die(Error connecting to SQL server);
 $db = mysql_select_db($database, $connection)
  or die('Error connecting to database);
 

you haven't told us what error messages you are getting - however my 
guess is that your header() call fails because of the error message 
produced by mysql_connect() if so you can try @mysql_connect($host, 
$user, $password) instead so that error messages to browser are 
suppressed ( you can achieve the same by editing your php.in)

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] dropdown box displays empty rule

2004-08-14 Thread fkeessen
Dear all,

Can you have a look at the following problem;

If the value $selected is filled with a value it must be matched against 
$rowu-naamreis. If it's matching then it must be the SELECTED value in the drop down 
box..
The problem is that it displays now a blank rule..

while($rowu=mysql_fetch_object($result1)){
echo option value=\$rowu-naamreis\;
if ($selected==$rowu-naamreis) 
echo option selected value=\;
echo $rowu-naamreis/option\\n;

Someone can help?

Frank

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



RE: [PHP] String compare of 7 text strings

2004-08-14 Thread Ford, Mike [LSS]
-Original Message-
From: Brent Clements
To: [EMAIL PROTECTED]

I wanted to see if anyone has an easier way to do this. The end result
is this: I need to compare 7 different text strings(which are in an
array). They should all be the same, if they are not the same, a message
should be outputted saying they weren't.

How would one do this outside of using a huge if/then statement?

---

Two approaches come to mind off the top of my head:

  $values = array_count_values($array);

  if (count($values)1):
// there's more than one unique value in the array
  endif;

or...

  $value = $array[0];
  for ($i=1; $i7; ++$i):
if ($array[$i]!= $value):
  // this value doesn't match
  break;
endif;
  endfor;

Cheers!

Mike

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



RE: [PHP] php die function for MySQL connection errors

2004-08-14 Thread Ford, Mike [LSS]
 -Original Message-
 From: John Gostick
 Sent: 14/08/04 15:19

 I have a quick question about using the PHP die() function. 

[...]

 I changed the code to this:
 
   $connection = mysql_connect($host, $user, $password)
or die(Error connecting to SQL server);
   $db = mysql_select_db($database, $connection)
or header('Location: ../errors/databaseselect.php');
 
 Which works fine (tested by deliberately misnaming database so it can't
find it).
 
 However if I then use the same approach for the server connection error,
 like below, it doesn't work.
 
 
   $connection = mysql_connect($host, $user, $password)
or header('Location: ../errors/servererror.php');

On failure, this causes the header to be sent, but doesn't actually stop execution of 
your script, so...

   $db = mysql_select_db($database, $connection)

this will now fail because you don't have a valid $connection.

or header('Location: ../errors/databaseselect.php');

The bottom line is, whenever you issue a header(Location: ) call, you also need 
to cause the script to die if your logic demands that -- so the above should be 
written something like:

  if (!$connection = mysql_connect($host, $user, $password)):
header('Location: ../errors/servererror.php');
die();
  endif;

  if (!$db = mysql_select_db($database, $connection)):
header('Location: ../errors/databaseselect.php');
die();
  endif;

(And, BTW, the HTTP definition says that the Location: header should specify a full 
absolute URL, so that should be:

  header(Location: http://your.server.name/path/to/errors/servererror.php;);

etc.)

Cheers!

Mike

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



[PHP] code

2004-08-14 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Codes attached.
In this page i used filetype instead of is_dir.


?php
$dir = jdkcoders/;
function getfiles($dir)
 {
 if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false)
 {  if($file!='.'  $file!='..')
{
if(filetype($dir . $file)=='dir')
{
getfiles($dir./.$file);
}  
 
else
{

echo br$file;  
 

}
}
 }
closedir($dh);
 }
}
  }
getfiles($dir);
?


Hope you can help me.
Thanks.




John Holmes wrote:

 PHPDiscuss - PHP Newsgroups and mailing lists wrote:
  Hello Professionals,
  Can anybody help me to open all subdirectories in a directory,
  I used is_dir() to check whether it is a dir, and if yes,
  I recursively called it with the new dir name.
  But  all subdirectories are not open the recursion is not working for more
  than 1 level.
  I tested it in windows server.
  Expecting your help,

 Expecting your code...

 Have you looked at the opendir manual page to see if there are any 
 examples, there?

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



Re: [PHP] php die function for MySQL connection errors

2004-08-14 Thread raditha dissanayake
Ford, Mike [LSS] wrote:
(And, BTW, the HTTP definition says that the Location: header should specify a 
full absolute URL, so that should be:
 header(Location: http://your.server.name/path/to/errors/servererror.php;);
 

are you sure?
 


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] String compare of 7 text strings

2004-08-14 Thread Hannes Magnusson
if ( count ( array_unique ( $array ) ) == 1 ) {
 // all fields have the same value
}
we could post solution to this problem for ever...
- Hannes

On Sat, 14 Aug 2004 15:24:03 +0100
[EMAIL PROTECTED] (Mike Ford) wrote:

 -Original Message-
 From: Brent Clements
 To: [EMAIL PROTECTED]
 
 I wanted to see if anyone has an easier way to do this. The end result
 is this: I need to compare 7 different text strings(which are in an
 array). They should all be the same, if they are not the same, a message
 should be outputted saying they weren't.
 
 How would one do this outside of using a huge if/then statement?
 
 ---
 
 Two approaches come to mind off the top of my head:
 
   $values = array_count_values($array);
 
   if (count($values)1):
 // there's more than one unique value in the array
   endif;
 
 or...
 
   $value = $array[0];
   for ($i=1; $i7; ++$i):
 if ($array[$i]!= $value):
   // this value doesn't match
   break;
 endif;
   endfor;
 
 Cheers!
 
 Mike

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



[PHP] Re: dropdown box displays empty rule

2004-08-14 Thread Kim Steinhaug
Well, seems you have some confusing logic here, since you
print out the option before you check if it should be checked.
To top it off, when its accually checked you write out an empty
value, which really doesnt make any sence at all.

A quick rewite would be :

while($rowu=mysql_fetch_object($result1)){
  if ($selected==$rowu-naamreis)
 echo option SELECTED value=\$rowu-naamreis\ . $rowu-naamreis .
/option\n ;
  else
 echo option value=\$rowu-naamreis\ .
$rowu-naamreis . /option\n ;
}

-- 
Kim Steinhaug
-
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
-
www.steinhaug.com - www.easywebshop.no - www.easycms.no - www.webkitpro.com
-

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



[PHP] phpMyAdmin equivalent

2004-08-14 Thread Watty
Does anyone know of a program equivalent to phpMyAdmin for managing
PostgreSQL databases?
 
Watty


Re: [PHP] phpMyAdmin equivalent

2004-08-14 Thread raditha dissanayake
Watty wrote:
Does anyone know of a program equivalent to phpMyAdmin for managing
PostgreSQL databases?
Watty
 

bet you didn't google for phppgadmin
--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Using Post like Get

2004-08-14 Thread Kim Steinhaug
Since you are on the same server, I hope you mean the same domain.
If not the session variable wouldnt work very well.

But if you infact are on the same domain, you should look into the session
variable and store everything you need. From what I know there are now
limits on how much you can store in a session, that said I wouldt pump
several megabytes into it...

Several good answers here, but it looks like most of us agree on the
session.
Cookies can ofcourse also be used, but this also means that you require all
your clients to have them enabled. Anyways, even when using cookies I
always use session as the main system - cookies only works as a
saved session in my systems. (Meaning, instead of having to logg onto
the system again, the username and passowrd are stored in a cookie, this
way the user can choose the famous remember me setting many of us enjoy).

-- 
Kim Steinhaug
-
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
-
www.steinhaug.com - www.easywebshop.no - www.easycms.no www.webkitpro.com
-


Dennis Gearon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 What I'm trying to achieve is to have the same cookie IDENTIFY a user on
 different (or same) applications (on the same server), but require them
 to log in for each application, and get a different session.. Basically,
 to keep separate 'user trails and in process variables' for different
 tabs or windows in a browser.

 www.scotttrade.com does it somehow, and I see no GET variables on the URL.

 John W. Holmes wrote:

  Dennis Gearon wrote:
 
  With get varaibles, it's possible to always have get variables on a
  page, even without a form, by simply appending the Get variables to
  the end of the URL.
 
  Is there anyway to do the same with Post variables? For instance, a
  javascript that onUnload submit, or something?
 
 
  You can't just include POST variables in a link, if that's what you're
  going for. Perhaps some clunky javascript submitting a hidden form on
  an onclick method would get you close, but why even bother?
 
  Maybe you should just say what you're actually trying to achieve and
  why, then we could offer better alternatives.
 

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



RE: [PHP] phpMyAdmin equivalent

2004-08-14 Thread Watty
You can't google for something you don't know about ;)

Thanks for that, looks exactly what I was looking for

Watty

 -Original Message-
 From: raditha dissanayake [mailto:[EMAIL PROTECTED]
 Sent: 14 August 2004 16:29
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] phpMyAdmin equivalent
 
 Watty wrote:
 
 Does anyone know of a program equivalent to phpMyAdmin for managing
 PostgreSQL databases?
 
 Watty
 
 
 bet you didn't google for phppgadmin
 
 
 --
 Raditha Dissanayake.


 http://www.radinks.com/sftp/ |
http://www.raditha.com/megaupload
 Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
 Graphical User Inteface. Just 128 KB | with progress bar.
 
 --
 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] String compare of 7 text strings

2004-08-14 Thread Kim Steinhaug
* Ed Lazor wrote :
 Nice solution =)

My thoughts exatly, :D

-- 
Kim Steinhaug
-
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
-
www.steinhaug.com - www.easywebshop.no - www.easycms.no www.webkitpro.com
-

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



[PHP] Re: Problem with submit form if type is image

2004-08-14 Thread Torsten Roehr
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Dear all,

 Can you please help me with the following?

 I have written the following script: If i have a input type image; the
script doesn't go to the prospect2.php. If i have a input type=submit
everything works super! Can someone help me?

 Frank


_
 ?
 $_POST[submit]=isset($_POST[submit])?$_POST[submit]:;
 if($_POST['submit']!=)
 {
 file://$printresse=$_POST['printresse'];
 session_start();
 $_SESSION[printresse] = $_POST['printresse'];
 header(Location: prospect2.php);
 exit;
 }
 ?
 html
 body
 form name=form1 method=post id=form1 enctype=multipart/form-data
action=?=$_SERVER['PHP_SELF']?
 select name=printresse
 OPTIONValue1/OPTION
 OPTIONValue2/OPTION
 /SELECT
 ?
 echotd align=\right\input type=\image\
src=\images/next_button.jpg\ name=\submit\ value=\submit\/td/tr;
 ?
 /form

Hi,

if you use the input type 'image' you have to check for name_x or name_y, so
in your case:
$_POST['submit'] = isset($_POST['submit']) ? $_POST['submit_x'] : '';

Whenever you have problems like this do a print_r($_POST) at the top of the
second page. This will show you all submitted values.

Regards, Torsten Roehr

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



Re: [PHP] phpMyAdmin equivalent

2004-08-14 Thread Curt Zirzow
* Thus wrote Watty:
 You can't google for something you don't know about ;)

Haven't you heard? Google has ESP and can read your mind..

You just have to keep thinking this phrase:

  Google: phpMyAdmin PostgreSQL equivalent



Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



[PHP] RE: [PHP-DB] How to create a new Table in prostgresql from a Webinterface

2004-08-14 Thread Watty
Try phppgadmin

 -Original Message-
 From: Michelle Konzack [mailto:[EMAIL PROTECTED]
 Sent: 14 August 2004 16:32
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] How to create a new Table in prostgresql from a
 Webinterface
 
 Hello,
 
 Never I have done this before (no need) but now I need to create a
 new table with some colums from a Webinterface and do not know how
 to do that.
 
 Please can anyone point me into the right direction ?
 
 Thanks, Greetings
 and nice Weekend
 Michelle
 
 --
 Linux-User #280138 with the Linux Counter, http://counter.li.org/
 Michelle Konzack   Apt. 917  ICQ #328449886
50, rue de Soultz MSM LinuxMichi
 0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)

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



Re: [PHP] phpMyAdmin equivalent

2004-08-14 Thread Jason Wong
On Saturday 14 August 2004 23:25, Watty wrote:

 You can't google for something you don't know about ;)

Surely it would have crossed your mind to check on the postgresql site?

-- 
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
--
/*
Pascal is not a high-level language.
-- Steven Feiner
*/

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



RE: [PHP] phpMyAdmin equivalent

2004-08-14 Thread Watty
I'm an ignorant human being :|

Watty

 -Original Message-
 From: Jason Wong [mailto:[EMAIL PROTECTED]
 Sent: 14 August 2004 17:11
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] phpMyAdmin equivalent
 
 On Saturday 14 August 2004 23:25, Watty wrote:
 
  You can't google for something you don't know about ;)
 
 Surely it would have crossed your mind to check on the postgresql
site?
 
 --
 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
 --
 /*
 Pascal is not a high-level language.
   -- Steven Feiner
 */
 
 --
 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] String compare of 7 text strings

2004-08-14 Thread Jason Wong
On Saturday 14 August 2004 23:12, Hannes Magnusson wrote:
 if ( count ( array_unique ( $array ) ) == 1 ) {
  // all fields have the same value
 }
 we could post solution to this problem for ever...

Indeed:

  if (count(array_flip($doo))  1) { // not same }

-- 
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
--
/*
One difference between a man and a machine is that a machine is quiet
when well oiled.
*/

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



[PHP] Re: [PHP-DB] How to create a new Table in prostgresql from a Webinterface

2004-08-14 Thread Michelle Konzack
Hello Watty, 

Am 2004-08-14 17:05:28, schrieb Watty:
 Try phppgadmin

No, because it is my own Webinterface to a Program...


Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/ 
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


[PHP] [PHP-General List] - Cron or script like Cron -

2004-08-14 Thread francesco[AT]automationsoft[DOT]biz
Hi all,
I have a script that generate a benchmark report, in *.csv, every day.
I want to have the possibility to send me this report every day at the same time, 
during night, i.e. at the 03.00 am. I know that there is Cron that give me the 
possibility to do this, but I'm not the server manager and I cannot use Cron. I find a 
good alternative script, called Pseudo-Cron, but it runs only when the page that 
contains script is called.
There is a script that have the same function of Cron but is only php, or there is 
another way to call Cron or anyother way to use Cron?
All helps are very appreciated.
Thank's all.
Francesco
[EMAIL PROTECTED]


RE: [PHP] [PHP-General List] - Cron or script like Cron -

2004-08-14 Thread Watty
Add the functionality to the script that runs the benchmark.

Watty

 -Original Message-
 From: francesco[AT]automationsoft[DOT]biz
 [mailto:[EMAIL PROTECTED]
 Sent: 14 August 2004 17:34
 To: PHP General List
 Subject: [PHP] [PHP-General List] - Cron or script like Cron -
 
 Hi all,
 I have a script that generate a benchmark report, in *.csv, every day.
 I want to have the possibility to send me this report every day at the
 same time, during night, i.e. at the 03.00 am. I know that there is
Cron
 that give me the possibility to do this, but I'm not the server
manager
 and I cannot use Cron. I find a good alternative script, called
Pseudo-
 Cron, but it runs only when the page that contains script is called.
 There is a script that have the same function of Cron but is only php,
or
 there is another way to call Cron or anyother way to use Cron?
 All helps are very appreciated.
 Thank's all.
 Francesco
 [EMAIL PROTECTED]

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



RE: [PHP] php+iptables

2004-08-14 Thread Ed Lazor
You might want to do a search for PHP Firewall and look at the other
projects already out there.

http://phpfwgen.sourceforge.net/


 -Original Message-
 From: Joel n.solanki [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 13, 2004 9:53 PM
 To: Robby Russell
 Cc: php-users
 Subject: Re: [PHP] php+iptables
 
 Great ..I will surely do what u told me. This really sounds good to work
 on.
 I will start implementing this in 1 or 2 days. Can i contact youi
 personally if i need little help ?
 
 Regards and thank for your help
 
 Joel
 On Thu, 2004-08-12 at 21:20, Robby Russell wrote:
  On Thu, 2004-08-12 at 01:31, Joel n.solanki wrote:
   Dear all Gurus,
  
   I have read little manul from www.php.net
   I want to create web based firewall with php+iptables . Can any one
 give
   me some documentation or guides or Examples ??I am using redhat linux
   ..all things are installed.
   I have little understood that i need to use shell_exec and exec to run
   linux command. I am very newbie to php even dont know html so i m
 having
   tough days with php.
   if any one could help me out.
   any docs.
 
  Unlike the other responses, I'll give you a different approach.
 
  Are you attempting to build a web based 'interface' to iptables? So you
  can add/edit/drop rules for iptables?
 
  If I were to build such an app, this is how I would build it.
 
  I would build 3 layers to this app.
 
  - a database (postgresql or mysql)
- store all your rules, comments, timestamps, etc
 
  - web based interface
- an interface that allows you to add, edit, modify the data in the
  database
- give this interface only the necessary ability to do this, nothing
  more so that your firewall configuration remains fairly secure.
 
  - cron script
- a script on the server (written in php, perl, python, whatever)
- performs a lookup in the database and checks for any new changes
  since its last run
- gets the changes and builds the necessary iptables configuration
  script and writes to a file on the server.
- add a row that records when you did this so that next time you know
  when to look for new records from.
 
  You *could* use exec here to run iptables or you could have another cron
  script that is just a bash script that runs the iptables config file
  that you write with the cron script.
 
  This is how *I* would approach this. This allows for flexibility of each
  piece of the code. For example, one day you might want to pick up python
  and build a cross platform GUI application that will allow you to manage
  the rules like you did in the web interface. If this might even be the
  case then you might want to consider PostgreSQL and building your
  database structure and building server side functions (plperl, plPHP,
  etc) that allow you to perform simple queries to add/edit/modify data.
 
  example: SELECT blockIP('192.168.1.100');
 
  ...is a little cleaner than:
INSERT INTO tablename (ip_address, block) VALUES ('192.168.1.100', t);
 
  This way all your system logic is stored in your database schema and not
  in your code. Then a new interface is a breeze to develop and deply.
 
  Once again, this is just one approach and might seem like more work but
  after doing this kind of thing for the last several years I'm growing
  weary of typing the same logic over and over to new interfaces. heh.
 
 
  Happy coding!
 
  your local PostgreSQL advocate,
 
  Robby Russell
 --
 Joel N.Solanki
 Network Administrator
 Phone No: 0265-550001/2/3/4/5 Ext: 211/212
 Digtial 2 Virtual Internet Service Provider.
 http://www.packetraptor.com/
 http://www.d2visp.com/
 Gujarat (India)
 
 --
 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] String compare of 7 text strings

2004-08-14 Thread Hannes Magnusson
if ( count ( array_diff ( $array, array ( $array[0] ) )  0 ) { // not same }

On Sun, 15 Aug 2004 00:24:30 +0800
[EMAIL PROTECTED] (Jason Wong) wrote:

 On Saturday 14 August 2004 23:12, Hannes Magnusson wrote:
  if ( count ( array_unique ( $array ) ) == 1 ) {
   // all fields have the same value
  }
  we could post solution to this problem for ever...
 
 Indeed:
 
   if (count(array_flip($doo))  1) { // not same }
 
 -- 
 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
 --
 /*
 One difference between a man and a machine is that a machine is quiet
 when well oiled.
 */

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



[PHP] Re: [PHP-General List] - Cron or script like Cron -

2004-08-14 Thread Hannes Magnusson
run cron via httpd user? i.e. 
  fputs STDIN crontab -e blablabla

- Hannes

On Sat, 14 Aug 2004 18:34:10 +0200
[EMAIL PROTECTED] (FrancescoAutomationsoftBiz) wrote:

 Hi all,
 I have a script that generate a benchmark report, in *.csv, every day.
 I want to have the possibility to send me this report every day at the same time, 
 during night, i.e. at the 03.00 am. I know that there is Cron that give me the 
 possibility to do this, but I'm not the server manager and I cannot use Cron. I find 
 a good alternative script, called Pseudo-Cron, but it runs only when the page that 
 contains script is called.
 There is a script that have the same function of Cron but is only php, or there is 
 another way to call Cron or anyother way to use Cron?
 All helps are very appreciated.
 Thank's all.
 Francesco
 [EMAIL PROTECTED]
 

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



[PHP] Re: [PHP-General List] - Cron or script like Cron -

2004-08-14 Thread Hannes Magnusson
Don't mail me directly, no good comes from that.

Anyway, see my answear below.
 -Hannes

From: francesco[AT]automationsoft[DOT]biz [EMAIL PROTECTED]
To: Hannes Magnusson [EMAIL PROTECTED]
Subject: Re: [PHP] Re: [PHP-General List] - Cron or script like Cron -
Date: Sat, 14 Aug 2004 19:03:02 +0200
X-Mailer: Microsoft Outlook Express 6.00.2800.1106

Hi Hannes,
I'm not sure that I understand your solution.
Can explain me well?
Thank's

 run cron via httpd user? i.e.
   fputs STDIN crontab -e blablabla
can't doit via fputs, was just trying to put in your head some ideas how to do this.
can problibly do something like shell_exec ( 'echo YourNewCronjob  
/path/to/nobody/crontab' );

This doesnt have alot todo with php thou.

 - Hannes

 On Sat, 14 Aug 2004 18:34:10 +0200
 [EMAIL PROTECTED] (FrancescoAutomationsoftBiz) wrote:

  Hi all,
  I have a script that generate a benchmark report, in *.csv, every day.
  I want to have the possibility to send me this report every day at the
same time, during night, i.e. at the 03.00 am. I know that there is Cron
that give me the possibility to do this, but I'm not the server manager and
I cannot use Cron. I find a good alternative script, called Pseudo-Cron, but
it runs only when the page that contains script is called.
  There is a script that have the same function of Cron but is only php,
or there is another way to call Cron or anyother way to use Cron?
  All helps are very appreciated.
  Thank's all.
  Francesco
  [EMAIL PROTECTED]
 

 --
 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] Re: [PHP-DB] How to create a new Table in prostgresql from a Webinterface

2004-08-14 Thread Jason Wong
On Sunday 15 August 2004 00:38, Michelle Konzack wrote:

 Am 2004-08-14 17:05:28, schrieb Watty:
  Try phppgadmin

 No, because it is my own Webinterface to a Program...

What exactly is it that you need help with? Syntax for creating tables are 
covered in the postgresql manual. If you're really new to this sort of thing 
then checkout some tutorials. If you're relatively experienced then studying 
the phppgadmin's (or whatever) code should help you a great deal.

-- 
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
--
/*
The entire CHINESE WOMEN'S VOLLEYBALL TEAM all share ONE personality --
and have since BIRTH!!
*/

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



Re: [PHP] Template Question

2004-08-14 Thread rush
Jonathan Haddad [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
eval takes a string and evaluates it as PHP, which I also thought would
work.  But this is a file of mixed PHP and HTML.

I've designed it this way because I work with guys that are dreamweaver
crazy and want to do all their layout there.

Maybe I should parse the file, and eval() the PHP and echoing the HTML?
  Or is there a better way?

well, maybe you could search for php opening and closing tags (?) and
evaluating only what you find between them and echoing, but I am not sure
what would happen if two such snippets needed to share the context.

Anyway, are you sure this is a good idea? templates are about separating
code and html, and most template systems I know are dreamweaver friendly.

rush
--
http://www.templatetamer.com/

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



Re: [PHP] Template Question

2004-08-14 Thread John Holmes
Jonathan Haddad wrote:
eval takes a string and evaluates it as PHP, which I also thought would 
work.  But this is a file of mixed PHP and HTML.
If your file starts off in HTML mode, then:
$file = file_get_contents('yourfile.php');
eval('?'.$file.'?');
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] RIP Programming

2004-08-14 Thread Harlequin
I know, I know. This is a PHP newsgroup. I just wondered if anyone knew of
any RIP newsgroups as I can't seem to find any, or any forums...

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-

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



RE: [PHP] RIP Programming

2004-08-14 Thread Ed Lazor
Did you Google?  RIP programming?  And if that doesn't work, you'll
probably have to clarify the term RIP.




 -Original Message-
 From: Harlequin [mailto:[EMAIL PROTECTED]
 Sent: Saturday, August 14, 2004 11:47 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] RIP Programming
 
 I know, I know. This is a PHP newsgroup. I just wondered if anyone knew of
 any RIP newsgroups as I can't seem to find any, or any forums...
 
 --
 -
  Michael Mason
  Arras People
  www.arraspeople.co.uk
 -
 
 --
 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] Language Searching

2004-08-14 Thread Karl Timmermann
Hi,
Does anyone how I could accomplish this:
Basically, I have a MySQL database of names - some names have Spanish
accents in them. I want to build a web interface in PHP to search this
database. However, I want the names with Spanish accents to be shown
in the search results, regardless if the search was spelled without
the accents.
For example:
The database has Niño in it. I want it to be returned if the user
searched by using nino or niño.
Any ideas? Maybe somehow using regular expressions in PHP or in MySQL
using Unicode somehow?
It has to be fast and on the fly. Thanks!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Anyone know of a PHP Dictionary Password Generator

2004-08-14 Thread John Holmes
Anyone know of a PHP english word password generator? Something that'll 
produce easy to read and remember codes like buffalo_candy or 
shipment+plant, etc?

I had a look on phpclasses.org, but didn't find anything like this.
Or, as an alternative, I'll code it myself if anyone can point me to a 
dictionary of english words that I could use populate a text file or 
database to choose from.

Thanks.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Problem with submit form if type is image

2004-08-14 Thread Frank Keessen
Thanks Torsten Roehr, it works!

Frank


Torsten Roehr [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Dear all,
 
  Can you please help me with the following?
 
  I have written the following script: If i have a input type image; the
 script doesn't go to the prospect2.php. If i have a input type=submit
 everything works super! Can someone help me?
 
  Frank
 


 _
  ?
  $_POST[submit]=isset($_POST[submit])?$_POST[submit]:;
  if($_POST['submit']!=)
  {
  file://$printresse=$_POST['printresse'];
  session_start();
  $_SESSION[printresse] = $_POST['printresse'];
  header(Location: prospect2.php);
  exit;
  }
  ?
  html
  body
  form name=form1 method=post id=form1 enctype=multipart/form-data
 action=?=$_SERVER['PHP_SELF']?
  select name=printresse
  OPTIONValue1/OPTION
  OPTIONValue2/OPTION
  /SELECT
  ?
  echotd align=\right\input type=\image\
 src=\images/next_button.jpg\ name=\submit\
value=\submit\/td/tr;
  ?
  /form

 Hi,

 if you use the input type 'image' you have to check for name_x or name_y,
so
 in your case:
 $_POST['submit'] = isset($_POST['submit']) ? $_POST['submit_x'] : '';

 Whenever you have problems like this do a print_r($_POST) at the top of
the
 second page. This will show you all submitted values.

 Regards, Torsten Roehr

 -- 
 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] Re: dropdown box displays empty rule

2004-08-14 Thread Frank Keessen
Kim,

It worked!

Thanks,

Frank

Kim Steinhaug [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Well, seems you have some confusing logic here, since you
 print out the option before you check if it should be checked.
 To top it off, when its accually checked you write out an empty
 value, which really doesnt make any sence at all.

 A quick rewite would be :

 while($rowu=mysql_fetch_object($result1)){
   if ($selected==$rowu-naamreis)
  echo option SELECTED value=\$rowu-naamreis\ . $rowu-naamreis
.
 /option\n ;
   else
  echo option value=\$rowu-naamreis\ .
 $rowu-naamreis . /option\n ;
 }

 -- 
 Kim Steinhaug
 -
 There are 10 types of people when it comes to binary numbers:
 those who understand them, and those who don't.
 -
 www.steinhaug.com - www.easywebshop.no - www.easycms.no -
www.webkitpro.com
 -

 -- 
 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] Anyone know of a PHP Dictionary Password Generator

2004-08-14 Thread Jason Wong
On Sunday 15 August 2004 06:33, John Holmes wrote:

 Or, as an alternative, I'll code it myself if anyone can point me to a
 dictionary of english words that I could use populate a text file or
 database to choose from.

http://www.dcs.shef.ac.uk/research/ilash/Moby/

-- 
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
--
/*
Taxes, n.:
Of life's two certainties, the only one for which you can get
an extension.
*/

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



RE: [PHP] Language Searching

2004-08-14 Thread Ed Lazor
You should probably run this past the MySQL mailing list.  They'll have a
lot more success on how to search the database like this.

-Ed


 -Original Message-
 From: Karl Timmermann [mailto:[EMAIL PROTECTED]
 Sent: Saturday, August 14, 2004 12:16 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Language Searching
 
 Hi,
 Does anyone how I could accomplish this:
 
 Basically, I have a MySQL database of names - some names have Spanish
 accents in them. I want to build a web interface in PHP to search this
 database. However, I want the names with Spanish accents to be shown
 in the search results, regardless if the search was spelled without
 the accents.
 
 For example:
 
 The database has Niño in it. I want it to be returned if the user
 searched by using nino or niño.
 
 Any ideas? Maybe somehow using regular expressions in PHP or in MySQL
 using Unicode somehow?
 
 It has to be fast and on the fly. Thanks!
 --
 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] PHP templates

2004-08-14 Thread Octavian Rasnita
Hi all,

I have seen that there are many templating systems for PHP. Which is the
most used and the best you have found?
Can you recommend me a free and good templating system?

Thank you.

Teddy

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



RE: [PHP] PHP templates

2004-08-14 Thread Watty
Try http://smarty.php.net/, I haven't used it myself but I have heard
good things about it.

Watty

 -Original Message-
 From: Octavian Rasnita [mailto:[EMAIL PROTECTED]
 Sent: 14 August 2004 22:03
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP templates
 
 Hi all,
 
 I have seen that there are many templating systems for PHP. Which is
the
 most used and the best you have found?
 Can you recommend me a free and good templating system?
 
 Thank you.
 
 Teddy
 
 --
 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] Language Searching

2004-08-14 Thread John Holmes
Karl Timmermann wrote:
Hi,
Does anyone how I could accomplish this:
Basically, I have a MySQL database of names - some names have Spanish
accents in them. I want to build a web interface in PHP to search this
database. However, I want the names with Spanish accents to be shown
in the search results, regardless if the search was spelled without
the accents.
For example:
The database has Nio in it. I want it to be returned if the user
searched by using nino or nio.
Any ideas? Maybe somehow using regular expressions in PHP or in MySQL
using Unicode somehow?
It has to be fast and on the fly. Thanks!
Could you store a second version of the name with accented characters 
converted and search on that? I found this function on the manual page 
for strtr() that you can use or adapt to your needs:

function removeaccents($string){
 return strtr(
  strtr($string,
   '',
   'SZszYAACNOOYaacnooyy'),
  array('' = 'TH', '' = 'th', '' = 'DH', '' = 'dh', '' = 'ss',
   '' = 'OE', '' = 'oe', '' = 'AE', '' = 'ae', '' = 'u'));
}
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP templates

2004-08-14 Thread Robby Russell
On Sat, 2004-08-14 at 14:02, Octavian Rasnita wrote:
 Hi all,
 
 I have seen that there are many templating systems for PHP. Which is the
 most used and the best you have found?
 Can you recommend me a free and good templating system?
 

I use Smarty on a very frequent basis. It's very flexible and very easy
to add your own function within it. One of my favorite PHP based
projects..it has definitely saved me a lot of coding time and as a
result my clients a whole lot of money.

http://smarty.php.net/

-Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting  Development
/



signature.asc
Description: This is a digitally signed message part


[PHP] Log parsing

2004-08-14 Thread Watty
I have a dynamic IP address, I used everydns.net as a DNS server. I have
a bash script that runs with cron that checks the current IP of the
machine with the DNS record so that if my IP changes; it can run the
update program.
 
I would like to do some thorough availability reports, so I started by
writing the result of the bash script to a log file. I want to parse the
log file to give me availability reports. The log file is in the form:
08/14/04 09:10:01 [TAB] S - when the IP
check returns OK
08/14/04 09:10:01 [TAB] U - when the IP need
to be synchronised
 
The process does not run when the computer is not on, so that needs to
be taken into consideration. 
 
Can anyone come up with a script that will carry out this process
efficiently?
 
Thanks in advance,
 
Watty   


Re: [PHP] Log parsing

2004-08-14 Thread John Holmes
Watty wrote:
I have a dynamic IP address, I used everydns.net as a DNS server. I have
a bash script that runs with cron that checks the current IP of the
machine with the DNS record so that if my IP changes; it can run the
update program.
 
I would like to do some thorough availability reports, so I started by
writing the result of the bash script to a log file. I want to parse the
log file to give me availability reports. The log file is in the form:
08/14/04 09:10:01 [TAB] S - when the IP
check returns OK
08/14/04 09:10:01 [TAB] U - when the IP need
to be synchronised
 
The process does not run when the computer is not on, so that needs to
be taken into consideration. 
 
Can anyone come up with a script that will carry out this process
efficiently?
How exactly do you want it parsed? uptime vs. downtime? number of 
updates? average time between updates? how many zeros are in your file?

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Log parsing

2004-08-14 Thread John Holmes
Watty wrote:
I would like to do some thorough availability reports, so I started by
writing the result of the bash script to a log file. I want to parse the
log file to give me availability reports. The log file is in the form:
08/14/04 09:10:01 [TAB] S - when the IP
check returns OK
08/14/04 09:10:01 [TAB] U - when the IP need
to be synchronised
 
The process does not run when the computer is not on, so that needs to
be taken into consideration. 
Is there any entry for when the script/computer is started or stopped? 
If not, you're not going to be able to determine the actual uptime. If 
one entry is S, then two hours pass and an entry is U, how do we know if 
the computer was on or off during that time?

Basically how this is going to work:
1. Read first two lines, $line[1], $line[2], using fgets()
2. Use strtotime() to convert timestamps and subtract
   to determine the elapsed time between them
3. Add difference to either $U_time or $S_time based
   upon status (S or U) in $line[1]
4. Set $line[1] = $line[2]
5. Read next line of file into $line[2]
6. GOTO #2
Then you'll have total $U_time and total $S_time and you can calculate 
your percentages from there.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Log parsing

2004-08-14 Thread Watty
We know because the IP check run every 5 minutes by cron, and if it has
no run within 5:01 minutes then the computer is off, or the script isn't
working. But we should assume that the computer is off is there is not a
record for that 5 minute slot. Alternatively we could write another line
into the log when the computer shuts down.

Watty

 -Original Message-
 From: John Holmes [mailto:[EMAIL PROTECTED]
 Sent: 15 August 2004 01:52
 To: Watty
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Log parsing
 
 Watty wrote:
 
  I would like to do some thorough availability reports, so I started
by
  writing the result of the bash script to a log file. I want to parse
the
  log file to give me availability reports. The log file is in the
form:
  08/14/04 09:10:01 [TAB] S - when the IP
  check returns OK
  08/14/04 09:10:01 [TAB] U - when the IP
need
  to be synchronised
 
  The process does not run when the computer is not on, so that needs
to
  be taken into consideration.
 
 Is there any entry for when the script/computer is started or stopped?
 If not, you're not going to be able to determine the actual uptime. If
 one entry is S, then two hours pass and an entry is U, how do we know
if
 the computer was on or off during that time?
 
 Basically how this is going to work:
 
 1. Read first two lines, $line[1], $line[2], using fgets()
 2. Use strtotime() to convert timestamps and subtract
 to determine the elapsed time between them
 3. Add difference to either $U_time or $S_time based
 upon status (S or U) in $line[1]
 4. Set $line[1] = $line[2]
 5. Read next line of file into $line[2]
 6. GOTO #2
 
 Then you'll have total $U_time and total $S_time and you can calculate
 your percentages from there.
 
 --
 
 ---John Holmes...
 
 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
 
 php|architect: The Magazine for PHP Professionals - www.phparch.com
 

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



[PHP] How to determine if date/time is with DST or not ?

2004-08-14 Thread -{ Rene Brehmer }-
hi gang

I'm trying to find a simple way to determine if a given date/time is with
DST for a given locale at any point in time ... the point is basically to
convert date strings into accurate GMT timestamps for storage in the
database...

Like I've got date strings looking like:

Thursday, July 22, 2004 8:50:01 PM 
July 22, 2004 6:42 PM 

the strings are submitted through a form, together with a variable
determining the time zone these times are in. I just want to figure out if
the dates are with or without dst for that locale, at that given time, so
that I can properly convert them to GMT times ... but I have no clue how to
do that ... haven't been able to find anything useful in the manual or the
PHP Cookbook ... the time zone is submitted negative of the actual value ...
so a time offset of -0700 is submitted as +7 and +0200 as -2 ... this is
simply to make the time conversion simpler...

these are extracts of the current time calculation codes, including some
debugging code for the time conversion:

?php
  $date = $_POST['date'];
  $tzone = $_POST['tzone'];

  $timestamp = strtotime($date);
  
  if ($tzone != 'none') {
$tdif = $tzone.' hours';
$timestamp = strtotime($tdif,$timestamp);
  }
?

/* the following part is an extra of a larger table ... the formatting of
the time zone is merely for displaying purposes atm. The goal is to create
RFC2822 dates to be stored in the database alongside messages...
*/

tdWorkdate: ?php echo($date.' '.$tzone); ?br
  Time difference: ?php
if ($tzone  0) {
  $format = '-';
} else {
  $format = '+';
}
if (abs($tzone)  9) {
  $format .= '%u00';
} else {
  $format .= '0%u00';
}
printf($format,abs($tzone)); ?br
  Unix timestamp: ?php echo($timestamp); ?br
  GMT date: ?php echo(date('D, d M Y H:i:s',$timestamp)); ?/td


if anyone has any ideas for determining whether DST is on or off, I'd
appreciate it. right now I have no clue how to do this the easiest...

TIA

Rene
-- 
Rene Brehmer
aka Metalbunny

If your life was a dream, would you wake up from a nightmare, dripping of sweat, 
hoping it was over? Or would you wake up happy and pleased, ready to take on the day 
with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



[PHP] What happend to _SERVER?

2004-08-14 Thread Allen Wayne Best
Hello:

I am having a spot of difficulty with PHP. I cannot get php to return the 
values of _SERVER. Here is a test php file.

?php
$handle = fopen( /tmp/test.txt , w ) ;
fwrite( $handle, REMOTE_ADDR:  ) ;
fwrite( $handle, $_SERVER[REMOTE_ADDR] ) ;
fwrite( $handle, \n\n ) ;
fwrite( $handle, HTTP_HOST:  ) ;
fwrite( $handle, $_SERVER[HTTP_HOST] ) ;
fwrite( $handle, \n\n ) ;
fwrite( $handle, SERVER_NAME:  ) ;
fwrite( $handle, $_SERVER[SERVER_NAME] ) ;
fwrite( $handle, \n\n ) ;
fwrite( $handle, SERVER_SOFTWARE:  ) ;
fwrite( $handle, $_SERVER[SERVER_SOFTWARE] ) ;
fwrite( $handle, \n\n ) ;
phpinfo() ;
?

the output in /tmp/test.txt is:
REMOTE_ADDR: 

HTTP_HOST: 

SERVER_NAME: 

SERVER_SOFTWARE: 


and the browser shows a blank window (mozilla and konqueror!).

Any suggestions are greatly appreciated.

-- 
regards,
allen wayne best, esq
your friendly neighborhood rambler owner
my rambler will go from 0 to 105
Current date: 1:21:15::226:2004

I went to a job interview the other day, the guy asked me if I had any
questions , I said yes, just one, if you're in a car traveling at the
speed of light and you turn your headlights on, does anything happen?

He said he couldn't answer that, I told him sorry, but I couldn't work
for him then.
-- Steven Wright

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



Re: [PHP] What happend to _SERVER?

2004-08-14 Thread Thomas Goyne
On Sat, 14 Aug 2004 15:26:46 -0700, Allen Wayne Best  
[EMAIL PROTECTED] wrote:

Hello:
I am having a spot of difficulty with PHP. I cannot get php to return the
values of _SERVER. Here is a test php file.
print_r($_SERVER);
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Log parsing

2004-08-14 Thread John Holmes
John Holmes wrote:
Watty wrote:
 We know because the IP check run every 5 minutes by
 cron, and if it has no run within 5:01 minutes then
 the computer is off, or the script isn't working.
 But we should assume that the computer is off is there
 is not a record for that 5 minute slot. Alternatively
 we could write another line into the log when the
 computer shuts down.

Basically how this is going to work:
1. Read first two lines, $line[1], $line[2], using fgets()
2. Use strtotime() to convert timestamps and subtract
   to determine the elapsed time between them
3. Add difference to either $U_time or $S_time based
   upon status (S or U) in $line[1]
4. Set $line[1] = $line[2]
5. Read next line of file into $line[2]
6. GOTO #2
Then you'll have total $U_time and total $S_time and you can calculate 
your percentages from there.
So, according to what you said, when you calculate the difference in 
Step 2 above, you could put a maximum of five minutes, right? If the 
difference between two lines is over 5 minutes, you can assume it was on 
for the first 5 and off for the rest.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP templates

2004-08-14 Thread Hero Wunders
Hallo!
I have seen that there are many templating systems for PHP. Which is the
most used and the best you have found?
Can you recommend me a free and good templating system?
I like Savant because it is small and intuitive.
You can find more info on:
http://wiki.ciaweb.net/yawiki/index.php?area=Savant
http://wiki.ciaweb.net/yawiki/index.php?area=SavantTwo
HTH
herojoker
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] What happend to _SERVER?

2004-08-14 Thread Allen Wayne Best
Thomas:

Thanx for your suggestion. I ran 

php stuff1.php  stuff.out

-- start of stuff.php ---
?php
print_r();
?
-- end of stuff.php ---

with the results of

 start of output ---
X-Powered-By: PHP/4.2.2
Content-type: text/html

 end of output ---

from within the browsers, the window remains blank.

On Saturday 14 August 2004 15:31, Thomas Goyne pronounced:
 On Sat, 14 Aug 2004 15:26:46 -0700, Allen Wayne Best

 [EMAIL PROTECTED] wrote:
  Hello:
 
  I am having a spot of difficulty with PHP. I cannot get php to return the
  values of _SERVER. Here is a test php file.

 print_r($_SERVER);

 --

 Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

-- 
regards,
allen wayne best, esq
your friendly neighborhood rambler owner
my rambler will go from 0 to 105
Current date: 34:4:16::226:2004

Silverman's Law:
If Murphy's Law can go wrong, it will.

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



Re: [PHP] looking for a good FormMail PHP script

2004-08-14 Thread Juan Nin
raditha dissanayake wrote:
Juan Nin wrote:
Hi
I'm looking for a good FormMail PHP script which beheaves like Matt 
Wright's FormMail.pl script (but lacks it's exploitable problems :)

I found several on the net, but didn't like them too much...
any recommendations?

you have obviously not looked at the PHP manual.
First of all: despite the fact that on the manual there are always 
comments and code examples, it's not the obvious place where to look for 
that...

Second, I suppose you are talking about the examples that were posted in 
the docs about the mail() function... that's not what I want... if I 
simply wanted to write a script that sends an e-mail from a defined 
form, I do it in 2 minutes...

what I want is a generic script that can be used with ANY form, just 
like Matt Wright's FormMail.pl does, and that is well written, and 
secure, that has no spam exploitable bugs, etc, like Matt's has..

I could write it myself too, I can do it, in no more than ten minutes, 
but I don't want to reinvent the wheel, and maybe if I write it, despite 
the fact that I administer mail servers, web servers and many others, 
maybe I fall under some exploitable bug too... so maybe there's an 
existing good script already written, that many people uses, and that is 
known to be good? do I explain myself?

I googled and found several, but looking at them, I didn't like them, 
because they were more like simple scripts like the ones posted in the 
docs of the mail() function, or the ones which were generic, for any 
form, weren't good, and didn't have any type of checks, and were 
obviously and easily exploitable..

so looking at the PHP manual is not the answer for me in this case, I 
don't want a 2 line script, I want something good and serious...

If anyone knows of a good script of this kind, I will appreciate  :)
thanks again,
Juan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: What happend to _SERVER?

2004-08-14 Thread Hannes Magnusson
try to alter your ini file;
ini_set ( variables_order, EGPCS );
var_dump ( $_SERVER );
- Hannes

On Sat, 14 Aug 2004 15:26:46 -0700
[EMAIL PROTECTED] (Allen Wayne Best) wrote:

 Hello:
 
 I am having a spot of difficulty with PHP. I cannot get php to return the 
 values of _SERVER. Here is a test php file.
 
 ?php
 $handle = fopen( /tmp/test.txt , w ) ;
 fwrite( $handle, REMOTE_ADDR:  ) ;
 fwrite( $handle, $_SERVER[REMOTE_ADDR] ) ;
 fwrite( $handle, \n\n ) ;
 fwrite( $handle, HTTP_HOST:  ) ;
 fwrite( $handle, $_SERVER[HTTP_HOST] ) ;
 fwrite( $handle, \n\n ) ;
 fwrite( $handle, SERVER_NAME:  ) ;
 fwrite( $handle, $_SERVER[SERVER_NAME] ) ;
 fwrite( $handle, \n\n ) ;
 fwrite( $handle, SERVER_SOFTWARE:  ) ;
 fwrite( $handle, $_SERVER[SERVER_SOFTWARE] ) ;
 fwrite( $handle, \n\n ) ;
 phpinfo() ;
 ?
 
 the output in /tmp/test.txt is:
 REMOTE_ADDR: 
 
 HTTP_HOST: 
 
 SERVER_NAME: 
 
 SERVER_SOFTWARE: 
 
 
 and the browser shows a blank window (mozilla and konqueror!).
 
 Any suggestions are greatly appreciated.
 
 -- 
 regards,
 allen wayne best, esq
 your friendly neighborhood rambler owner
 my rambler will go from 0 to 105
 Current date: 1:21:15::226:2004
 
 I went to a job interview the other day, the guy asked me if I had any
 questions , I said yes, just one, if you're in a car traveling at the
 speed of light and you turn your headlights on, does anything happen?
 
 He said he couldn't answer that, I told him sorry, but I couldn't work
 for him then.
   -- Steven Wright

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



Re: [PHP] looking for a good FormMail PHP script

2004-08-14 Thread Hannes Magnusson
On Sat, 14 Aug 2004 20:13:23 -0300
[EMAIL PROTECTED] (Juan Nin) wrote:

 raditha dissanayake wrote:
  Juan Nin wrote:
  
  Hi
 
  I'm looking for a good FormMail PHP script which beheaves like Matt 
  Wright's FormMail.pl script (but lacks it's exploitable problems :)
 
  I found several on the net, but didn't like them too much...
 
  any recommendations?
  
  
  you have obviously not looked at the PHP manual.
 
 First of all: despite the fact that on the manual there are always 
 comments and code examples, it's not the obvious place where to look for 
 that...
 
 Second, I suppose you are talking about the examples that were posted in 
 the docs about the mail() function... that's not what I want... if I 
 simply wanted to write a script that sends an e-mail from a defined 
 form, I do it in 2 minutes...
 
 what I want is a generic script that can be used with ANY form, just 
 like Matt Wright's FormMail.pl does, and that is well written, and 
Are we just suppost to know Matt Wright's FormMail.pl ? Or are we suppost to google 
to check that out so we can answear your question?

Anyway, http://pear.php.net/package-search.php?pkg_name=mailbool=ANDsubmit=Search 
any help?


 secure, that has no spam exploitable bugs, etc, like Matt's has..
 
 I could write it myself too, I can do it, in no more than ten minutes, 
 but I don't want to reinvent the wheel, and maybe if I write it, despite 
 the fact that I administer mail servers, web servers and many others, 
 maybe I fall under some exploitable bug too... so maybe there's an 
 existing good script already written, that many people uses, and that is 
 known to be good? do I explain myself?
 
 I googled and found several, but looking at them, I didn't like them, 
 because they were more like simple scripts like the ones posted in the 
 docs of the mail() function, or the ones which were generic, for any 
 form, weren't good, and didn't have any type of checks, and were 
 obviously and easily exploitable..
 
 so looking at the PHP manual is not the answer for me in this case, I 
 don't want a 2 line script, I want something good and serious...
 
 If anyone knows of a good script of this kind, I will appreciate  :)
 
 thanks again,
 
 Juan

- Hannes

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



Re: [PHP] What happend to _SERVER?

2004-08-14 Thread Justin Patrin
On Sat, 14 Aug 2004 16:08:01 -0700, Allen Wayne Best
[EMAIL PROTECTED] wrote:
 Thomas:
 
 Thanx for your suggestion. I ran
 
 php stuff1.php  stuff.out
 
 -- start of stuff.php ---
 ?php
 print_r();

http://www.php.net/manual/en/function.print-r.php

 ?
 -- end of stuff.php ---
 
 with the results of
 
  start of output ---
 X-Powered-By: PHP/4.2.2
 Content-type: text/html
 
  end of output ---
 
 from within the browsers, the window remains blank.
 
 On Saturday 14 August 2004 15:31, Thomas Goyne pronounced:
  On Sat, 14 Aug 2004 15:26:46 -0700, Allen Wayne Best
 
  [EMAIL PROTECTED] wrote:
   Hello:
  
   I am having a spot of difficulty with PHP. I cannot get php to return the
   values of _SERVER. Here is a test php file.
 
  print_r($_SERVER);
 
  --
 
  Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
 
 -- 
 regards,
 allen wayne best, esq
 your friendly neighborhood rambler owner
 my rambler will go from 0 to 105
 Current date: 34:4:16::226:2004
 
 Silverman's Law:
 If Murphy's Law can go wrong, it will.
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 !DSPAM:411e9948260948544259725!
 
 


-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



[PHP] PHP not working with apache2

2004-08-14 Thread Grant
I'm running Gentoo Linux, and emerged (installed)
squirrelmail which automatically installed all of its
dependencies including PHP and (I think) mod_php.  PHP
doesn't seem to be working though, as I always end up
looking at the raw PHP code in a browser.  I do have
apache and apache2 installed on my system, and I
suspect some key PHP things may have been set up for
apache instead of apache2.  Does anyone have any
pointers?

- Grant



__
Do you Yahoo!?
Y! Messenger - Communicate in real time. Download now. 
http://messenger.yahoo.com

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



Re: [PHP] PHP not working with apache2

2004-08-14 Thread John Holmes
Grant wrote:
I'm running Gentoo Linux, and emerged (installed)
squirrelmail which automatically installed all of its
dependencies including PHP and (I think) mod_php.  PHP
doesn't seem to be working though, as I always end up
looking at the raw PHP code in a browser.  I do have
apache and apache2 installed on my system, and I
suspect some key PHP things may have been set up for
apache instead of apache2.  Does anyone have any
pointers?
http://us2.php.net/manual/en/install.unix.php
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP not working with apache2

2004-08-14 Thread Grant

--- John Holmes [EMAIL PROTECTED] wrote:

 Grant wrote:
 
  I'm running Gentoo Linux, and emerged (installed)
  squirrelmail which automatically installed all of
 its
  dependencies including PHP and (I think) mod_php. 
 PHP
  doesn't seem to be working though, as I always end
 up
  looking at the raw PHP code in a browser.  I do
 have
  apache and apache2 installed on my system, and I
  suspect some key PHP things may have been set up
 for
  apache instead of apache2.  Does anyone have any
  pointers?
 
 http://us2.php.net/manual/en/install.unix.php

Thank you for the link.  This section seems to apply
to me:

Common Problems

If you see the PHP source instead of the result the
script should produce, you have probably forgot to
edit /etc/conf.d/apache. Apache needs to be started
with the -D PHP4 flag. To see if the flag is present,
you should be able to see it when using ps ax | grep
apache while Apache is running.

but I have already added -D PHP4 to my
/etc/conf.d/apache2 file and the ps ax | grep apache2
command verifies that.  Any ideas?

- Grant



__
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

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



Re: [PHP] Re: What happend to _SERVER?

2004-08-14 Thread Allen Wayne Best
thomas:

my php.ini has

variables_order = EGPCS.

Silly me, I forget to put $_SERVER in the print_r statement. so here is the 
revised file with output:

--- start of stuff php --
?php
print_r( $_SEVER );
var_dump( $_SERVER ) ;
?
--- end of stuff php --

--- start of stuff out --
X-Powered-By: PHP/4.2.2
Content-type: text/html
array(30) {
  [HOSTNAME]=
  string(18) mesozoic.atoka.org
  [SHELL]=
  string(9) /bin/bash
  [TERM]=
  string(5) xterm
  [HISTSIZE]=
  string(4) 1000
  [QTDIR]=
  string(17) /usr/lib/qt-3.2.3
  [OLDPWD]=
  string(4) /tmp
  [WWW]=
  string(35) /usr/www/atoka-software/html/family
  [http_proxy]=
  string(30) http://mesozoic.atoka.org:8080;
  [USER]=
  string(4) root
  [LS_COLORS]=
  string(440) 
no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
  [USERNAME]=
  string(4) root
  [MAIL]=
  string(24) /var/qmail/alias/Mailbox
  [PATH]=
  string(113) 
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:/var/qmail/bin:/root/bin
  [INPUTRC]=
  string(12) /etc/inputrc
  [PWD]=
  string(35) /usr/www/atoka-software/html/family
  [LANG]=
  string(11) en_US.UTF-8
  [MAILDROP]=
  string(24) /var/qmail/alias/Mailbox
  [SHLVL]=
  string(1) 1
  [HOME]=
  string(5) /root
  [BASH_ENV]=
  string(13) /root/.bashrc
  [LOGNAME]=
  string(4) root
  [LESSOPEN]=
  string(24) |/usr/bin/lesspipe.sh %s
  [DISPLAY]=
  string(4) :0.0
  [QMAILMFTFILE]=
  string(12) /root/.lists
  [G_BROKEN_FILENAMES]=
  string(1) 1
  [XAUTHORITY]=
  string(18) /root/.xauth0dEbWZ
  [_]=
  string(12) /usr/bin/php
  [PHP_SELF]=
  string(0) 
  [argv]=
  array(1) {
[0]=
string(10) stuff1.php
  }
  [argc]=
  int(1)
}
--- end of stuff out --
On Saturday 14 August 2004 16:15, Hannes Magnusson pronounced:
 try to alter your ini file;
 ini_set ( variables_order, EGPCS );
 var_dump ( $_SERVER );
 - Hannes


-- 
regards,
allen wayne best, esq
your friendly neighborhood rambler owner
my rambler will go from 0 to 105
Current date: 35:15:17::226:2004

Topologists are just plane folks.
Pilots are just plane folks.
Carpenters are just plane folks.
Midwest farmers are just plain folks.
Musicians are just playin' folks.
Whodunit readers are just Spillane folks.
Some Londoners are just P. Lane folks.

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



Re: [PHP] Re: What happend to _SERVER?

2004-08-14 Thread John Holmes
Allen Wayne Best wrote:
Silly me, I forget to put $_SERVER in the print_r statement. so here is the 
revised file with output:

--- start of stuff php --
?php
print_r( $_SEVER );
var_dump( $_SERVER ) ;
?
--- end of stuff php --
--- start of stuff out --
X-Powered-By: PHP/4.2.2
Content-type: text/html
array(30) {
  [HOSTNAME]=
  string(18) mesozoic.atoka.org
  [SHELL]=
  string(9) /bin/bash
[snip]
You still have a typo in print_r(), but either way you see the output 
from $_SERVER. So it exists. Now call the same script through your web
server (http://youdomain/thisfile.php) and see if you get output.

If you do not see anything (be sure to View Source, also), then you've 
got a really screwed up installation of PHP and should reinstall it.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: What happend to _SERVER?

2004-08-14 Thread Curt Zirzow
* Thus wrote Allen Wayne Best:
 thomas:
 
 my php.ini has
 
 variables_order = EGPCS.
 
 Silly me, I forget to put $_SERVER in the print_r statement. so here is the 
 revised file with output:
 
 --- start of stuff php --
 ?php
 print_r( $_SEVER );

typo!

 var_dump( $_SERVER ) ;
 ?
 --- end of stuff php --
 
 --- start of stuff out --
 X-Powered-By: PHP/4.2.2
 Content-type: text/html
 array(30) {
   [HOSTNAME]=
   string(18) mesozoic.atoka.org
   [SHELL]=
   string(9) /bin/bash

You are running this file locally with the php cgi binary, not
through a webserver.


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Re: What happend to _SERVER?

2004-08-14 Thread Allen Wayne Best
john:

ooops! yes, i do. fixed. ran thru the web browser (no change!) fyi, the web 
server is apache 2.0.40-21.11 on a rh9 box.

i uninstalled all php rpms, and reinstalled. no change.
php-4.2.2-17.2.i386.rpm
php-devel-4.2.2-17.2.i386.rpm
php-imap-4.2.2-17.2.i386.rpm
php-ldap-4.2.2-17.2.i386.rpm
php-manual-4.2.2-17.2.i386.rpm
php-mysql-4.2.2-17.2.i386.rpm
php-pgsql-4.2.2-17.2.i386.rpm
php-snmp-4.2.2-17.2.i386.rpm

bye the way, when i view page source in mozilla, I find:
htmlhead/headbody/body/html

On Saturday 14 August 2004 20:28, John Holmes pronounced:
 Allen Wayne Best wrote:
  Silly me, I forget to put $_SERVER in the print_r statement. so here is
  the revised file with output:
 
  --- start of stuff php --
  ?php
  print_r( $_SEVER );
  var_dump( $_SERVER ) ;
  ?
  --- end of stuff php --
 
  --- start of stuff out --
  X-Powered-By: PHP/4.2.2
  Content-type: text/html
  array(30) {
[HOSTNAME]=
string(18) mesozoic.atoka.org
[SHELL]=
string(9) /bin/bash

 [snip]

 You still have a typo in print_r(), but either way you see the output
 from $_SERVER. So it exists. Now call the same script through your web
 server (http://youdomain/thisfile.php) and see if you get output.

 If you do not see anything (be sure to View Source, also), then you've
 got a really screwed up installation of PHP and should reinstall it.

-- 
regards,
allen wayne best, esq
your friendly neighborhood rambler owner
my rambler will go from 0 to 105
Current date: 42:55:17::226:2004

The number of Unix installations has grown to 10, with more expected.
-- The Unix Programmer's Manual, 2nd Edition, June, 1972

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



[PHP] forum suggestions

2004-08-14 Thread Robby Russell
I have an existing web application with a fairly large user base, so it
has it's own user authentication already. I am looking for a message
board/forum that I can tie into the system and not need to do too much
hacking to get it to authenticate against my existing system. Something
with threaded comments and such, nothing super complicated like phpbb,
but with some of the functionality.

Any suggestions?

Thanks,

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting  Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Re: What happend to _SERVER?

2004-08-14 Thread John Holmes
Allen Wayne Best wrote:
ooops! yes, i do. fixed. ran thru the web browser (no change!) fyi, the web 
server is apache 2.0.40-21.11 on a rh9 box.
I'm pretty sure you already said that a phpinfo() page resulted in no 
output, either.

I'd say that, however you did it, PHP isn't installed correctly. Did you 
make the changes needed to httpd.conf for Apache to recognize PHP?

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP not working with apache2

2004-08-14 Thread Jason Wong
On Sunday 15 August 2004 07:45, Grant wrote:
 I'm running Gentoo Linux, and emerged (installed)
 squirrelmail which automatically installed all of its
 dependencies including PHP and (I think) mod_php.  PHP
 doesn't seem to be working though, as I always end up
 looking at the raw PHP code in a browser.  I do have
 apache and apache2 installed on my system, and I
 suspect some key PHP things may have been set up for
 apache instead of apache2.  Does anyone have any
 pointers?

Shouldn't you be asking this on the Gentoo list? At the very least so that the 
package packagers would know that there is something wrong with their 
packages. And the fact that you have both apache and apache2 installed 
complicates matter slightly. How does Gentoo handle it? Does it install PHP 
for both? Which apache are you hitting when you see the raw PHP code? Unless 
you know what you're doing why have you got two apaches installed? Etc.

-- 
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
--
/*
NOTICE:
Anyone seen smoking will be assumed to be on fire and will
be summarily put out.
*/

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



Re: [PHP] Re: What happend to _SERVER?

2004-08-14 Thread Hannes Magnusson
On Sat, 14 Aug 2004 18:14:48 -0700
[EMAIL PROTECTED] (Allen Wayne Best) wrote:

 john:
 
 ooops! yes, i do. fixed. ran thru the web browser (no change!) fyi, the web 
 server is apache 2.0.40-21.11 on a rh9 box.
 
 i uninstalled all php rpms, and reinstalled. no change.
 php-4.2.2-17.2.i386.rpm
 php-devel-4.2.2-17.2.i386.rpm
 php-imap-4.2.2-17.2.i386.rpm
 php-ldap-4.2.2-17.2.i386.rpm
 php-manual-4.2.2-17.2.i386.rpm
 php-mysql-4.2.2-17.2.i386.rpm
 php-pgsql-4.2.2-17.2.i386.rpm
 php-snmp-4.2.2-17.2.i386.rpm
 
 bye the way, when i view page source in mozilla, I find:
 htmlhead/headbody/body/html
That is impossible. var_dump() *ALWAYS* prints results.
Insert this code into a file testing.php
?php
var_dump( $_SERVER );
phpinfo ( INFO_VARIABLES );
show_source( __FILE__ );
?
- Hannes

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



RE: [PHP] Log parsing

2004-08-14 Thread Watty
I have got a messy script working, thanks for the help John. It's
attached if anyone would mind helping me hack it up. There is also a
copy of a sample log file.

Watty

 -Original Message-
 From: John Holmes [mailto:[EMAIL PROTECTED]
 Sent: 15 August 2004 01:52
 To: Watty
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Log parsing
 
 Watty wrote:
 
  I would like to do some thorough availability reports, so I started
by
  writing the result of the bash script to a log file. I want to parse
the
  log file to give me availability reports. The log file is in the
form:
  08/14/04 09:10:01 [TAB] S - when the IP
  check returns OK
  08/14/04 09:10:01 [TAB] U - when the IP
need
  to be synchronised
 
  The process does not run when the computer is not on, so that needs
to
  be taken into consideration.
 
 Is there any entry for when the script/computer is started or stopped?
 If not, you're not going to be able to determine the actual uptime. If
 one entry is S, then two hours pass and an entry is U, how do we know
if
 the computer was on or off during that time?
 
 Basically how this is going to work:
 
 1. Read first two lines, $line[1], $line[2], using fgets()
 2. Use strtotime() to convert timestamps and subtract
 to determine the elapsed time between them
 3. Add difference to either $U_time or $S_time based
 upon status (S or U) in $line[1]
 4. Set $line[1] = $line[2]
 5. Read next line of file into $line[2]
 6. GOTO #2
 
 Then you'll have total $U_time and total $S_time and you can calculate
 your percentages from there.
 
 --
 
 ---John Holmes...
 
 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
 
 php|architect: The Magazine for PHP Professionals - www.phparch.com
 


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

RE: [PHP] Log parsing

2004-08-14 Thread Watty
I'll try that in another way; feel free to give me your hacks for it:
 
?php
$file = file_get_contents( ./ip );
$line = explode( \n, $file );
 
## Number of log entries
$total = 0;
 
$unavail = 0;
$unavaillog = FALSE;
 
## Establish the standard difference between log entries of 5 minutes
$diff = 300;
## Add 5 because cron often is off by a couple of seconds
$maxdiff = $diff + 5;
 
 
$downtime = array(array());
 
Done the log parser:
 
## Count variable for iterations of downtime
$cntdown = 0;
 
foreach( $line as $val ) {
   $bits = explode( \t, trim( $val ) );
 
  if ( $bits[0]  ( $bits[1] == S || $bits[1] == U ) ) {
 $ctime = $bits[0];
 
 if ( $total == 0 ) {
$firsttime = $ctime;
$ptime = $firsttime;
}
 
 
 $diftime = $ctime - $ptime;
 ## Calculate the amount of time the server has
been down.
 if( $diftime  $maxdiff ) {
print $diftime .\n;
$missed = $diftime / $diff;
$unavail += $missed;
$total += $missed;
if ( $unavailog ) { }
else {
   $downtime[$cntdown][start]  = $ptime;
   $unavailog = TRUE;
   }
}
 
 if( trim( $bits[1] ) == U ) {
if ( $unavailog ) {
 
   }
else {
   $downtime[$cntdown][start] = $ctime;
   $unavailog = TRUE;
   }
$unavail++;
}
 else {
 ## Once the down time has finished
if ( $unavailog ) {
   $downtime[$cntdown][finish] = $ctime;
   $downtime[$cntdown][diff] = $downtime[$cntdown][finish] -
   $downtime[$cntdown][start];
   $cntdown++;
   }
$unavailog = FALSE;
}
 
 $total++;
 $ptime = $ctime;
 }
   }
 
## Last time is registered as the timestamp of the last entry
$lasttime = $ctime;
 
$firsttime = date( j/n/y H:i, $firsttime );
$lasttime  = date( j/n/y H:i, $lasttime );
 
## Make sure the percentage is uptime, one decimal place
$percentage = number_format( ( 100 - ( ( $unavail / $total ) * 100 ) ),
1 );
 
print $percentage% uptime from $firsttime to $lasttime\n;
 
## Need to make this look pretty
print_r( $downtime );
?
 
example log file:
1092528602   S
1092528901   S
1092529201   S
1092529502   S
1092530102   S
1092530401   S
1092530701   S
1092531601   S
1092531902   S
1092532201   S
1092532501   U


Re: [PHP] PHP not working with apache2

2004-08-14 Thread Grant

--- Jason Wong [EMAIL PROTECTED] wrote:

 On Sunday 15 August 2004 07:45, Grant wrote:
  I'm running Gentoo Linux, and emerged (installed)
  squirrelmail which automatically installed all of
 its
  dependencies including PHP and (I think) mod_php. 
 PHP
  doesn't seem to be working though, as I always end
 up
  looking at the raw PHP code in a browser.  I do
 have
  apache and apache2 installed on my system, and I
  suspect some key PHP things may have been set up
 for
  apache instead of apache2.  Does anyone have any
  pointers?

I have asked about this on the Gentoo list and was
told to add -D PHP4 to an apache2 directive.  I did
that, but it still doesn't work.

Having apache and apache2 installed is some kind of a
mistake.  I'm a newbie and not sure how it happened. 
I plan on completely starting over and setting up my
server again from nothing to make it very clean, but
everything except PHP is working great.  This is the
absolute last thing standing in the way of going live.

When I see the raw code I am hitting apache2 as apache
is not running.

The only reason I need PHP is squirrelmail.  Is
mod_php necessary in this situation?

- Grant



__
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

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



Re: [PHP] forum suggestions

2004-08-14 Thread Matthew Runo
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I'd suggest Phorum..

http://www.phorum.org

It works great for us. You can see an example here:

http://resnet.ucsc.edu/phorum/

Matthew Runo
http://www.quabbo.com
Quabbo Internet Services
The only host with the Zend Performance Suite!

On Aug 14, 2004, at 6:24 PM, Robby Russell wrote:

 I have an existing web application with a fairly large user base, so it
 has it's own user authentication already. I am looking for a message
 board/forum that I can tie into the system and not need to do too much
 hacking to get it to authenticate against my existing system. Something
 with threaded comments and such, nothing super complicated like phpbb,
 but with some of the functionality.

 Any suggestions?

 Thanks,

 -Robby

 -- 
 /***
 * Robby Russell | Owner.Developer.Geek
 * PLANET ARGON  | www.planetargon.com
 * Portland, OR  | [EMAIL PROTECTED]
 * 503.351.4730  | blog.planetargon.com
 * PHP/PostgreSQL Hosting  Development
 /


-BEGIN PGP SIGNATURE-
Version: PGP 8.1

iQA/AwUBQR7QB0Yfzzr/2QfwEQImlACggsu4mgAnr7vx5hpP0N8bw+epx/gAn0Qk
6ht+NHLqSrqJ8CYU4teApILu
=O0fF
-END PGP SIGNATURE-

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



Re: [PHP] PHP not working with apache2

2004-08-14 Thread Jason Wong
On Sunday 15 August 2004 10:09, Grant wrote:

 I have asked about this on the Gentoo list and was
 told to add -D PHP4 to an apache2 directive.  I did
 that, but it still doesn't work.

Then escalate the issue! Or go through the chapter:

  manual  Installation  Servers-Apache 2.0

to make sure that all the steps outlined have been performed correctly by the 
emerge.

 Having apache and apache2 installed is some kind of a
 mistake.  I'm a newbie and not sure how it happened.
 I plan on completely starting over and setting up my
 server again from nothing to make it very clean, but
 everything except PHP is working great.  This is the
 absolute last thing standing in the way of going live.

That's a good idea. Like I said unless you know what you're doing having both 
apaches installed is not a very good idea.

 When I see the raw code I am hitting apache2 as apache
 is not running.

 The only reason I need PHP is squirrelmail.  Is
 mod_php necessary in this situation?

I would guess yes, but it all depends on how your system is setup. Furthermore 
you have to establish 

1) whether mod_php is installing against apache, apache2, or both
2) whether squirrelmail is installing against apache, apache2, or both

Again, the Gentoo list is what you want.

-- 
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
--
/*
Whom the mad would destroy, first they make Gods.
-- Bernard Levin
*/

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



Re: [PHP] Re: What happend to _SERVER?

2004-08-14 Thread Allen Wayne Best
john:

ah-ha! I found the problem!

I change
ServerSignature Off

to

ServerSignature On

and now all is well..

Thanks everyone for chiming in :))

On Saturday 14 August 2004 21:32, John Holmes pronounced:
 Allen Wayne Best wrote:
  ooops! yes, i do. fixed. ran thru the web browser (no change!) fyi, the
  web server is apache 2.0.40-21.11 on a rh9 box.

 I'm pretty sure you already said that a phpinfo() page resulted in no
 output, either.

 I'd say that, however you did it, PHP isn't installed correctly. Did you
 make the changes needed to httpd.conf for Apache to recognize PHP?

 --

 ---John Holmes...

 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

 php|architect: The Magazine for PHP Professionals  www.phparch.com

-- 
regards,
allen wayne best, esq
your friendly neighborhood rambler owner
my rambler will go from 0 to 105
Current date: 7:7:21::226:2004

It seems a little silly now, but this country was founded as a protest
against taxation.

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