php-general Digest 8 Jan 2008 14:10:41 -0000 Issue 5223

Topics (messages 266863 through 266874):

Re: is_executable() ???
        266863 by: Anup Shukla

Re: Byte Size of an array
        266864 by: Chris

Re: how can i use zend framework view helper in smarty?
        266865 by: Chris

Re: Float Value Parse Problem
        266866 by: Chris

Re: ./configure APC problems with 3.0.16 and what happened to 
--enable-apc-pthreadmutex???
        266867 by: Chris

Re: First stupid post of the year. [SOLVED]
        266868 by: Zoltán Németh

Re: utf-8 in $_POST
        266869 by: pobox.verysmall.org
        266870 by: Arvids Godjuks
        266871 by: Per Jessen

Re: Mail system
        266872 by: Michelle Konzack
        266873 by: Michelle Konzack

Re: global address collection
        266874 by: Satyam

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 ---
Al wrote:
clearstatcache();
if(is_executable(PATH_TO_SOURCE_DIR . $filename)
{
code
}

is_executable() will only tell if the execute bit is set for the provided file.


Always returns true for:
foo.jpg
foo.php
foo.sh

And even if I feed it a non existing file.

Checking on a non-existing file basically is checking for the directory.
PATH_TO_SOURCE_DIR . $filename == PATH_TO_SOURCE_DIR if $filename == ""

Directories generally have the permission 0755 which means they have the execute bit set, and hence the "true" result.


I found one ref that said is_executable() doesn't work in safemode, seems dumb if true.

If that's so, how can I test whether an uploaded file is executable?

Any file, under unix can be executable if the execute bit in the file permissions is set.

Make sure you umask settings are correct, so that files created do not have the execute bit set or use chmod on the file after uploading.

If you intend to find if the file is an executable in the Windows sense... is_executable() will not help you.

Try examining the mime type of the file.. (PECL::Fileinfo),
though it may of be of little help.

Additionally, using is_uploaded_file() and move_uploaded_file() functions is recommended while dealing with uploaded content.


I'm on a NIX with Apache, etc.



--
Regards,
Anup Shukla

--- End Message ---
--- Begin Message ---
Sancar Saran wrote:
Hello,

I just wonder to how can I find a memory size of an array.

<wild guess>
echo strlen(serialize($array));
</wild guess>

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
Wan Chaowei wrote:
> hello all:
> my boss want use zend framework with smarty. if i don't use view helper
> in smarty, it's easy to do it, but how can i use zend framework view
> helper in smarty?

Probably best to ask the zend-framework list(s):

http://framework.zend.com/community

-- 
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
Cyril Chacko wrote:
Hi,

I have created a class and passing a float value to a method in it. I
have checked the the argument values in the method. The passed
argument has the proper value. However, on any arithmetic operation
the float as a whole is rounded off.

http://php.net/float

There is a message there about precision problems.

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
steve wrote:
When configuring APC 3.0.16 I see this, which I don't recall seeing before:

checking dlfcn.h presence... no
configure: WARNING: dlfcn.h: accepted by the compiler, rejected by the
preprocessor!
configure: WARNING: dlfcn.h: proceeding with the compiler's result
checking for dlfcn.h... yes

Also --enable-apc-pthreadmutex no longer seems to work (it is no
longer in ./configure --help and in phpinfo it says it is using file
locks).

Is the warning above causing a problem or was
--enable-apc-pthreadmutex pulled out???

You'll probably get better help from the pecl list:

http://pecl.php.net/support.php#lists

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
2008. 01. 7, hétfő keltezéssel 12.14-kor tedd ezt írta:
> At 4:36 PM +0100 1/7/08, Zoltán Németh wrote:
> >2008. 01. 7, hétf‘ keltezéssel 10.29-kor tedd ezt írta:
> >however, on firefox with encoding auto-detection both page looks
> >correctly and the same.
> >
> >greets
> >Zoltán Németh
> 
> Not that you are claiming otherwise, but FF will 
> render the pages incorrectly if the text encoding 
> isn't correctly set -- and that's the point.
> 
> Look at this in FF with text encoding set to ISO-8859:
> 
> http://luden.se/test/t-utf8.html
> 

sure. if you force an encoding on FF, you will sooner or later meet
pages which will look as garbage because they use another encoding.
however if FF is set to auto-detect encoding AND the page sends the
correct header/meta tag info, the page is usually displayed correctly.

greets
Zoltán Németh

> Cheers,
> 
> tedd
> 
> -- 
> -------
> http://sperling.com  http://ancientstones.com  http://earthstones.com
> 

--- End Message ---
--- Begin Message ---
Olav Mørkrid wrote:
i specify iso-8859-1 in both header and body:

<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1"/>
<form action="/" method="post" accept-charset="iso-8859-1">

if two different people post the norwegian phrase "Godt nytt år"
(happy new year), it may appear in the following variations:

[CONTENT_TYPE] => application/x-www-form-urlencoded;charset=iso-8859-1
$_POST["input"] = "Godt nytt år"

[CONTENT_TYPE] => application/x-www-form-urlencoded;charset=utf-8
$_POST["input"] = "Godt nytt år"

Hm... What User Agents? Are there User Agents that do not follow the instructions?

i was just wondering if php had some setting or function that would
make it auto-convert $_POST data into one specific encoding.

I have been banging my head over this some time ago. The main problem I had at that time is that I could not find a reliable way to detect the incoming encoding, which is the base of conversion.

If the User Agents are so unstable, you can't expect consistent error, but you should be prepared for all kind of deviations.

otherwise
i seem forced to do something like this in the beginning of my php
script:

if(ereg("utf-8", $_SERVER["CONTENT_TYPE"])) {
  foreach($_POST as $key => $value)
     $_POST["key"] = convert_utf8_to_iso8859($value);
}

As said above, you assume that the inconsistency will persist. And this assumption is not stable, as it seems the User Agents do not follow the instructions you sent to them.

I would agree with the others and advice you to switch to UTF-8 - this is the only encoding, where you can handle multiple alphabets _without_ knowing which alphabet it is.

Iv

--- End Message ---
--- Begin Message ---
To author:

You'r going the wrong way.
Make your page utf-8, all text on it. Set utf-8 encoding and treat all
incoming data as UTF-8. If some agent (definetly not some browser - they all
know UTF-8) doesn't understand that (that could be some "hacker" writing
it's own bot) - that's his problem. Then you will get all data incoming in
utf-8 and you can just add, modify and select it in and from database (don't
forget to set database and tables to UTF-8, that is default in MySQL 4.1 and
above).

If you have to deal with utf-8 data, you need the mb_string extension, see
manual.

--- End Message ---
--- Begin Message ---
Olav Mørkrid wrote:

> i specify iso-8859-1 in both header and body:
> 
> <meta http-equiv="Content-type" content="text/html;
> charset=iso-8859-1"/> <form action="/" method="post"
> accept-charset="iso-8859-1">

Have you checked 1) what the webserver sends in the header and 2) what
the browser actually uses?  I'm pretty certain I've had issues where
the meta tags were fine, but the server overrode me settings in the
header.


/Per Jessen, Zürich

--- End Message ---
--- Begin Message ---
Am 2007-12-30 21:51:21, schrieb mattias:
> First of all
> If you have a bad day don't send to the list

I think not, since ONLY you know your system and I guess, you are using
some some webinterface (apache/php)...

It is DEFINITIVLY up to you, to implement the solution for YOUR system.
I have such signup-system too, but it would not fit your needs...

Thanks, Greetings and nice Day
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


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

Attachment: signature.pgp
Description: Digital signature


--- End Message ---
--- Begin Message ---
Am 2007-12-30 22:10:50, schrieb mattias:
> Yes but i are newbie in php
> I think i should use php exec but i dont know no more

I use apache with php5 and su-php...

Thanks, Greetings and nice Day
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


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

Attachment: signature.pgp
Description: Digital signature


--- End Message ---
--- Begin Message ---
Actually, phone numbers should not be prefixed with 00.  The prefix for
international dialing depends on the local phone regulations and it is
different in different countries (for example, 011 in the USA).  The
recommendation from the telephone union (http://www.itu.int/) is to use  a
plus sign to indicate that the phone number starts with the country prefix.
Thus, it would be: +44 1623 123456 or +1 408 555 1212.  Americans also get
often confused because the first 1 is both the country code for the US,
Canada and a good chunk of the Caribbean and it is, at the same time, the
prefix they use to dial national long distance.  That's why the + is
important.

In most of the world, the leading zeros are like ../. You can thing of local phone numbers as your current directory. If you want to dial another area code, you first dial a zero, which is like using ../ in a file system, and then the area code, like the folder for that local number folder. If you want to dial international, you dial 00, which is like doing ../../, which gets you to the world root (eventually there might be three zeros to dial interplanetary!) and then dial the 'folder name' of the other country. Which reminds me of an observation by Arthur C Clarke that once humankind becomes an intergalactic civilization each group will lose communication with the rest, can you just imagine what phone numbers might be! (Brits always had a peculiar sense of humor)

There is no mandatory format to separate international dialing prefix,
country code, area code and actual number, it is better to have them
separated at least with a blank space, but there is no standard regarding
that and none should automatically impossed, the spacing provided by the
user should be respected.  Once again Americans are use to see their numbers
as 1-408-555-1212 because all their area codes are 3 digits long and all the
local numbers contain 7 digits grouped as 3 and 4, but most countries use a
variable number of digits for area codes so only the person who entered the
number can know how to split it.  Do not delete the whitespace and then
reformat the numbers assuming a fixed format because none actually exists.
Tables of international dialing codes are available just googling around
(for example, http://www.kropla.com/dialcode.htm), it is not a bad idea to
check country against the first part of the phone number but then, a warning
is all you could possibly issue since a person might have a postal address
in, say, Monaco (+377) and a French mobile (+33). I wouldn't imagine that
the Vatican has a separate mobile network from that of Rome so though they
have an international prefix different from that of Italy which they might
use for their land lines, their mobiles are probably Italian.

Also, it should be  Province/County/State, and it should be optional since
some cities are autonomous (usuall federal capital cities), just don't make
it mandatory.  And don't force anything on postal codes.  Some countries
have letters in them and the number of characters varies.  I just hate it
when they ask to enter the full 9 digit zip code.

Satyam


----- Original Message ----- From: "Richard Heyes" <[EMAIL PROTECTED]>
To: "tedd" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, January 07, 2008 11:56 PM
Subject: Re: [PHP] global address collection


In other words, in the USA we ask for name, address, city, state, zip, and phone number. What would be a global equivalent that could cover all (or most) address and phone numbers?

Full name (optionally forename/surname)
Address 1
Address 2 (optional)
Address 3 (optional)
Town/City
County/State
Postal/Zip code
Country

Full international phone number (eg. 0044 1623 123456)

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS **

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



--
No virus found in this incoming message.
Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.17.13/1212 - Release Date: 06/01/2008 22:55



--- End Message ---

Reply via email to