php-general Digest 4 Aug 2003 13:32:14 -0000 Issue 2216

Topics (messages 158101 through 158147):

Re: mail funciton
        158101 by: Igor Konforti

PHP / Oracle support (8/9) under Redhat 9
        158102 by: Robert Mena
        158107 by: Justin French

Re: Forking PHP Processes on Unix (PHP4)
        158103 by: Jason Sheets

Re: logging of mail() function?
        158104 by: Jason Sheets

microtime alternative
        158105 by: Micah Montoy
        158110 by: Micah Montoy

Invalid Characters, XML...
        158106 by: Russell P Jones
        158141 by: David Otton
        158147 by: Luis Lebron

mysql_real_escape_string
        158108 by: Anthony Ritter
        158109 by: Jason Sheets

grabbing variable from bottom to top
        158111 by: Micah Montoy
        158112 by: Jason Sheets
        158113 by: Justin French
        158120 by: Jeff Harris

cli file open problem
        158114 by: Gareth Thomas

splitting content into pages
        158115 by: daniel.electroteque.org

Clarification..... UTF-8 Enccoding .....
        158116 by: Russell P Jones
        158117 by: Hank TT
        158118 by: Justin French
        158119 by: Tom Rogers

FTP accounts
        158121 by: Binay Agarwal
        158127 by: Jason Wong

Addin a column of numbers not using MySQL
        158122 by: Ben C.
        158123 by: Justin French
        158125 by: Ben C.
        158129 by: Jason Wong

How to Ask Questions THe Smart Way...
        158124 by: Ralph Guzman

Qmail + PHP
        158126 by: Haseeb
        158128 by: Jason Wong
        158131 by: Haseeb
        158132 by: Jason Wong
        158133 by: Haseeb
        158139 by: Jason Wong
        158145 by: Haseeb

Relevant PHP market research
        158130 by: Alexandru COSTIN
        158142 by: Jay Blanchard
        158144 by: Alexandru COSTIN

Making i18n work on all Unix webservers ?
        158134 by: Christophe Chisogne
        158140 by: Tom Rogers
        158143 by: Christophe Chisogne

Re: Globals
        158135 by: Ford, Mike               [LSS]

Re: Pushing array onto array
        158136 by: Ford, Mike               [LSS]
        158137 by: Ford, Mike               [LSS]

Web tools for FTP accounts management
        158138 by: Binay Agarwal

site error
        158146 by: Nick

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message --- I'm sorry,i was just checking if outgoing server is working :P



--
Igor Konforti

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

I am planning to migrate my current web server from
redhat 7.x to 9 and I am currently evaluating what may
go wrong or need special attention before I actually
replace it.

After searching the archives and other lists I still
have a couple of questions :

a) apache

It seems that apache + php does not work well under
heavy load so I should stick with 1.3.X right ?  Any
ideas where I can find a rpm package for redhat 9 ?

b) oracle support

For the current setup I've downloaded and installed
the oracle 8i (8.1.5) in a separate machine, tar.gz
the lib directory in order to compile and run php with
oracle 8i.

Is this the best approach for Redhat 9 or should I try
to install oracle 9 which hopefully may have a
devel-only option ?  Note that php needs to access
external oracle 8 servers which I do not mantain.

Regards.

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

--- End Message ---
--- Begin Message --- On Monday, August 4, 2003, at 11:33 AM, Robert Mena wrote:

a) apache

It seems that apache + php does not work well under
heavy load so I should stick with 1.3.X right ?  Any
ideas where I can find a rpm package for redhat 9 ?


I can't help with the Oracle question, but yes, stick with apache 1.3.x for the moment...


It would also pay to look at what version of PHP you're currently running (eg 4.1) and see what major changes you're likely to experience when upgrading to the latest stable version.

If your existing version is pre 4.1, the register globals will be an issue, for example.

Sorry, I have no idea what version of PHP was on RH 7


Justin



--- End Message ---
--- Begin Message --- PHP can fork on Unix, just not from a web environment. So you need to execute the command from the command line or maybe an exec.

Take a look at: http://www.php.net/manual/en/ref.pcntl.php

Jason

Damien G wrote:

Hi Readers,

Heres what i'm trying to achieve:

A script, that uses multiple fsockopen()'s and simltaniously get feedback
from each socket from fget()s. Now, since using a single fget() needs to be
in a loop then it's not possible to have more than one loop going at the
same time.

I was thinking of using a break command, then getting feedback from the
other loops, and breaking each of them inside a encapsulating loop -
however, this is VERY ineffective.

What I thought about doing was just using the same script launched multiple
times, so it has diffrent proccesses running and therefore would be able to
complete the task of having multiple loops running at the same time on the
same system.

The problem I've found out is that on Unix (the desired OS breed), PHP can't
be forked - so using a start.php script to execute multiple system() calls
wouldn't work becuase PHP waits till the system() function has finished
before carrying on with the rest of start.php.

i.e. The following won't work:


PHP:------------------------------------------------------------------------ ------ for ($i = 0; $i < 5; $i++) { system ("/path/to/php /path/to/script.php &"); }

----------------------------------------------------------------------------
--

Basically, i'm asking if anyone has a work around, or alternativley a answer
to my problem?

I'd much appritiate it, or any help you can contribute.

Thanks in advance, or for atleast reading to this point

-Damien






--- End Message ---
--- Begin Message --- This is something you would probably do with your e-mail server, not with PHP. You can log all of the emails sent by your scripts by writing a wrapper around mail though. Basically check your SMTP daemon's documentation whether it be sendmail, qmail or something else and look for auditing or accounting.

Jason

RiGe wrote:

Is there possible to log outgoing mails sent via mail() function? I need to
know, when, which script (can be path to php file on server) and receipt of
mail that was sent.

Is there possible?

Thanx.

RiGe







--- End Message ---
--- Begin Message ---
Anyone have an alternative to microtime that works for a windows system?

thanks



--- End Message ---
--- Begin Message ---
scratch this.  I found an alternative.

"Micah Montoy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Anyone have an alternative to microtime that works for a windows system?
>
> thanks
>
>



--- End Message ---
--- Begin Message ---
Im using PHP to write to XML files, but I am having some problems. A lot
of users are cutting and pasting content from text editors like word,
which uses odd quotation marks, dashes, etc. which PHP writes to the XML
file, and then the XML parser does not under stand. Is there a
stripslashes() or htmlspecialchars() equivalent that will convert this
kind of stuff to the correct ascii text?

Russ


--- End Message ---
--- Begin Message ---
On Sun, 3 Aug 2003 21:51:53 -0400 (EDT), you wrote:

>Im using PHP to write to XML files, but I am having some problems. A lot
>of users are cutting and pasting content from text editors like word,
>which uses odd quotation marks, dashes, etc. which PHP writes to the XML
>file, and then the XML parser does not under stand. Is there a
>stripslashes() or htmlspecialchars() equivalent that will convert this
>kind of stuff to the correct ascii text?

This should get you started. It behaves as does htmlentities().

For those high-ASCII characters out of Word/IE... decide what regular ASCII
character you want to map them to, (eg slanted-quote-open and -close to
regular quote), and add them to the $trans array before performing the
array_walk().

function xmlentities ($string, $quote_style = ENT_COMPAT)
{
  static $trans;
  if (!is_array ($trans)) {
    $trans = get_html_translation_table (HTML_ENTITIES, $quote_style);
    array_walk ($trans, create_function ('&$a, $b', '$a = "&#" . ord ($b) .
";";'));
  }
  return (strtr ($string, $trans));
}



--- End Message ---
--- Begin Message ---
Here's what I have been using.


$trans= array("'" => "&#39;", "'" => "&#39;",">" => "&#62;", "<" => "&#60;",
"&" => "&#38;","-" => "&#45;", "°" => "&#176;", "±" => "&#177;", "-" =>
"&#150;", """ => "&#147;", """ => "&#148;","..." => "&#8230;","'" =>
"&#8216;","²" =>"&#178;","·" => "&#183;" );
        
$value=strtr($value,$trans);



Luis
-----Original Message-----
From: David Otton [mailto:[EMAIL PROTECTED]
Sent: Monday, August 04, 2003 7:18 AM
To: Russell P Jones
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Invalid Characters, XML...


On Sun, 3 Aug 2003 21:51:53 -0400 (EDT), you wrote:

>Im using PHP to write to XML files, but I am having some problems. A lot
>of users are cutting and pasting content from text editors like word,
>which uses odd quotation marks, dashes, etc. which PHP writes to the XML
>file, and then the XML parser does not under stand. Is there a
>stripslashes() or htmlspecialchars() equivalent that will convert this
>kind of stuff to the correct ascii text?

This should get you started. It behaves as does htmlentities().

For those high-ASCII characters out of Word/IE... decide what regular ASCII
character you want to map them to, (eg slanted-quote-open and -close to
regular quote), and add them to the $trans array before performing the
array_walk().

function xmlentities ($string, $quote_style = ENT_COMPAT)
{
  static $trans;
  if (!is_array ($trans)) {
    $trans = get_html_translation_table (HTML_ENTITIES, $quote_style);
    array_walk ($trans, create_function ('&$a, $b', '$a = "&#" . ord ($b) .
";";'));
  }
  return (strtr ($string, $trans));
}



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

--- End Message ---
--- Begin Message ---
The following function is from Larry Ullman's PHP and mySQL on page 217 -
script 6.8 - in which there is a connection to a mySQL database using PHP.

My question is that I'm not sure of the global variable $dbc.

If I am to understand...this made up function escape_data() will receive a
piece of data - say $_POST['first_name'] - and then check if
magic_quotes_gpc is turned on in the ini file.

If it returned true, then stripslashes will be applied to the data - if it
is not turned on, then slashes will be applied to the data variable.

What is the reason that the global variable $dbc is declared in the
function - I cannot find another instance of $dbc outside of the function in
script 6.8.

Thank you,
Tony Ritter
.....................


function escape_data($data)
{
global $dbc;
if (ini_get('magic_quotes_gpc'))
{
$data=stripslashes($data);
}
return mysql_real_escape_string($data,$dbc);
}
.............................
//check for a first name

if(empty($_POST['first_name']))
 {
   $fn=FALSE;
   $message='<p>You forgot to enter you first name</p>';
  }
else
 {
  $fn= escape_data($_POST['first_name']);   // calling the function
 }
..............



--- End Message ---
--- Begin Message --- dbc looks like a MySQL Connection Resource, a connection returned from mysql_connect. It looks like this function is using the mysql escape function to make sure the data is properly escaped for that particular database. If you use a function other than mysql_real_escape_string you can remove the $dbc variable.

Jason

Anthony Ritter wrote:

The following function is from Larry Ullman's PHP and mySQL on page 217 -
script 6.8 - in which there is a connection to a mySQL database using PHP.

My question is that I'm not sure of the global variable $dbc.

If I am to understand...this made up function escape_data() will receive a
piece of data - say $_POST['first_name'] - and then check if
magic_quotes_gpc is turned on in the ini file.

If it returned true, then stripslashes will be applied to the data - if it
is not turned on, then slashes will be applied to the data variable.

What is the reason that the global variable $dbc is declared in the
function - I cannot find another instance of $dbc outside of the function in
script 6.8.

Thank you,
Tony Ritter
.....................


function escape_data($data) { global $dbc; if (ini_get('magic_quotes_gpc')) { $data=stripslashes($data); } return mysql_real_escape_string($data,$dbc); } ............................. //check for a first name

if(empty($_POST['first_name']))
{
  $fn=FALSE;
  $message='<p>You forgot to enter you first name</p>';
 }
else
{
 $fn= escape_data($_POST['first_name']);   // calling the function
}
..............







--- End Message ---
--- Begin Message ---
Anyone know of a way to use a variable that isn't defined until further down
the script at the top.  I have a counter and once everything runs through
the script, the count is complete, I need to display this at the top above
the displayed results.  I thought about and tried a function but I still run
into the same problem.

thanks



--- End Message ---
--- Begin Message --- You can't get the intended value from a variable that hasn't been defined yet, obviously because you haven't given the variable a value. If you are trying to make something like a counter you may consider one of the following:

1. Insert the value into a database like MySQL or PostgreSQL,
2. Write the variable to a text file
3. Use PHP Sessions to store the variable between requests.

Of these choices #1 is generally the best choice, #2 will not deal with concurrent requests well and may corrupt the information, #3 will only work for a single visitor.

If the values are in an array you might use count($array) that will tell you the number of elements in the array, if the values are a delimited string you can use count(explode('seperator', 'data')) or something like that. The other thing you can do is run through the loop and instead of printing output put it into a variable, then at the end of the loop print the number, then print the variable containing the output, then print the end text.

Jason



Micah Montoy wrote:

Anyone know of a way to use a variable that isn't defined until further down
the script at the top.  I have a counter and once everything runs through
the script, the count is complete, I need to display this at the top above
the displayed results.  I thought about and tried a function but I still run
into the same problem.

thanks







--- End Message ---
--- Begin Message --- Ok, this is completely off the top of my head, and there is more than likely a better way, but if you HAVE to do this, then I guess here's an option:

1. turn on ob (output buffering at the top of the script
2. where you want the counter to be, echo something unique like [EMAIL PROTECTED]@
3. once the script has ended flush the contents of OB into a variable like $obContents
4. do a str_replace('[EMAIL PROTECTED]@',$yourCounterValue, $obContents)
5. echo the $obContents to the screen



I think a smarter way would be to re-organise your code somehow so that it does what you want, but maybe that can't be done (no way to know without seeing the code).



Good luck,


Justin French




On Monday, August 4, 2003, at 01:04 PM, Micah Montoy wrote:


Anyone know of a way to use a variable that isn't defined until further down
the script at the top. I have a counter and once everything runs through
the script, the count is complete, I need to display this at the top above
the displayed results. I thought about and tried a function but I still run
into the same problem.


thanks


--- End Message ---
--- Begin Message ---
On Aug 3, 2003, "Micah Montoy" claimed that:

|Anyone know of a way to use a variable that isn't defined until further down
|the script at the top.  I have a counter and once everything runs through
|the script, the count is complete, I need to display this at the top above
|the displayed results.  I thought about and tried a function but I still run
|into the same problem.
|
|thanks

You could use some dHTML. At the top of the page, you would print
something like
<p ID="CountingID">Calculating count.</p>
Then, after the computing,
<SCRIPT LANGUAGE="JavaScript">
    document.all("MyID1").innerText = 'Total Count: $count.';
</SCRIPT>

This code is probably very browser dependant, so YMMV.
Jeff
-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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

I am trying to write data to a text file on my Windows 2000 server using PHP
at the command line. I am running PHP 4.3.2, and the script uses the 'touch'
function to create the file (which works fine) but when I try and open the
file to write to it and errors. Anyone any idea? I have checked the security
and also IIS access.. I would assume however that if touch works then so
would fopen... I am stumped. Any help would be much appreciated.

G.



--- End Message ---
--- Begin Message ---
thanks to the poster on the substr page i made a modification to it so it
now splits the content into pages lemme know anyone if this is useful

usage: page_content($content,15,$_GET['page']);

function page_content($content,$limit,$page)
{
                $array = explode("\r\n", $content);
                $maxline = count($array);
                if ($maxline > $limit) {
                        $max = $maxline - 1;
                        $page ? $page = $page : $page = 1;
                        $page ? $next = $limit * ($page - 1) + 1 : $next =
1;
                        $s=$next+$limit;
                        for ($i=$next; $i<$s; $i++) {
                                if ($array[$i]!="") $formatted_content .=
$array[$i]."\n\n";
                           //$dtrow = explode("|", $array[$i]);
                           //$row = "$dtrow[0]";
                           //$formatted_content .= $row."\n";
                        }
                        $p = 1;
                        $u = ceil($max/$limit);
                        for ($t=1; $t<$u; $t++) {
                                   $t == $page ?
$formatted_content .= "<b>$t</b>&nbsp; " : $formatted_content .= "<a
href=\"".$_SERVER['PHP_SELF']."?".url
('page', "page=$t")."\">$t</a>&nbsp; ";
                               $p=$p+$limit;
                        }
                        return $formatted_content;
                }
                return $content;
        }



--- End Message ---
--- Begin Message ---
Any idea on how to get rid of Windows chracters. I have paroblem with
users cutting and pasting out of Microsoft Word into textarea's and
input-boxes and the special characters like quotations and apostrophes
messing up the xml...


Thanks


Russ



--- End Message ---
--- Begin Message ---
I don't know how MS encodes its "smart" quotes but there are certainly
Unicode-compliant equivalents:
http://www.alanwood.net/unicode/general_punctuation.html

And XML is friendly to utf-8 (assuming you do want utf-8).


----- Original Message -----
From: "Russell P Jones" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 04, 2003 12:03 AM
Subject: [PHP] Clarification..... UTF-8 Enccoding .....


>
> Any idea on how to get rid of Windows chracters. I have paroblem with
> users cutting and pasting out of Microsoft Word into textarea's and
> input-boxes and the special characters like quotations and apostrophes
> messing up the xml...
>
>
> Thanks
>
>
> Russ
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>




--- End Message ---
--- Begin Message --- Identify common problematic characters, and develop a function (series of str_replace()'s) to convert them to suit.

Over time, you can always add to this function as you spot more problematic characters.

Also look at something like Tidy (see archives in the last week where it was discussed with the subject "tags to lowercase").

Justin



On Monday, August 4, 2003, at 02:03 PM, Russell P Jones wrote:


Any idea on how to get rid of Windows chracters. I have paroblem with users cutting and pasting out of Microsoft Word into textarea's and input-boxes and the special characters like quotations and apostrophes messing up the xml...


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

Monday, August 4, 2003, 2:03:57 PM, you wrote:

RPJ> Any idea on how to get rid of Windows chracters. I have paroblem with
RPJ> users cutting and pasting out of Microsoft Word into textarea's and
RPJ> input-boxes and the special characters like quotations and apostrophes
RPJ> messing up the xml...


RPJ> Thanks


RPJ> Russ

I do this before feeding it to xml

$description = iconv("ISO-8859-1","UTF-8",$description);

-- 
regards,
Tom


--- End Message ---
--- Begin Message ---
Hi everybody!

can any body suggest me the good resources/snippet for creating and managing FTP 
accounts. 
My configuration includes:
Redhat : 7.0
Php - 4.0.6
Apache web server

Any help would be highly appreciated.

Thanks in advance

Binay

--- End Message ---
--- Begin Message ---
On Monday 04 August 2003 03:29, Binay Agarwal wrote:

> can any body suggest me the good resources/snippet for creating and
> managing FTP accounts. My configuration includes:
> Redhat : 7.0
> Php - 4.0.6
> Apache web server

How you create an FTP account all depends on what ftpserver you're running. 
Some may use the system accounts, others may have its own list of accounts, 
others still may use a dbms to store the account info.

-- 
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
------------------------------------------
/*
Time is an illusion, lunchtime doubly so.
                -- The Hitchhiker's Guide to the Galaxy
*/


--- End Message ---
--- Begin Message ---
How do I add a column of numbers generated through a MySQL query without
using the SQL SUM() function? I have tried looking through the different
documentation.  I am probably missing something.

Thanks,

Ben


--- End Message ---
--- Begin Message --- Do you mean something like:

<?
$i = 0;
$sql = "SELECT a,b,c FROM foo";
$res = mysql_query($sql);
while($myrow = mysql_fetch_array($res))
        {
        $i++;
        echo $i."<br />";
        echo $myrow['a'] ."<br />";
        echo $myrow['b'] ."<br />";
        echo $myrow['c'] ."<br />";
        }
?>

Justin

On Monday, August 4, 2003, at 05:34 PM, Ben C. wrote:

How do I add a column of numbers generated through a MySQL query without
using the SQL SUM() function? I have tried looking through the different
documentation. I am probably missing something.


Thanks,

Ben


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

---
[This E-mail scanned for viruses]




--- End Message ---
--- Begin Message ---
Yes.  From there I want to add all the 'a' values together using PHP.

-----Original Message-----
From: Justin French [mailto:[EMAIL PROTECTED]
Sent: Monday, August 04, 2003 12:40 AM
To: Ben C.
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Addin a column of numbers not using MySQL


Do you mean something like:

<?
$i = 0;
$sql = "SELECT a,b,c FROM foo";
$res = mysql_query($sql);
while($myrow = mysql_fetch_array($res))
        {
        $i++;
        echo $i."<br />";
        echo $myrow['a'] ."<br />";
        echo $myrow['b'] ."<br />";
        echo $myrow['c'] ."<br />";
        }
?>

Justin

On Monday, August 4, 2003, at 05:34  PM, Ben C. wrote:

> How do I add a column of numbers generated through a MySQL query 
> without
> using the SQL SUM() function? I have tried looking through the 
> different
> documentation.  I am probably missing something.
>
> Thanks,
>
> Ben
>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> ---
> [This E-mail scanned for viruses]
>
>



--- End Message ---
--- Begin Message ---
On Monday 04 August 2003 15:59, Ben C. wrote:
> Yes.  From there I want to add all the 'a' values together using PHP.

So do it then. 

$total = $total + $myrow['a'] // or something as you go through the loop
                              // is just one of the ways to do this


-- 
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
------------------------------------------
/*
A beautiful woman is a picture which drives all beholders nobly mad.
                -- Emerson
*/


--- End Message ---
--- Begin Message ---
Here is something some of you on this list may find funny, others may
find this useful. This is not spam, this is actually a good manual you
should all read:

http://catb.org/~esr/faqs/smart-questions.html

Good Reading.

  



--- End Message ---
--- Begin Message ---
Hello,
anyone here who created new user for Qmail with PHP?
Haseeb
 
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here

--- End Message ---
--- Begin Message ---
On Tuesday 05 August 2003 04:07, Haseeb wrote:

> anyone here who created new user for Qmail with PHP?

Yes.

-- 
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
------------------------------------------
/*
Adapt.  Enjoy.  Survive.
*/


--- End Message ---
--- Begin Message ---
 i want your help. but as this is OT can we talk some where else. MSN may be?
 Haseeb
 
-------Original Message-------
 
Date: Monday, August 04, 2003 01:22:22 PM
Subject: Re: [PHP] Qmail + PHP
 
On Tuesday 05 August 2003 04:07, Haseeb wrote:
 
> anyone here who created new user for Qmail with PHP?
 
Yes.
 
--
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
------------------------------------------
/*
Adapt. Enjoy. Survive.
*/
 
 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here

--- End Message ---
--- Begin Message ---
On Tuesday 05 August 2003 05:36, Haseeb wrote:

>  i want your help. but as this is OT can we talk some where else. MSN may
> be?

1) how you add users depends on how you have installed and configured qmail

2) google for > php qmail

3) check out omailadmin

-- 
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
------------------------------------------
/*
If we can ever make red tape nutritional, we can feed the world.
                -- R. Schaeberle, "Management Accounting"
*/


--- End Message ---
--- Begin Message ---
i have searched already. can u give me sometime??
Haseeb
 
 
 
 
-------Original Message-------
 
Date: Monday, August 04, 2003 02:54:38 PM
Subject: Re: [PHP] Qmail + PHP
 
On Tuesday 05 August 2003 05:36, Haseeb wrote:
 
> i want your help. but as this is OT can we talk some where else. MSN may
> be?
 
1) how you add users depends on how you have installed and configured qmail
 
2) google for > php qmail
 
3) check out omailadmin
 
--
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
------------------------------------------
/*
If we can ever make red tape nutritional, we can feed the world.
   -- R. Schaeberle, "Management Accounting"
*/
 
 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here

--- End Message ---
--- Begin Message ---
On Tuesday 05 August 2003 06:00, Haseeb wrote:

> > 1) how you add users depends on how you have installed and configured
> > qmail

> i have searched already. can u give me sometime??

1) OK, *how* have you installed and configured qmail?

2) How do you add users right now?

If you can't answer those two questions then no-one can help you.

-- 
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
------------------------------------------
/*
Don't change the reason, just change the excuses!
                -- Joe Cointment
*/


--- End Message ---
--- Begin Message ---
i have not installed qmail myself my  linux admin compiled it.
as for how i am managing new user registrations right now . using plesk control panel
Haseeb
 
 
 
 
-------Original Message-------
 
Date: Monday, August 04, 2003 04:12:01 PM
Subject: Re: [PHP] Qmail + PHP
 
On Tuesday 05 August 2003 06:00, Haseeb wrote:
 
> > 1) how you add users depends on how you have installed and configured
> > qmail
 
> i have searched already. can u give me sometime??
 
1) OK, *how* have you installed and configured qmail?
 
2) How do you add users right now?
 
If you can't answer those two questions then no-one can help you.
 
--
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
------------------------------------------
/*
Don't change the reason, just change the excuses!
   -- Joe Cointment
*/
 
 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here

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

I've searched the net for various information on PHP usage in the
enterprise. I've searched Forrester
(http://www.forrester.com/search/1,6260,,00.html?squery=php), Gartner
(http://www.gartner.com) and
Google(http://www.google.com/search?q="market+research"+php) with little
results.

I know some popularity report exists here
(http://php.weblogs.com/popularity) and I also know that Zend has made this
survey (http://www.zend.com/zend/php_survey_results.php) but they are both
missing some essential figures on money, enterprise acceptance and so on.

We would also think creating a survey of our own - but we know that only a
company like Zend would be able to attract many other respondets from more
various areas than we do.

I would appreciate any figures on the web development market - because this
is the market for most of us - and knowing the market could only be a good
thing. I think we should consider this key figures:

1. How many PHP websites are developed per year in your company
1.1 What kind of applications bring the best profit
(CMS/Intranet/ERP/CRM/Dynamic Website)
2. Turn-over per year from PHP websites/company
3. Turn-over per year from PHP websites/employee
4. Where is your company heading in terms of market strategy - offer low
cost solutions, offer professional web development solutions, etc.
5. ASP/Java competition estimates (how many sites/application do they do,
how much is the market share for them?)
6. Some real market information for total web development/country would also
help to determine the PHP market share for all those information
7. Are PHP programmers spending money on software development tools or
prebuilt libraries?
8. Why do companies "reject" PHP solutions and how what should we do to
improve their feelings on this?

We are also open on any suggestions on this research's goal - as probably
there are other that know better how to do a market research.

Would this kind of survey work? Are there any political problems that could
prevent people filling it? We have a survey software and we would be glad to
create a public survey with those information that could help all PHP
developers convince their clients/bosses/partners that PHP is a viable
enterprise choice. I hope that you are also willing to change the conception
on PHP as the "Personal/low end" scripting language.

I'm looking forward to your comments,


Alexandru

-- 
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 312 5312



--- End Message ---
--- Begin Message ---
[snip]
I would appreciate any figures on the web development market - because
this
is the market for most of us - and knowing the market could only be a
good
thing. I think we should consider this key figures:
[/snip]

{IMHO}
I understand why your focus would be on the web development market, but
I also think that another segment of the market (intranet web app
development) is a significant market segment. There are many companies
out there who are using PHP to develop in-house apps (they are not
web-dev firms) and it would be these stats that would help to raise the
perception bar for PHP advocates. Then there are the folks who are
developing apps for use in the corporate environment (such as
phpMyAdmin).

I have spoken with others who use PHP extensively to power their
in-house applications for many business critical functions as we do. I
think that it would be prudent to include this segment in any research
about the viability of PHP in the corporate environment.
(/IMHO)

HTH

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

> [snip]
> I would appreciate any figures on the web development market - because
> this is the market for most of us - and knowing the market could only be a
> good thing. I think we should consider this key figures:
> [/snip]

> {IMHO}
> I understand why your focus would be on the web development market, but
> I also think that another segment of the market (intranet web app
> development) is a significant market segment.
    I welcome your suggestion.

> There are many companies
> out there who are using PHP to develop in-house apps (they are not
> web-dev firms) and it would be these stats that would help to raise the
> perception bar for PHP advocates. Then there are the folks who are
> developing apps for use in the corporate environment (such as
> phpMyAdmin).
    This is indeed a very powerful market - as most of the companies that
we've directly questioned (companies that do either J2EE or Microsoft or
embedded C) admitted they do PHP especially for Intranet - helpdesk or
bugtracker applications, etc.

> I have spoken with others who use PHP extensively to power their
> in-house applications for many business critical functions as we do. I
> think that it would be prudent to include this segment in any research
> about the viability of PHP in the corporate environment.
> (/IMHO)
    We will surely include this in the research.

    The reason I've started this thread would be to identify what should be
look for in our research - as probably we will not have an already made
research at our disposal as our market is pretty new/small/weird for people
that do research for money.

    So I am still looking forward for responses/ideas and after this I will
probably create the survey and submit it for review to the interested
people, following to make it public

                Alexandru



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

With the following code to translate messages in french, we need to put the mo files in a directory like

./local/xxx/LC_MESSAGE/messages.{mo,po}

        putenv("LANGUAGE=french");
        setlocale(LC_ALL, 'fr_BE');
        bindtextdomain("messages", "./local");
        textdomain("messages");
        echo '<br>' . _("Yes");

On one linux webserver, xxx must be 'fr' (and LANGUAGE set).
On another linux webserver, xxx must be 'french' (no var to set).

How can I guess which xxx to use, for my code to work on
any webserver ? Other solution than using 3 or more directories
like 'fr', 'french', 'fr_BE', and copying it?
In fact, I'd like to make it work on windows servers too...

And how can I guess which env var to set (or not) and in
which order (LC_ALL, LANG, LANGUAGE, ...) ? Is there a way
to do it for the code to work nearly everywhere ?
I'll use a class to hide that complexity.

Can someone help ? The PHP documentation is far from beeing
clear and precise enough in that particular field.

---
Christophe Chisogne
Developper, Publicityweb sprl
http://www.publicityweb.com



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

Monday, August 4, 2003, 8:25:18 PM, you wrote:

CC> With the following code to translate messages in french,
CC> we need to put the mo files in a directory like

CC> ./local/xxx/LC_MESSAGE/messages.{mo,po}

CC>         putenv("LANGUAGE=french");
CC>         setlocale(LC_ALL, 'fr_BE');
CC>         bindtextdomain("messages", "./local");
CC>         textdomain("messages");
CC>         echo '<br>' . _("Yes");

CC> On one linux webserver, xxx must be 'fr' (and LANGUAGE set).
CC> On another linux webserver, xxx must be 'french' (no var to set).

CC> How can I guess which xxx to use, for my code to work on
CC> any webserver ? Other solution than using 3 or more directories
CC> like 'fr', 'french', 'fr_BE', and copying it?
CC> In fact, I'd like to make it work on windows servers too...

CC> And how can I guess which env var to set (or not) and in
CC> which order (LC_ALL, LANG, LANGUAGE, ...) ? Is there a way
CC> to do it for the code to work nearly everywhere ?
CC> I'll use a class to hide that complexity.

CC> Can someone help ? The PHP documentation is far from beeing
CC> clear and precise enough in that particular field.

CC> ---
CC> Christophe Chisogne
CC> Developper, Publicityweb sprl
CC> http://www.publicityweb.com


Try using

$dir_name = setlocale(LC_MESSAGES);

After setup and that should return the string that gettext will use to
locate its files.

-- 
regards,
Tom


--- End Message ---
--- Begin Message ---
Tom Rogers wrote:
>
CC> ./local/xxx/LC_MESSAGE/messages.{mo,po}
CC>         setlocale(LC_ALL, 'fr_BE');
CC>         bindtextdomain("messages", "./local");
CC>         textdomain("messages");
CC> How can I guess which xxx to use, for my code to work on
CC> any webserver ?

Try using

$dir_name = setlocale(LC_MESSAGES);

After setup and that should return the string that gettext will use to
locate its files.

Thanks. But it looks like it's more complicated. setlocale(LC_MESSAGES,'0') returns fr_BE, but it seems PHP looks in ./local/fr, not in ./local/fr_BE when searching the catalog files, at least on one webserver. (using PHP 4.1.2, the other PHP 4.2.3). I guess there is some kind of search path to locate the catalog files, with some preference order. Too bad the i18n PHP thing isn't more predictable :-/

Of course, I restarted the webserver (apache reload) between tests,
to avoid problems with the gettext cache.

I think I'll simply copy ./locale/french to fr, fr_BE, fr_FR
And something similar for dutch and german. But I thought there
was some better and cleaner way to do it, in a more manageable way.

--
Christophe Chisogne
http://www.publicityweb.com


--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Chris Boget [mailto:[EMAIL PROTECTED]
> Sent: 01 August 2003 20:18
> 
> > I'm curious if someone could explain to me why this is occuring:
> > 
> > function blah() {
> >   //global $GLOBALS;
> > echo 'Globals: <pre>'; print_r( $GLOBALS ); echo '</pre>';
> > 
> > }
> > 
> > As it is shown above, with the 'global $GLOBALS' line commented
> > out, the print_r() works and shows all the currently 
> defined variables
> > and their corresponding values.  However, if I declare $GLOBALS
> > as global, nothing gets printed out.
> > 
> > Why?

Well, I'm kinda guessing here, but it probably goes something like this:

   global $GLOBALS;

is the equivalent of doing

   $GLOBALS = &$GLOBALS['GLOBALS'];

but this causes $GLOBALS to be a local variable within the function, so the
sequence PHP executes probably goes like this:

(1) set up $GLOBALS as a local variable of the function, masking out the
true (super)global $GLOBALS.
(2) look up the 'GLOBALS' element of this new local $GLOBALS -- this is NULL
as no value has yet been assigned to the local $GLOBALS!
(3) create a reference to the NULL obtained from this lookup, and assign
that to the local $GLOBALS.

So what you've ended up in the $GLOBALS which is local to the function is a
reference to NULL, hence the behaviour you're seeing.

Like I say, this is all guesswork -- albeit slightly educated guesswork,
based on my scant and very ancient (over 20 years ago!) experience of
writing bits for a couple of interpreted languages.  Maybe a PHP internal
person might come along and tell me how close I got...!! ;)

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Curt Zirzow [mailto:[EMAIL PROTECTED]
> Sent: 02 August 2003 23:07
> 
> * Thus wrote Andrew Brampton ([EMAIL PROTECTED]):
> > Well I just coded up a very small example, and it pushing 1 
> array into the
> > other...
> > 
> > Check out: http://81.102.229.151/push.php and
> > http://81.102.229.151/push.phps
> > 
> > It works exactly how it should... However really the array isn't a 2
> > dimensional one, since PHP doesn't have them, its rather a 
> array of arrays
> > which is roughly the same thing (and something not to worry 
> about)...
> 
> A 2 demensional array is an array of arrays.

No, it isn't.  A true 2-dimensional array is completely orthogonal -- anything you can 
do row-wise you can automatically also do column-wise, without having to write any 
special functionality.  An array of arrays, by its very nature, doesn't have columns 
as such, so if you want to work with, e.g. $arr[*][1] you have to have special 
functions to do so.

There are other differences, but in a nutshell that's essentially it.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Hank TT [mailto:[EMAIL PROTECTED]
> Sent: 03 August 2003 06:03
> 
> Well, I might have been more specific about their example, since not
> everyone has the book.  An excerpt below (so I don't need to 
> retype all the
> names of characters and foul creatures from the Lord of the Rings):
> 
> ---------------------------
> $arr1 = array('G', 'R', 'Sr');
> $arr2 = array('N', 'Su', 'O');
> 
> $arr3 = array_push($arr1, $arr2);
> 
> print $arr3[3][1];
> //prints Su
> ---------------------------
> 
> Weird usage....

Well, it wouldn't be weird if it were correct, but it's not, it's wrong!

Having executed this, the result should be:

   $arr3 == 4
   $arr1 == array('G', 'R', 'Sr', array('N', 'Su', 'O'))

so $arr3[3][1] doesn't even exist, since $arr3 is a simple scalar integer --
but on the other hand, $arr1[3][1] is indeed 'Su'.  So it appears there's a
typo -- theirs or yours?

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211

--- End Message ---
--- Begin Message ---
Hi everybody!

can any body suggest me the good resources/snippet for creating and managing FTP 
accounts through web interface using PHP.

My configuration includes:
Redhat : 7.0
wu-ftpd (FTP Server)
Php - 4.0.6
Apache web server

Any help would be highly appreciated.

Thanks in advance

Binay


--- End Message ---
--- Begin Message ---
Site www.Lancoalition.com

On my site im receiving the following error:

Warning: Unknown(): open_basedir restriction in effect.
File(/home/lancoali/public_html/nuke/html/index.php) is not within the
allowed path(s):
(/home/*:/usr/lib/php:/usr/local/lib/php:/tmp:/usr/X11R6/bin) in Unknown on
line 0

Warning: Unknown(/home/lancoali/public_html/nuke/html/index.php): failed to
open stream: Operation not permitted in Unknown on line 0

Warning: (null)(): Failed opening
'/home/lancoali/public_html/nuke/html/index.php' for inclusion
(include_path='.:/usr/lib/php:/usr/local/lib/php') in Unknown on line 0


Can anyone explain why im getting this error, i made no changed before i got
this error.

--
Nick "[EMAIL PROTECTED]"



--- End Message ---

Reply via email to