[PHP] how can i use zend framework view helper in smarty?

2008-01-07 Thread Wan Chaowei
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?
 thanks All!

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



[PHP] Byte Size of an array

2008-01-07 Thread Sancar Saran
Hello,

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

Regards

Sancar

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



[PHP] how can i use zend framework view helper in smarty?

2008-01-07 Thread Wan Chaowei
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?
 thanks All!

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



Re: [PHP] Delete rows from database

2008-01-07 Thread Jim Lucas

Balasubramanyam A wrote:

Hi all,

I'm searching names from MySQL and printing it on a browser. Also, I've
provided checkbox for all the rows and a delete button for a page. I want to
delete the selected rows from MySQL when I click on the "Delete" button. How
do I do that?

Here is the code which I used to print the rows after fetching the same from
MySQL

while ($line = mysql_fetch_array($resultset, MYSQL_ASSOC)) {
echo "\t\n";
echo "";


In the above line you need to have the row ID as the value of your check 
box.  Also, you should probably use and array in your form.  See below 
for example and explanation.


echo "";


Ok, broken down...

nothing special about this, pretty standard
echo "Now, this is assuming that your id column is called ID and that you will 
be wanting to delete more then one at a time.


on the process page, do a print_r($_POST)

You will see what you get


foreach ($line as $col_value) {
echo "\t\t $col_value\n";
}
//echo "";
echo "\t\n";
}



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



Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-07 Thread Nisse Engström
On Sun, 6 Jan 2008 11:28:55 -0500, tedd wrote:

> At 11:04 PM +0100 1/5/08, Nisse Engström wrote:
>>
>>The page encoding is determined by the HTTP
>>`Content-Type:´ header. Period. A  element
>>may provide hints to a browser if the HTTP header
>>is missing (eg. when saving a page to disc). In the
>>presence of a `Content-Type:´ header, the 
>>element should be completely ignored.
> 
> So, if one uses this --
> 
> 

[text/html ?]

> -- preceding everything else on a web page, and 
> also saves that page using UTF-8 encoding, then 
> it's certain that the page will be recognized as 
> UTF-8 across all modern browsers?

   I don't know if there is any certainty. If you want
absolute certainty, plain ASCII with character references
(`Ä´, `”´ and so on) may be the way to go.
And even then, all character references might not be
supported by the browser...

>>  > And lastly, what's the best encoding to set your
>>>  browser? I have clients who are all over the
>>>  place with special windoze characters that appear
>>>  like garbage in my browser.
>>
>>Set it to detect automatically, with a preference
>>for cp1252 (or windows-1252) which covers a lot of
>>western characters. cp1252 also has the nice property
>>of being compatible with ISO-8859-1, except that it
>>has some extra real characters where 8859-1 has control
>>characters.
> 
> Interesting that my browser (Safari) doesn't even 
> offer that choice, at least under that name. It 
> does offer ISO Latin, Mac OS Roman, UTF-8, and 34 
> other language-specific text encodings -- but not 
> 1252.

[The proper name is `windows-1252´.]

How does the following pages compare? The display
should be identical:





/Nisse

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



[PHP] Float Value Parse Problem

2008-01-07 Thread Cyril Chacko
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.

System Information :
   Operating System : Windows
   PHP Version   : PHP Version 5.2.4
   Web Server: Microsoft-IIS/5.0

Code Snippet :
qty += $qty;
$this->total_amt += ( $price * $qty )- $discount;
return true;
}

}
?>

-
On Caliing the function as
$order->addItem( 1, 2555.00, 0 );
$price = 2555.00,  String Data Type
$price * $qty = 3000,Double Data Type

$order->addItem( 1, 3005.00, 0 );
$price = 3005.00,  String Data Type
$price * $qty = 3000,Double Data Type

Please let me know if anything else is required. Thanks for the help.

Regards.

Cyril Chacko
-- 
Beauty lies in the eye of the beholder. Make sure they are on you.

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



Re: [PHP] Re: DOMDocument->getElementById() isn't working

2008-01-07 Thread Christoph Boget
>
> > that one of the nodes has an id of 'custom'.  However, when I try to get
> the
> > element directly using getElementById(), it doesn't return the node
> > properly.  Am I doing something wrong?
>
> A common problem. See here:
> http://wiki.flux-cms.org/display/BLOG/GetElementById+Pitfalls
>
> Probably easiest to use XPath. Otherwise you have to slightly modify
> your HTML...


Thanks for the link.  It was very informative.  I've switched to using XPath
and that seems to have solved my problems.  Thanks for the  help!

thnx,
Christoph


Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-07 Thread tedd

At 12:03 PM +0100 1/7/08, Nisse Engström wrote:

How does the following pages compare? The display
should be identical:





Nisse:

No, there is quite a difference depending upon 
the text encoding used in my browser (Safari).


For example, using UTF-8



produces nothing but repeating   (black diamond with question mark).

Where as:



Shows all the code-points correctly.

---

Using Western (ISO Latin 1)

http://luden.se/test/t-1252.html

is correct, but



is gibberish.


---
Using Western (Mac OS Roman)

http://luden.se/test/t-1252.html

is almost correct (it has an Apple logo).

and



is gibberish.

--

So, the browser wars move on to text encoding.

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-07 Thread Zoltán Németh
2008. 01. 7, hétfő keltezéssel 10.29-kor tedd ezt írta:
> At 12:03 PM +0100 1/7/08, Nisse Engström wrote:
> >How does the following pages compare? The display
> >should be identical:
> >
> >
> >
> 
> Nisse:
> 
> No, there is quite a difference depending upon 
> the text encoding used in my browser (Safari).
> 
> For example, using UTF-8
> 
> 
> 
> produces nothing but repeating   (black diamond with question mark).
> 
> Where as:
> 
> 
> 
> Shows all the code-points correctly.
> 
> ---
> 
> Using Western (ISO Latin 1)
> 
> http://luden.se/test/t-1252.html
> 
> is correct, but
> 
> 
> 
> is gibberish.
> 
> 
> ---
> Using Western (Mac OS Roman)
> 
> http://luden.se/test/t-1252.html
> 
> is almost correct (it has an Apple logo).
> 
> and
> 
> 
> 
> is gibberish.
> 
> --

however, on firefox with encoding auto-detection both page looks
correctly and the same.

greets
Zoltán Németh

> 
> So, the browser wars move on to text encoding.
> 
> Cheers,
> 
> tedd
> 
> -- 
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
> 

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



[PHP] utf-8 in $_POST

2008-01-07 Thread Olav Mørkrid
hello

does php have any built-in functions to convert post data from
whatever format it arrives in to whatever format i wish?

example:

i use iso-8859-1 internally, and even specify
accept-charset=iso-8859-1 in my html, but some browsers (phones) send
utf-8 anyway.

do i have to manually check if CONTENT_TYPE says "utf-8" and then
convert the $_POST array elements one by one, or does php have any
built-in functions to ease this?

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



Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-07 Thread Robert Cummings
All of these look the same for me in Opera under Linux. Character sets
are not a browser war issue, they're a character set/font issue. Just
because a character set supports a character, doesn't mean the character
font exists.

Cheers,
Rob.


On Mon, 2008-01-07 at 10:29 -0500, tedd wrote:
> At 12:03 PM +0100 1/7/08, Nisse Engström wrote:
> >How does the following pages compare? The display
> >should be identical:
> >
> >
> >
> 
> Nisse:
> 
> No, there is quite a difference depending upon 
> the text encoding used in my browser (Safari).
> 
> For example, using UTF-8
> 
> 
> 
> produces nothing but repeating   (black diamond with question mark).
> 
> Where as:
> 
> 
> 
> Shows all the code-points correctly.
> 
> ---
> 
> Using Western (ISO Latin 1)
> 
> http://luden.se/test/t-1252.html
> 
> is correct, but
> 
> 
> 
> is gibberish.
> 
> 
> ---
> Using Western (Mac OS Roman)
> 
> http://luden.se/test/t-1252.html
> 
> is almost correct (it has an Apple logo).
> 
> and
> 
> 
> 
> is gibberish.
> 
> --
> 
> So, the browser wars move on to text encoding.
> 
> Cheers,
> 
> tedd
> 
> -- 
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
> 
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] PHTML files showing as blank pages

2008-01-07 Thread Andy Smith

Hi All,

 Ok, I have resolved the problem! Interestingly from the index.phtml page I 
was still unable to get any info even
after setting the display errors options as suggested by Brady. I tried 
connecting direct to some other random
.phtml files included in the CDRTool app and I started getting errors 
regarding missing files. The solution turned
out that there were many "pear" module dependencies that weren't mentioned 
in the installation and requirements
documents for CDRTool (which simply stated PHP was required). Anyway I added 
the modules one by one
depending on the error message I was seeing and now I can connect to the 
index.phtml page too.


Thanks to those who replied,

cheers Andy.

- Original Message - 
From: "Brady Mitchell" <[EMAIL PROTECTED]>

To: "A.smith" <[EMAIL PROTECTED]>
Cc: 
Sent: Sunday, January 06, 2008 12:37 AM
Subject: Re: [PHP] PHTML files showing as blank pages




On Jan 5, 2008, at 639AM, A.smith wrote:
 I'm having a problem getting .phtml files to display in a web  browser. 
I
can successfully display a test.php page as per PHP install  instructions 
but

the phtml files show up blank
(in firefox or IE).


A blank page often means that there's an error of some kind, but error 
reporting is turned off.


Put the following code in the file that's giving you problems to turn  on 
errors, then reload the file in your browser to see what you get:


ini_set('display_errors',1);

Brady


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



Re: [PHP] utf-8 in $_POST

2008-01-07 Thread [EMAIL PROTECTED]

Olav Mørkrid wrote:

hello

does php have any built-in functions to convert post data from
whatever format it arrives in to whatever format i wish?

example:

i use iso-8859-1 internally, and even specify
accept-charset=iso-8859-1 in my html, but some browsers (phones) send
utf-8 anyway.

do i have to manually check if CONTENT_TYPE says "utf-8" and then
convert the $_POST array elements one by one, or does php have any
built-in functions to ease this?


That's interesting question.

Do you generate the pages, respectively do you specify something like this -



My experience is that this does not affect only the displayed 
characters, but the way the form fields are transported.


But perhaps I am wrong,
Iv

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



Re: [PHP] utf-8 in $_POST

2008-01-07 Thread mike
> 
>
> My experience is that this does not affect only the displayed
> characters, but the way the form fields are transported.
>
> But perhaps I am wrong,
> Iv

This works for me as well.

Put in utf-8 and you should be good to go.

You don't -technically- need to even change your database fields or
anything; MySQL will take the utf-8 content and treat it like normal
binary content.

(However, if you want to modify the data in MySQL, then you might want
to make sure you have all the right character sets and stuff...)

I've had 100% success with just inserting and selecting info back and
forth from MySQL and displaying it on the page, with the proper 
tag. Works like a charm in all languages attempted - English, Chinese
(both Simplified and Traditional), Russian, etc... it will look funky
if you view it directly in MySQL command line client or if you forget
the utf-8 tag though (unless your TERM + column and connection is set
properly)

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



[PHP] iphone.facebook.com PHP inquiry

2008-01-07 Thread Steve Finkelstein
Hi folks,

Probably the most impressive application I've run into for the iPhone has to
be Facebook's implementation. I'm looking for ways to improve my application
to be as responsive as theirs. Unfortunately it has quite a way to go. Does
anyone know how this form of 'routing' works?

For instance the home page for iphone.facebook.com looks something like:

http://iphone.facebook.com/#home.php

then if you click on profile it'll route you to something that looks like

http://iphone.facebook.com/#profile.php?id=

Is this actually 'leaving' the page and requesting profile.php? I'm
completely confused with the hash mark in front of the PHP file and the
mechanics behind this style. It seems to be extremely well implemented
though and I'd like to learn more about it. I'm having a ton of issues with
my application now where Ajax calls randomly do not get sent to the server.
I haven't figured out why, maybe mobile safari is caching request URLs. But
I'm looking to rebuild parts of the architecture to get it to work, and
would love to understand the mechanism being used above.

Does anyone know what is going on with the browser and HTTP requests with
the methodology listed above? Any further reading?

Thanks!

- sf


Re: [PHP] iphone.facebook.com PHP inquiry

2008-01-07 Thread mike
It's probably using IUI (the iPhone UI CSS/JS that Joe Hewitt created,
now being maintained at http://code.google.com/p/iui/) which allows
you to request the page to be loaded via AJAX based on how you setup
the link.

this will load via AJAX

this will load like a normal page link

This is how I *believe* it works, I just implemented IUI partially on
a site at work a few days ago and the final thing for me to work out
the kinks is whether or not to load certain pages using the AJAX
method (and show the cute little "loading" circle thing) or reload the
entire page.

Remember it's all just Javascript trickery with CSS that works great
on Safari browsers (and works almost identical actually now in
Firefox...)

It's very easy to implement, I had some initial confusion too how it
routes the requests but I think I figured it out there ^^



On 1/7/08, Steve Finkelstein <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> Probably the most impressive application I've run into for the iPhone has to
> be Facebook's implementation. I'm looking for ways to improve my application
> to be as responsive as theirs. Unfortunately it has quite a way to go. Does
> anyone know how this form of 'routing' works?
>
> For instance the home page for iphone.facebook.com looks something like:
>
> http://iphone.facebook.com/#home.php
>
> then if you click on profile it'll route you to something that looks like
>
> http://iphone.facebook.com/#profile.php?id=
>
> Is this actually 'leaving' the page and requesting profile.php? I'm
> completely confused with the hash mark in front of the PHP file and the
> mechanics behind this style. It seems to be extremely well implemented
> though and I'd like to learn more about it. I'm having a ton of issues with
> my application now where Ajax calls randomly do not get sent to the server.
> I haven't figured out why, maybe mobile safari is caching request URLs. But
> I'm looking to rebuild parts of the architecture to get it to work, and
> would love to understand the mechanism being used above.
>
> Does anyone know what is going on with the browser and HTTP requests with
> the methodology listed above? Any further reading?
>
> Thanks!
>
> - sf
>

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



Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-07 Thread tedd

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

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] iphone.facebook.com PHP inquiry

2008-01-07 Thread Steve Finkelstein
Thanks for the reply Mike.

I suppose ultimately I'd need to dig into the JavaScript (hopefully it's not
compressed) to figure out the PHP routing. I believe re-writing my
application with the framework would be quite extensive and just not
feasible at this particular point in time, although I should consider it in
the future if my application remains problematic and this is a solid
solution. The concept of calling back-end code via anchor tags though is
something I've never seen.

- sf

On 1/7/08, mike <[EMAIL PROTECTED]> wrote:
>
> It's probably using IUI (the iPhone UI CSS/JS that Joe Hewitt created,
> now being maintained at http://code.google.com/p/iui/) which allows
> you to request the page to be loaded via AJAX based on how you setup
> the link.
>
> this will load via AJAX
>
> this will load like a normal page
> link
>
> This is how I *believe* it works, I just implemented IUI partially on
> a site at work a few days ago and the final thing for me to work out
> the kinks is whether or not to load certain pages using the AJAX
> method (and show the cute little "loading" circle thing) or reload the
> entire page.
>
> Remember it's all just Javascript trickery with CSS that works great
> on Safari browsers (and works almost identical actually now in
> Firefox...)
>
> It's very easy to implement, I had some initial confusion too how it
> routes the requests but I think I figured it out there ^^
>
>
>
> On 1/7/08, Steve Finkelstein <[EMAIL PROTECTED]> wrote:
> > Hi folks,
> >
> > Probably the most impressive application I've run into for the iPhone
> has to
> > be Facebook's implementation. I'm looking for ways to improve my
> application
> > to be as responsive as theirs. Unfortunately it has quite a way to go.
> Does
> > anyone know how this form of 'routing' works?
> >
> > For instance the home page for iphone.facebook.com looks something like:
> >
> > http://iphone.facebook.com/#home.php
> >
> > then if you click on profile it'll route you to something that looks
> like
> >
> > http://iphone.facebook.com/#profile.php?id=
> >
> > Is this actually 'leaving' the page and requesting profile.php? I'm
> > completely confused with the hash mark in front of the PHP file and the
> > mechanics behind this style. It seems to be extremely well implemented
> > though and I'd like to learn more about it. I'm having a ton of issues
> with
> > my application now where Ajax calls randomly do not get sent to the
> server.
> > I haven't figured out why, maybe mobile safari is caching request URLs.
> But
> > I'm looking to rebuild parts of the architecture to get it to work, and
> > would love to understand the mechanism being used above.
> >
> > Does anyone know what is going on with the browser and HTTP requests
> with
> > the methodology listed above? Any further reading?
> >
> > Thanks!
> >
> > - sf
> >
>


Re: [PHP] iphone.facebook.com PHP inquiry

2008-01-07 Thread mike
It's -very- easy to use.

Just strip your pages down and let the device do a lot of the work
(via the IUI CSS/JS) - I converted our WordPress-based site in maybe
15-20 minutes on my first try.

It was tricky when loading up the subpages, I figured out the
difference between the full-loading pages and the AJAX-requested
pages. The AJAX ones you don't call a header/footer - that seems to
make the device "ignore" the page load. So those pages loaded via
simple ajax call should be just a page fragment
essentially; it replaces the body of the page, but not the entire
page.


On 1/7/08, Steve Finkelstein <[EMAIL PROTECTED]> wrote:
> Thanks for the reply Mike.
>
> I suppose ultimately I'd need to dig into the JavaScript (hopefully it's not
> compressed) to figure out the PHP routing. I believe re-writing my
> application with the framework would be quite extensive and just not
> feasible at this particular point in time, although I should consider it in
> the future if my application remains problematic and this is a solid
> solution. The concept of calling back-end code via anchor tags though is
> something I've never seen.
>
> - sf
>
>
> On 1/7/08, mike <[EMAIL PROTECTED]> wrote:
> > It's probably using IUI (the iPhone UI CSS/JS that Joe Hewitt created,
> > now being maintained at http://code.google.com/p/iui/) which allows
> > you to request the page to be loaded via AJAX based on how you setup
> > the link.
> >
> > this will load via AJAX
> >
> > this will load like a normal page
> link
> >
> > This is how I *believe* it works, I just implemented IUI partially on
> > a site at work a few days ago and the final thing for me to work out
> > the kinks is whether or not to load certain pages using the AJAX
> > method (and show the cute little "loading" circle thing) or reload the
> > entire page.
> >
> > Remember it's all just Javascript trickery with CSS that works great
> > on Safari browsers (and works almost identical actually now in
> > Firefox...)
> >
> > It's very easy to implement, I had some initial confusion too how it
> > routes the requests but I think I figured it out there ^^
> >
> >
> >
> > On 1/7/08, Steve Finkelstein <[EMAIL PROTECTED]> wrote:
> > > Hi folks,
> > >
> > > Probably the most impressive application I've run into for the iPhone
> has to
> > > be Facebook's implementation. I'm looking for ways to improve my
> application
> > > to be as responsive as theirs. Unfortunately it has quite a way to go.
> Does
> > > anyone know how this form of 'routing' works?
> > >
> > > For instance the home page for iphone.facebook.com looks something like:
> > >
> > > http://iphone.facebook.com/#home.php
> > >
> > > then if you click on profile it'll route you to something that looks
> like
> > >
> > > http://iphone.facebook.com/#profile.php?id=
> > >
> > > Is this actually 'leaving' the page and requesting profile.php? I'm
> > > completely confused with the hash mark in front of the PHP file and the
> > > mechanics behind this style. It seems to be extremely well implemented
> > > though and I'd like to learn more about it. I'm having a ton of issues
> with
> > > my application now where Ajax calls randomly do not get sent to the
> server.
> > > I haven't figured out why, maybe mobile safari is caching request URLs.
> But
> > > I'm looking to rebuild parts of the architecture to get it to work, and
> > > would love to understand the mechanism being used above.
> > >
> > > Does anyone know what is going on with the browser and HTTP requests
> with
> > > the methodology listed above? Any further reading?
> > >
> > > Thanks!
> > >
> > > - sf
> > >
> >
>
>

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



[PHP] is_executable() ???

2008-01-07 Thread Al

clearstatcache();
if(is_executable(PATH_TO_SOURCE_DIR . $filename)
{
code
}

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

And even if I feed it a non existing file.

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?

I'm on a NIX with Apache, etc.

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



Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-07 Thread tedd

At 10:41 AM -0500 1/7/08, Robert Cummings wrote:
Character setsare not a browser war issue, 
they're a character set/font issue. Just

because a character set supports a character, doesn't mean the character
font exists.

Cheers,
Rob.


Rob:

What I meant by "browser wars" was that there is 
a different between how browsers render different 
text encodings -- this is a fact -- there is a 
difference. For example, the "Extended" ASCII 
codes (never approved by ASCII) shows many 
characters differently depending on browser 
encoding. Apple even has it's own logo appearing 
for DEC 240 (F0 HEX) for it's encoding. I can 
provide even more examples of differences if 
necessary, but one should be enough.


Additionally, browsers absolutely render urls 
differently depending on encoding. Just look at 
the IDNS  encoding PUNYCODE for that -- here's 
proof:


http://xn--19g.com

In Safari (both Mac and Windows) the url will be 
shown as ˆ.com (square root dot dom) whereas in 
IE (all versions) it will be show in PUNYCODE, 
namely xn--19g.com


Note -- both OS's clearly have the square root 
symbol in their font set. So this is NOT an issue 
of IF the character exist within the font 
(charset) because the character IS present.


I know the reasons behind their decisions to do 
what they did, but the fact remains there is a 
difference, as I said.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



[PHP] global address collection

2008-01-07 Thread tedd

Hi:

What would be a good form (i.e., fields) for collecting global 
addresses and phone numbers?


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?


Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] utf-8 in $_POST

2008-01-07 Thread Olav Mørkrid
i specify iso-8859-1 in both header and body:




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"

i was just wondering if php had some setting or function that would
make it auto-convert $_POST data into one specific encoding. 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);
}

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



Re: [PHP] global address collection

2008-01-07 Thread Nathan Nobbe
On Jan 7, 2008 1:13 PM, tedd <[EMAIL PROTECTED]> wrote:

> Hi:
>
> What would be a good form (i.e., fields) for collecting global
> addresses and phone numbers?
>
> 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?


i once had to assemble a mapping between several proprietary systems
address conventions and a domestic standard.  i far as i recall, i found the
'official' info on the usps site.
i spent a couple of minutes looking there just now; although i found nothing
on international standards or recommendations, but further searching may
yield something useful.

-nathan


Re: [PHP] utf-8 in $_POST

2008-01-07 Thread mike
maybe look at iconv functions

but the  content-type is the only thing i set, and it works 100%
fine. all javascripts, forms, etc. inherit it from the looks of it
properly.

On 1/7/08, Olav Mørkrid <[EMAIL PROTECTED]> wrote:
> i specify iso-8859-1 in both header and body:
>
> 
> 
>
> 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"
>
> i was just wondering if php had some setting or function that would
> make it auto-convert $_POST data into one specific encoding. 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);
> }
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP] ./configure APC problems with 3.0.16 and what happened to --enable-apc-pthreadmutex???

2008-01-07 Thread steve
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???

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



[PHP] Re: ./configure APC problems with 3.0.16 and what happened to --enable-apc-pthreadmutex???

2008-01-07 Thread steve
I take it back.. if I use  --enable-apc-pthreadmutex I get file locks,
but if I don't use the option at all, I get pthreadmutexes. I'm
guessing pthead became the new default?

On Jan 7, 2008 1:59 PM, steve <[EMAIL PROTECTED]> 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???
>

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



Re: [PHP] global address collection

2008-01-07 Thread Richard Heyes
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



Re: [PHP] is_executable() ???

2008-01-07 Thread Chris

Al wrote:

clearstatcache();
if(is_executable(PATH_TO_SOURCE_DIR . $filename)
{
code
}

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

And even if I feed it a non existing file.


Really?



file exists:
is exec:


Check the permissions on those files through ftp or ssh. Are they 755 or 
are they 644 ?


If they are 755 (or 775 or 777) then they are actually executable files. 
Whether you get a valid result from that or not is entirely separate but 
in *nix you could make a .txt file executable and it won't care.


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

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



Re: [PHP] is_executable() ???

2008-01-07 Thread Richard Lynch
is_executable() does not check whether a file's contents will do
something useful (or dangerous, depending on one's viewpoint) when you
execute the file.

It just checks if the file has been set as "executable" with
http://php.net/chmod

ANY file with ANY extension, or NO extension at all, can be an
executable on Un*x systems.

Your uploaded files should be chmod-ed to NOT be executable, in
addition to trying to catch any invalid data contents.

On Mon, January 7, 2008 11:30 am, Al wrote:
> clearstatcache();
> if(is_executable(PATH_TO_SOURCE_DIR . $filename)
> {
> code
> }
>
> Always returns true for:
> foo.jpg
> foo.php
> foo.sh
>
> And even if I feed it a non existing file.
>
> 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?
>
> I'm on a NIX with Apache, etc.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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



[PHP] passing _GET values to _POST

2008-01-07 Thread Mary Anderson

Hi all,

   I have a screen get_collection.php which is supposed to be used to 
select something called 'data sets'.  My database (the postgres database 
is not the problem, PHP is) has an entity called 'data series' which has 
a child entity called 'data sets'.  The user is first shown a list of 
all the data series.  He selects a subset and pushes a submit button. 
The database supplies the names of the children of the selected data 
series, which are then displayed in the scrolling list called 'data sets'.


   My problem is getting the various screens in my application to talk 
to each other.   I have another screen called edit_reference.php which 
is used to edit a reference with an id re_reference_id.  Midway through 
this screen I want to link the reference of re_reference_id to data 
series and data sets chosen by the user by following a link from 
edit_reference.php to get_collection.php.


   I thought I could just give re_reference_id to get_collection as an 
url variable.  Unfortunately, this doesn't work.  Pushing the submit 
button to actually select the data series of interest causes the $_GET 
to be forgotten.  Printing the value of re_reference_id in a hidden 
inpput field -- which I thought for sure would end up in the $_POST 
array when I hit the get_data_series submit button doesn't work either.

Neither does just saying $_POST['re_reference_id'] = $re_reference_id.

   Probably I should be using session variables here.  But I think they 
will have their own problems since they will be written on 
edit_reference.php, remembered long after the call to get_collections, 
and may cause trouble later.



My page is

http://www.demog.berkeley.edu/~maryfran/memdev/get_collection.php?re_reference_id=74

I am going to attach the php code and hope it makes it through.

Mary Anderson


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

Re: [PHP] utf-8 in $_POST

2008-01-07 Thread Larry Garfield
I have to ask... WHY are you forcing ISO-8859-1?  If anything, you should be 
forcing UTF-8.  Then you can send, receive, and store data in UTF-8 ad cover 
most human languages without having to change character set.  

On Monday 07 January 2008, Olav Mørkrid wrote:
> i specify iso-8859-1 in both header and body:
>
> 
> 
>
> 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"
>
> i was just wondering if php had some setting or function that would
> make it auto-convert $_POST data into one specific encoding. 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);
> }


-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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



Re: [PHP] passing _GET values to _POST

2008-01-07 Thread Richard Lynch
On Mon, January 7, 2008 7:20 pm, Mary Anderson wrote:

EVERY http request is totally separate and independent of any other
http request, unless YOU specifically code something in the URL or
SESSION to tie them together.

> I thought I could just give re_reference_id to get_collection as
> an
> url variable.

You could, but it would have to be part of the ACTION="..." URL in
order to get passed on to the next HTTP request.

>  Unfortunately, this doesn't work.  Pushing the submit
> button to actually select the data series of interest causes the $_GET
> to be forgotten.  Printing the value of re_reference_id in a hidden
> inpput field -- which I thought for sure would end up in the $_POST
> array when I hit the get_data_series submit button doesn't work
> either.

This should have worked.

Review it and see what is in $_POST with:


> Neither does just saying $_POST['re_reference_id'] = $re_reference_id.

You can do that in the first script, but it won't affect the next one.

And it's probably a Bad Idea to cram things into $_POST or other
built-ins, as a matter of style.

> Probably I should be using session variables here.  But I think
> they
> will have their own problems since they will be written on
> edit_reference.php, remembered long after the call to get_collections,
> and may cause trouble later.

You would have to be sure that you give meaninful shelf-life and names
to the data you choose to put in $_SESSION, and not twist yourself
into knots by snarling up your own data...

But it works a treat if you plan that part out.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] is_executable() ???

2008-01-07 Thread Anup Shukla

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

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



Re: [PHP] Byte Size of an array

2008-01-07 Thread Chris

Sancar Saran wrote:

Hello,

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



echo strlen(serialize($array));


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

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



Re: [PHP] how can i use zend framework view helper in smarty?

2008-01-07 Thread Chris
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/

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



Re: [PHP] Float Value Parse Problem

2008-01-07 Thread Chris

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/

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



Re: [PHP] ./configure APC problems with 3.0.16 and what happened to --enable-apc-pthreadmutex???

2008-01-07 Thread Chris

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/

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