[PHP] Re: Re: Re: Frustrated trying to get help from your site

2006-10-06 Thread Michelle Konzack
Am 2006-10-03 22:39:39, schrieb David Robley:

 You surely don't mean the tracked vehicle that was used to transport the
 missiles? How the #%@ can you register and drive something like that.
 Boggle!

You go to the TÜV and change the 88 tons to 44 tons and you are
done. It works perfectly in germany but In France you will go in
prison, since the cabine of the vihicule us bulletproof and french
police office can not shoot you.  :-P

But since my Truck is registered in germany, I do not care about
french laws...  I have enough of french bullshit including the
interdiction to use Bio-Diesel...  I have 4000 liter of it On-Board
since it is 60% of the price of Diesel/Gasoil

Note:   My whole Truck is Linux-Driven and I can admin/maintain
my two 750HP engines plus Solarpanels over a php5-
intercace...  including statistics and much more!

Since PHP5 I have gotten the real power of PHP...

Greetings
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 MSM LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)

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



[PHP] mail delivery

2006-10-06 Thread Ross
Is there anyway to setup a mail delivery with mail() or phpmailer?

I send out a mass mail and some get returned but there is no message who 
they are being returned from.

usually you get something like.


This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  [EMAIL PROTECTED]


Ross

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



[PHP] PHP4 static properties - PEAR vs my solution

2006-10-06 Thread Hodicska Gergely

Hi!


I had a little discussion on a forum topic about static class method and
properties. Somebody there pointed to the PEAR::getStaticProperty()
solution to emulate static properties in PHP4. I was not familiar with
it but its approach seems a little strange for me. It is not really more
than storing static properties in a global array.

I tried to make something better and come out with this solutions, which
I think is much more closer to the philosophy of a static property and
maybe is more elegant (of course this is subjective :)).

I'm curious about your opinion.


Regards,
Felhő
-
?php
class base
{
function staticProperty($name, $value = null)
{
static $properties = array();

if (func_num_args() == 2) {
$properties[$name] = $value;
return $properties[$name];
} else {
if (array_key_exists($name, $properties)) {
return $properties[$name];
} else {
$php4_4suck = null;
return $php4_4suck;
}
}
}
}


class foo extends base
{
}

class bar extends base
{
}


foo::staticProperty('foo', 'foo');
var_dump(bar::staticProperty('foo')); // NULL
bar::staticProperty('foo', 'bar');
var_dump(bar::staticProperty('foo')); // bar


$foo = new foo();
var_dump($foo-staticProperty('foo'));  // foo
$bar = new bar();
var_dump($bar-staticProperty('foo')); // bar


$fooStaticProp = foo::staticProperty('foo');
$fooStaticProp = 'fooChanged';
var_dump($foo-staticProperty('foo')); // fooChanged
?

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



[PHP] PHP4 static properties - PEAR vs my solution

2006-10-06 Thread Hodicska Gergely

Hi!


I had a little discussion on a forum topic about static class method and
properties. Somebody there pointed to the PEAR::getStaticProperty()
solution to emulate static properties in PHP4. I was not familiar with
it but its approach seems a little strange for me. It is not really more
than storing static properties in a global array.

I tried to make something better and come out with this solutions, which
I think is much more closer to the philosophy of a static property and
maybe is more elegant (of course this is subjective :)).

I'm curious about your opinion.


Regards,
Felhő
-
?php
class base
{
function staticProperty($name, $value = null)
{
static $properties = array();

if (func_num_args() == 2) {
$properties[$name] = $value;
return $properties[$name];
} else {
if (array_key_exists($name, $properties)) {
return $properties[$name];
} else {
$php4_4suck = null;
return $php4_4suck;
}
}
}
}


class foo extends base
{
}

class bar extends base
{
}


foo::staticProperty('foo', 'foo');
var_dump(bar::staticProperty('foo')); // NULL
bar::staticProperty('foo', 'bar');
var_dump(bar::staticProperty('foo')); // bar


$foo = new foo();
var_dump($foo-staticProperty('foo'));  // foo
$bar = new bar();
var_dump($bar-staticProperty('foo')); // bar


$fooStaticProp = foo::staticProperty('foo');
$fooStaticProp = 'fooChanged';
var_dump($foo-staticProperty('foo')); // fooChanged
?

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



[PHP] Re: socket https.

2006-10-06 Thread Jo�o C�ndido de Souza Neto
I made it works fine using fsockopen.

Thanks a lot guys.


João Cândido de Souza Neto [EMAIL PROTECTED] escreveu na 
mensagem news:[EMAIL PROTECTED]
 Hi everybody.

 I must to connect a https server by a fsockopen but it seems not working.

 I´ve got openssl instaled in my php and when i run the follow line.

 $sock = fsockopen(ssl://wwws.aymorefinanciamentos.com.br, 80, $errno, 
 $errstr, 30);

 My var $sock returns false without any error string.

 Could anyone help me?

 -- 
 João Cândido de Souza Neto
 Curitiba Online
 [EMAIL PROTECTED]
 (41) 3324-2294 (41) 9985-6894
 http://www.curitibaonline.com.br 

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



RE: [PHP] Unicode Problem

2006-10-06 Thread tedd

At 7:11 PM -0700 10/5/06, Robbert van Andel wrote:

I know it's Unicode because the javascript is encoding it as Unicode (and
it's doing so correctly).  I guess the gist of my question is how to do I do
a reverse.  How do I take %u2022 and get make that display as the bullet
character?


Robbert:

To display it in a browser, convert the number to DEC (2022-8226) and use:

#8226;

I thought there was a way to use HEX directly, but can't find the 
reference at the moment (if there is one).


hth's

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] mail delivery

2006-10-06 Thread Richard Lynch
On Fri, October 6, 2006 6:18 am, Ross wrote:
 Is there anyway to setup a mail delivery with mail() or phpmailer?

 I send out a mass mail and some get returned but there is no message
 who
 they are being returned from.

 usually you get something like.


 This message was created automatically by mail delivery software.

 A message that you sent could not be delivered to one or more of its
 recipients. This is a permanent error. The following address(es)
 failed:

   [EMAIL PROTECTED]

The To: line of that failed email tells you where the original came
From:

And then, well, it's a right old mess with all the different formats
of the body to work out exactly what went wrong.

What exactly are you trying to do?

Cuz there are quite a few mailing list software packages already out
there in PHP and other languages...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] PHP4 static properties - PEAR vs my solution

2006-10-06 Thread Richard Lynch
On Fri, October 6, 2006 7:22 am, Hodicska Gergely wrote:
 I'm curious about your opinion.

   class base
   {
   function staticProperty($name, $value = null)
   {
   static $properties = array();

This would be Really Nifty, if PHP allowed multiple inheritence so you
could have a mixin class...

Otherwise, however, you have to have a common base class across all
the various class systems in use in your multitude of web
applications, or duplicate the code (ugh!) in each.

So if you have a single base class to throw this into, it's great.

If you have a plethora of code-bases you work with, the global
variable hack is probably more suitable.

YMMV

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] Help on objects

2006-10-06 Thread Richard Lynch
On Thu, October 5, 2006 2:55 pm, Satyam wrote:
   - Original Message -
   From: Martin Alterisio
   To: Satyam
   Cc: Deckard ; php-general@lists.php.net
   You're wrong, partially:

 I am sure you could have stated that in a more courteous way.

So, this Argentinian, Italian, and European walk into a mailing list...

:-) :-) :-)

Language constructs in English are probably not the best thing to
flame about on this list...

Back to the curly braces!
{?php echo $var1: $var2?}

Sorry. Couldn't resist.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] Unicode Problem

2006-10-06 Thread Richard Lynch
On Thu, October 5, 2006 5:14 pm, [EMAIL PROTECTED] wrote:
 I have a webpage that allows users to post news stories for their
 department.  The site uses AJAX to send the data to the webserver.
 The problem I'm having is when the user uses some unicode characters
 like bullets or MS Word quotes, the page comes out weird.

I don't think MS Word quotes are Unicode, really...

I think they're just made-up character sets that Microsoft felt like
using to be incompatible with everybody else...

There are about 5 different translations functions at
http://php.net/str_replace, last time I checked -- but those assumed
the user was just typing stuff in a FORM, and does not include your JS
escaping...

I *hope* it's the same thing, really, but can't promise.

You're going to have to investigate what the JS escape mechanism is
doing -- It could be any of a variety of things.

Though the %u is almost-for-sure and ATTEMPT to apply Unicode
conversion, that doesn't mean that the original content was really
Unicode to start with.

So after you undo the Unicode conversion, you've still potentially
got data on your hands from a proprietary non-standards-based made-up
software application.

Apologies in advance if MS Word actually *is* using a standard Unicode
charset... But I sure doubt it.

 Here's the process.
 1. The user enters the story and clicks save.
 2. The javascript uses the escape function to turn the text into
 something that can be posted to the server.  This function turns
 spaces into %20, but it turns unicode characters into a longer string
 like %u.
 3. The javascript then sends the data to the processing page.
 4. The PHP processing page receives the data and saves it to the mySQL
 database server.

 The problem I see is that any unicode character is saved in it's
 escaped unicode sequence.  For example a bullet is saved into the
 database as a literal %u2022.  What I need to know is what function
 can I use so that it's either saved as the unicode bullet character or
 displayed back on the page as the bullet?


-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] Unicode Problem

2006-10-06 Thread Richard Lynch
I can take ANY number I want, and put %u in front of it...

That don't make it mean anything.

You also need to know the charset it came from to start with, which in
the case of MS Word, is not even a standard charset, but some made-up
proprietary random assemblege of numbers to characters they found
convenient that day.

You also might want to consider using something like FCKEditor or that
other one like it to let users compose HTML-formatted content.

On Thu, October 5, 2006 9:11 pm, Robbert van Andel wrote:
 I know it's Unicode because the javascript is encoding it as Unicode
 (and
 it's doing so correctly).  I guess the gist of my question is how to
 do I do
 a reverse.  How do I take %u2022 and get make that display as the
 bullet
 character?

 -Original Message-
 From: Dotan Cohen [mailto:[EMAIL PROTECTED]
 Sent: Thursday, October 05, 2006 3:44 PM
 To: [EMAIL PROTECTED]
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] Unicode Problem

 On 06/10/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 I have a webpage that allows users to post news stories for their
 department.  The site uses AJAX to send the data to the webserver.
 The
 problem I'm having is when the user uses some unicode characters like
 bullets or MS Word quotes, the page comes out weird.

 Here's the process.
 1. The user enters the story and clicks save.
 2. The javascript uses the escape function to turn the text into
 something
 that can be posted to the server.  This function turns spaces into
 %20, but
 it turns unicode characters into a longer string like %u.
 3. The javascript then sends the data to the processing page.
 4. The PHP processing page receives the data and saves it to the
 mySQL
 database server.

 The problem I see is that any unicode character is saved in it's
 escaped
 unicode sequence.  For example a bullet is saved into the database as
 a
 literal %u2022.  What I need to know is what function can I use so
 that it's
 either saved as the unicode bullet character or displayed back on the
 page
 as the bullet?

 Thank you


 I doubt that MS Word quotes are unicode. And as long as the users are
 coping/ pasting between MS products (Word-IE) you're going to have a
 hard time deciphering those funny characters. Try to encourage them to
 use Firefox, and if possible to use a UTF-8 compliant word processor.
 Mine is Kword, but I don't think that's available for Windows.

 Dotan Cohen
 http://what-is-what.com
 98

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

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




-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] Unicode Problem

2006-10-06 Thread Richard Lynch
On Fri, October 6, 2006 8:37 am, tedd wrote:
 At 7:11 PM -0700 10/5/06, Robbert van Andel wrote:
I know it's Unicode because the javascript is encoding it as Unicode
 (and
it's doing so correctly).  I guess the gist of my question is how to
 do I do
a reverse.  How do I take %u2022 and get make that display as the
 bullet
character?

 Robbert:

 To display it in a browser, convert the number to DEC (2022-8226) and
 use:

 #8226;

 I thought there was a way to use HEX directly, but can't find the
 reference at the moment (if there is one).

http://php.net/hexdec

But #8226; is almost-for-sure *ONLY* going to look right on MS IE.

Because *only* MS IE uses the double-secret Microsoft decoder ring for
8226 to be what MS Word thinks it is.  Everybody else is using a
standards-based conversion...

So your page will look fine in IE, but everybody else will see all
kinds of goofy characters.

Test it and see -- I could be wrong...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] Re: PHP5 || Catch Error Send POST Vars...

2006-10-06 Thread Richard Lynch
On Thu, October 5, 2006 4:43 pm, sit1way wrote:
 I'd like to catch errors and send POST vars to my error display page.

 So:

 try {
 $r = new query($sql);

 if(!$r) {
  throw new Exception($err);
 }
 }
 catch (Exception $e) {
 $this-err_msg = $e-getMessage();

 /* somehow kick user to error display screen with POST vars */

require 'error_screen';
exit;

 ?
 }

Why would you chew up HTTP connections and bounce traffic
back-and-forth to just read a file off your own server's hard drive?

I never have understood that...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] Re: Really strange / TYPO

2006-10-06 Thread Richard Lynch
I dunno whose answer you were thinking of...

include_path('.:/var/www/html');

PHP will find it in /var/www/html

My answer was to set include_path correctly, and NOT attempt to hack
up some hard-coded mess in your PHP source.

On Thu, October 5, 2006 4:29 pm, Deckard wrote:
 Hi Richard,

 Thank you so much for your answer.

 dbInsert.php is in /var/www/html/classes while config.inc.php is in
 /var/www/html

 With your code, the file is always searched in /var/www/html/classes
 and
 not in /var/www/html

 Warm Regards,
 Deckard

 Richard Lynch wrote:
 On Thu, October 5, 2006 2:34 am, John Wells wrote:
 [code]
 // Consider *where* you create this
 // Define it as a constant if you'd like...
 define('BASE_PATH', dirname(__FILE__));

 // Now build the path, like (assuming it was created
 // in  a file located at /var/www/html
 include_once(BASE_PATH . '/config.inc.php');
 [/code]

 Gah!

 Now you've made it even HARDER to move the include files out of the
 web tree, or wherever is more convenient and safer.

 include_path is a much more powerful and flexible construct which
 will
 save you an inordinate amount of trouble if you just figure out how
 it
 works and use it...





-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] Re: Really strange / TYPO

2006-10-06 Thread Richard Lynch
On Thu, October 5, 2006 6:18 pm, John Wells wrote:
 On 10/5/06, Richard Lynch [EMAIL PROTECTED] wrote:
 include_path is a much more powerful and flexible construct which
 will
 save you an inordinate amount of trouble if you just figure out how
 it
 works and use it...

 Point well taken Richard, thanks.

 I've always been curious, iIs there a point in which adding some
 number of paths to include_path causes a performance hit?  If my
 application for example is spread out across 6 or 7 folders
 (controllers, models, library, plugins, scripts, etc etc), is it
 really better to shove all of those into include_path?

There is, of course, a performance hit, in that PHP searches for your
include file in each of those paths before it finds the one

Depending on server configuration, caching, and hardware, that could
be immesurably small for 6 or 7 paths, or it could be a Big Deal.

Only you can test on your hardware with your setup.

But I would dare to predict that for most users, the performance
difference is negligible because you are almost for sure not including
enough files to be causing enough operations for it to matter.

Sure, you can construct a benchmark to prove that there is a
performance difference.  But can you construct a real-world test with
peak load usage similar to real users that shows a meaningful
difference?  Cuz you don't really care about a benchmark about a
billion includes when your web app never does a billion includes...

If you have a directory that has most of the includes in it, put it
first, of course -- Surely that would be easy enough to do, and would
address any performance issue well enough for a real world setup.

Another option is to MAYBE consider combining some of those dirs, and
using a filename convention to make it clear which ones are model and
which are controller and which are library.

And, of course, if you are using a cache, then the search through
include_path is only done once per cache-fault.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] Detected a pattern that malfunctions includes

2006-10-06 Thread Deckard
Hi,

I see now that only when the inclu function has to scale up in the we
tree, it fails.

For example:

This works:
include_once(classes/database/dBInsert.php);

This don't:
include_once('../adodb/adodb.inc.php');

Any ideas ?

Warm Regards,
Deckard

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



Re: [PHP] Detected a pattern that malfunctions includes

2006-10-06 Thread Richard Lynch
On Fri, October 6, 2006 11:17 am, Deckard wrote:
 I see now that only when the inclu function has to scale up in the we
 tree, it fails.

 For example:

 This works:
 include_once(classes/database/dBInsert.php);

 This don't:
 include_once('../adodb/adodb.inc.php');

safe_mode and that other security restriction on what you can/can't
include do this, I think...

Which is probably hack to save you from somebody pushing
'../../../../../etc/passwd' into:
include $myfile;
but so it goes.

Meanwhile, back at the ranch, if you set include_path you'd be able to
move on to something productive :-) :-) :-)

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] Really strange

2006-10-06 Thread J?rgen Wind



Deckard wrote:
 
 Hi,
 
 I have this line of code:
 include_once('../config.inc.php');
 
 I'm 100% sure that the file config.inc.php is a directory up.
 
 config.inc.php is in /var/www/html
 and the file that calls it is in
 /var/www/html/classes
 
 nevertheless, i'm getting the error:
 Warning: main(../config.inc): failed to open stream: No such file or
 directory in /var/www/html/classes/dBInsert.php on line 10
 
 Warning: main(): Failed opening '../config.inc' for inclusion
 (include_path='.:/usr/share/pear') in /var/www/html/classes/dBInsert.php
 on line 10
 
 I'm boggled!
 
 Any help would be appreciated.
 
 Best Regards,
 Deckard
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
if you are using IIS read this:
http://support.microsoft.com/kb/332117/EN-US/


-- 
View this message in context: 
http://www.nabble.com/Really--strange-tf2385857.html#a6682604
Sent from the PHP - General mailing list archive at Nabble.com.

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



Re: [PHP] Detected a pattern that malfunctions includes

2006-10-06 Thread Deckard
Hi,

I've already set my include_path to /var/www/html and good :(

Best Regards,
Deckard

Richard Lynch wrote:
 On Fri, October 6, 2006 11:17 am, Deckard wrote:
 I see now that only when the inclu function has to scale up in the we
 tree, it fails.

 For example:

 This works:
 include_once(classes/database/dBInsert.php);

 This don't:
 include_once('../adodb/adodb.inc.php');
 
 safe_mode and that other security restriction on what you can/can't
 include do this, I think...
 
 Which is probably hack to save you from somebody pushing
 '../../../../../etc/passwd' into:
 include $myfile;
 but so it goes.
 
 Meanwhile, back at the ranch, if you set include_path you'd be able to
 move on to something productive :-) :-) :-)
 

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



Re: [PHP] Really strange

2006-10-06 Thread J?rgen Wind





if you are using IIS read this:
http://support.microsoft.com/kb/332117/EN-US/



sorry , i overlooked '/var/www/html'
maybe the info is useful for someone else.
-- 
View this message in context: 
http://www.nabble.com/Really--strange-tf2385857.html#a6682765
Sent from the PHP - General mailing list archive at Nabble.com.

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



[PHP] if(), else() problem!

2006-10-06 Thread Rahul S. Johari
Ave,

code:

$db = dbase_open(osm.dbf, 0);
if ($db) {
  $record_numbers = dbase_numrecords($db);
  for ($i = 1; $i = $record_numbers; $i++) {
 $row = dbase_get_record_with_names($db, $i);
 if ($row['PHONE'] == $thekey) {
echo ³found²;
}
else {
echo ³not found²;
}
}
}

The loop reads each row in the database, and checks whether it matches
$thekey or not. If it does, it prints ³found², if it doesn¹t, it prints ³not
found². But this happens for ³each row² in the database. So if there are 100
records, and the program does find a match, I¹ll get 99 ³not found² printed,
and one ³found² printed.

I can easily put an ³exit;² after my echo in the else(), but then it stops
the loop, and doesn¹t go any further.

What do I have to do to get results if the phone matches, print nothing for
rows where it doesn¹t match, but give one single ³not found² if the phone
number does not exist in the database?

The logic is just failing me at this point.

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com



Re: [PHP] if(), else() problem!

2006-10-06 Thread Jo�o C�ndido de Souza Neto
Usen this:

echo ³not found²;
break;


Rahul S. Johari [EMAIL PROTECTED] escreveu na mensagem 
news:[EMAIL PROTECTED]
Ave,

code:

$db = dbase_open(osm.dbf, 0);
if ($db) {
  $record_numbers = dbase_numrecords($db);
  for ($i = 1; $i = $record_numbers; $i++) {
 $row = dbase_get_record_with_names($db, $i);
 if ($row['PHONE'] == $thekey) {
echo ³found²;
}
else {
echo ³not found²;
break;
}
}
}

The loop reads each row in the database, and checks whether it matches
$thekey or not. If it does, it prints ³found², if it doesn¹t, it prints ³not
found². But this happens for ³each row² in the database. So if there are 100
records, and the program does find a match, I¹ll get 99 ³not found² printed,
and one ³found² printed.

I can easily put an ³exit;² after my echo in the else(), but then it stops
the loop, and doesn¹t go any further.

What do I have to do to get results if the phone matches, print nothing for
rows where it doesn¹t match, but give one single ³not found² if the phone
number does not exist in the database?

The logic is just failing me at this point.

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



RE: [PHP] Unicode Problem

2006-10-06 Thread tedd

At 10:50 AM -0500 10/6/06, Richard Lynch wrote:

On Fri, October 6, 2006 8:37 am, tedd wrote:
  At 7:11 PM -0700 10/5/06, Robbert van Andel wrote:
  How do I take %u2022 and get make that display as the bullet
 character?
  I thought there was a way to use HEX directly, but can't find the

 reference at the moment (if there is one).


http://php.net/hexdec



Richard:

No, that's not what I meant. I know how to convert DEC - HEX.

What I was talking about is called a NCRs, or Numeric Character References

One could use the Unicode DEC value directly, such as:

#8226;

or the Unicode HEX value directly, such as:

#x2002;

Note, either will produce a bullet in most browsers.


But #8226; is almost-for-sure *ONLY* going to look right on MS IE.


Not true, for most (and all most current) browsers do render that 
glyph correctly (other glyphs may vary), please review:


http://www.browsercam.com/public.aspx?proj_id=289683

The first bullet is 149; (same as ALT 0149 on the windoze keyboard).

The second is #8226; and third is #x2002;

Note all three produce a bullet -- oh and don't forget bull;, which 
will produce the same result.


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] image protection

2006-10-06 Thread tedd

Hi gang:

What would be the best way to protect images in a directory from 
being harvested?


I know that when an image is shown to the user, while there are some 
javascript tricks to deter the user, there is no real way to stop the 
user from capturing the image, for they already have it.


But, is there a way to protect a directory such that an application 
such as SightSucker (nice program btw), can't retrieve it's 
contents, while your php script can?


Thanks.

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] if(), else() problem!

2006-10-06 Thread Jochem Maas
Rahul S. Johari wrote:
 Ave,
 
 code:
 
 $db = dbase_open(osm.dbf, 0);
 if ($db) {
   $record_numbers = dbase_numrecords($db);
   for ($i = 1; $i = $record_numbers; $i++) {
  $row = dbase_get_record_with_names($db, $i);
  if ($row['PHONE'] == $thekey) {
 echo ³found²;
 }
 else {
 echo ³not found²;
 }
 }
 }


$msg = 'cannot open database!';
if ($db = dbase_open(osm.dbf, 0)) {
$msg = 'database contains no records!';
if ($record_numbers = dbase_numrecords($db)) {
$msg = 'number not found';
for ($i = 1; $i = $record_numbers; $row = 
dbase_get_record_with_names($db, $i),$i++)
if ($row['PHONE'] == $thekey) { $msg = 'number found'; break; }
}
}
echo $msg;
// ^^^--- untested

 
 The loop reads each row in the database, and checks whether it matches
 $thekey or not. If it does, it prints ³found², if it doesn¹t, it prints ³not
 found². But this happens for ³each row² in the database. So if there are 100
 records, and the program does find a match, I¹ll get 99 ³not found² printed,
 and one ³found² printed.
 
 I can easily put an ³exit;² after my echo in the else(), but then it stops
 the loop, and doesn¹t go any further.
 
 What do I have to do to get results if the phone matches, print nothing for
 rows where it doesn¹t match, but give one single ³not found² if the phone
 number does not exist in the database?
 
 The logic is just failing me at this point.
 
 Rahul S. Johari
 Supervisor, Internet  Administration
 Informed Marketing Services Inc.
 500 Federal Street, Suite 201
 Troy NY 12180
 
 Tel: (518) 687-6700 x154
 Fax: (518) 687-6799
 Email: [EMAIL PROTECTED]
 http://www.informed-sources.com
 
 

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



Re: [PHP] if(), else() problem!

2006-10-06 Thread Rahul S. Johari

Just tried, isn't working! It's doing the same thing that exit; does.

Both

 else {
echo Not Found;
 break;
 }

And

 else {
echo Not Found;
 exit;
 }

Do the exact same thing. It will print not found (because it checks the
first row, and if the phone number is not in the first row), and basically
exit and not go further with the loop.


On 10/6/06 12:40 PM, João Cândido de Souza Neto
[EMAIL PROTECTED] wrote:

 Usen this:
 
 echo ³not found²;
 break;
 
 
 Rahul S. Johari [EMAIL PROTECTED] escreveu na mensagem
 news:[EMAIL PROTECTED]
 Ave,
 
 code:
 
 $db = dbase_open(osm.dbf, 0);
 if ($db) {
   $record_numbers = dbase_numrecords($db);
   for ($i = 1; $i = $record_numbers; $i++) {
  $row = dbase_get_record_with_names($db, $i);
  if ($row['PHONE'] == $thekey) {
 echo ³found²;
 }
 else {
 echo ³not found²;
 break;
 }
 }
 }
 
 The loop reads each row in the database, and checks whether it matches
 $thekey or not. If it does, it prints ³found², if it doesn¹t, it prints ³not
 found². But this happens for ³each row² in the database. So if there are 100
 records, and the program does find a match, I¹ll get 99 ³not found² printed,
 and one ³found² printed.
 
 I can easily put an ³exit;² after my echo in the else(), but then it stops
 the loop, and doesn¹t go any further.
 
 What do I have to do to get results if the phone matches, print nothing for
 rows where it doesn¹t match, but give one single ³not found² if the phone
 number does not exist in the database?
 
 The logic is just failing me at this point.
 

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



Re: [PHP] if(), else() problem!

2006-10-06 Thread Rahul S. Johari

Works like a charm!! I was trying something out with having a variable go
completely out of the functions  loops and print the not found message,
but I wasn't hitting it. You did!

// ^^^--- now tested ;)


On 10/6/06 1:52 PM, Jochem Maas [EMAIL PROTECTED] wrote:

 $msg = 'cannot open database!';
 if ($db = dbase_open(osm.dbf, 0)) {
 $msg = 'database contains no records!';
 if ($record_numbers = dbase_numrecords($db)) {
 $msg = 'number not found';
 for ($i = 1; $i = $record_numbers; $row =
 dbase_get_record_with_names($db, $i),$i++)
 if ($row['PHONE'] == $thekey) { $msg = 'number found'; break; }
 }
 }
 echo $msg;
 // ^^^--- untested
 

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



Re: [PHP] image protection

2006-10-06 Thread Eric Butera

On 10/6/06, tedd [EMAIL PROTECTED] wrote:

Hi gang:

What would be the best way to protect images in a directory from
being harvested?

I know that when an image is shown to the user, while there are some
javascript tricks to deter the user, there is no real way to stop the
user from capturing the image, for they already have it.

But, is there a way to protect a directory such that an application
such as SightSucker (nice program btw), can't retrieve it's
contents, while your php script can?

Thanks.

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





You could try http://alistapart.com/articles/hotlinking.

Another way that you could do it is setting a session variable on the
page that you know your images are going to be viewed from.  Then on
the script that your images are linked in through (via
page.php?image=x) check for that session variable.  At least with this
second method it forces the robot to accept a session cookie.

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



Re: [PHP] if(), else() problem!

2006-10-06 Thread Børge Holen
Why not check if $thekey is in the $db, then else echo not found?
seems all to much to do so little.

On Friday 06 October 2006 18:35, Rahul S. Johari wrote:
 Ave,

 code:

 $db = dbase_open(osm.dbf, 0);
 if ($db) {
   $record_numbers = dbase_numrecords($db);
   for ($i = 1; $i = $record_numbers; $i++) {
  $row = dbase_get_record_with_names($db, $i);
  if ($row['PHONE'] == $thekey) {
 echo ³found²;
 }
 else {
 echo ³not found²;
 }
 }
 }

 The loop reads each row in the database, and checks whether it matches
 $thekey or not. If it does, it prints ³found², if it doesn¹t, it prints
 ³not found². But this happens for ³each row² in the database. So if there
 are 100 records, and the program does find a match, I¹ll get 99 ³not found²
 printed, and one ³found² printed.

 I can easily put an ³exit;² after my echo in the else(), but then it stops
 the loop, and doesn¹t go any further.

 What do I have to do to get results if the phone matches, print nothing for
 rows where it doesn¹t match, but give one single ³not found² if the phone
 number does not exist in the database?

 The logic is just failing me at this point.

 Rahul S. Johari
 Supervisor, Internet  Administration
 Informed Marketing Services Inc.
 500 Federal Street, Suite 201
 Troy NY 12180

 Tel: (518) 687-6700 x154
 Fax: (518) 687-6799
 Email: [EMAIL PROTECTED]
 http://www.informed-sources.com

-- 
---
Børge
Kennel Arivene 
http://www.arivene.net
---

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



Re: [PHP] image protection

2006-10-06 Thread Børge Holen
lurkin' around trying to keep images from others, while still have them shown 
on yer own page seems a bit futile.
watermark 'em.
other stuff to do is use flash witch I've never done. (due to PPC 
restrictions)
I've done some of this auto open/close windowing js, witch also includes 
rightclick disable inside the window; inserting an 1x1 gif ontop, keeping ppl 
away from direct access of the opened php file with a check of witch location 
it was accessed from. Insert no-cache in the metadata.  This worked on every 
browser except Opera, witch have some option to disable JS without loosing 
focus from an window. whereas the gif came in handy This worked on none 
to eager ppl, while on the other hand; If this image popup was run one time. 
it could be used one time directly from the address bar due to the browser 
cache or the session in witch the script were accessed, dunno. Anyone know?

Say, stay with WM.

On Friday 06 October t2006 19:44, tedd wrote:
 Hi gang:

 What would be the best way to protect images in a directory from
 being harvested?

 I know that when an image is shown to the user, while there are some
 javascript tricks to deter the user, there is no real way to stop the
 user from capturing the image, for they already have it.

 But, is there a way to protect a directory such that an application
 such as SightSucker (nice program btw), can't retrieve it's
 contents, while your php script can?

 Thanks.

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

-- 
---
Børge
Kennel Arivene 
http://www.arivene.net
---

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



Re: [PHP] if(), else() problem!

2006-10-06 Thread Rahul S. Johari

Well, the actual script doesn't just print found number if the number
exists... It displays all the data from the database of that record, also
gives an interactive form to update the data and more.



On 10/6/06 3:25 PM, Børge Holen [EMAIL PROTECTED] wrote:

 Why not check if $thekey is in the $db, then else echo not found?
 seems all to much to do so little.
 
 On Friday 06 October 2006 18:35, Rahul S. Johari wrote:
 Ave,
 
 code:
 
 $db = dbase_open(osm.dbf, 0);
 if ($db) {
   $record_numbers = dbase_numrecords($db);
   for ($i = 1; $i = $record_numbers; $i++) {
  $row = dbase_get_record_with_names($db, $i);
  if ($row['PHONE'] == $thekey) {
 echo ³found²;
 }
 else {
 echo ³not found²;
 }
 }
 }
 
 The loop reads each row in the database, and checks whether it matches
 $thekey or not. If it does, it prints ³found², if it doesn¹t, it prints
 ³not found². But this happens for ³each row² in the database. So if there
 are 100 records, and the program does find a match, I¹ll get 99 ³not found²
 printed, and one ³found² printed.
 
 I can easily put an ³exit;² after my echo in the else(), but then it stops
 the loop, and doesn¹t go any further.
 
 What do I have to do to get results if the phone matches, print nothing for
 rows where it doesn¹t match, but give one single ³not found² if the phone
 number does not exist in the database?
 
 The logic is just failing me at this point.
 
 Rahul S. Johari
 Supervisor, Internet  Administration
 Informed Marketing Services Inc.
 500 Federal Street, Suite 201
 Troy NY 12180
 
 Tel: (518) 687-6700 x154
 Fax: (518) 687-6799
 Email: [EMAIL PROTECTED]
 http://www.informed-sources.com

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



Re: [PHP] if(), else() problem!

2006-10-06 Thread Børge Holen
On Friday 06 October 2006 21:45, Rahul S. Johari wrote:
 Well, the actual script doesn't just print found number if the number
 exists... It displays all the data from the database of that record, also
 gives an interactive form to update the data and more.

Yes, and my point is still valid. need only to fetch bits'n bytes where 
$thekey is located, leave the rest be.


 On 10/6/06 3:25 PM, Børge Holen [EMAIL PROTECTED] wrote:
  Why not check if $thekey is in the $db, then else echo not found?
  seems all to much to do so little.
 
  On Friday 06 October 2006 18:35, Rahul S. Johari wrote:
  Ave,
 
  code:
 
  $db = dbase_open(osm.dbf, 0);
  if ($db) {
$record_numbers = dbase_numrecords($db);
for ($i = 1; $i = $record_numbers; $i++) {
   $row = dbase_get_record_with_names($db, $i);
   if ($row['PHONE'] == $thekey) {
  echo ³found²;
  }
  else {
  echo ³not found²;
  }
  }
  }
 
  The loop reads each row in the database, and checks whether it matches
  $thekey or not. If it does, it prints ³found², if it doesn¹t, it prints
  ³not found². But this happens for ³each row² in the database. So if
  there are 100 records, and the program does find a match, I¹ll get 99
  ³not found² printed, and one ³found² printed.
 
  I can easily put an ³exit;² after my echo in the else(), but then it
  stops the loop, and doesn¹t go any further.
 
  What do I have to do to get results if the phone matches, print nothing
  for rows where it doesn¹t match, but give one single ³not found² if the
  phone number does not exist in the database?
 
  The logic is just failing me at this point.
 
  Rahul S. Johari
  Supervisor, Internet  Administration
  Informed Marketing Services Inc.
  500 Federal Street, Suite 201
  Troy NY 12180
 
  Tel: (518) 687-6700 x154
  Fax: (518) 687-6799
  Email: [EMAIL PROTECTED]
  http://www.informed-sources.com

 Rahul S. Johari
 Supervisor, Internet  Administration
 Informed Marketing Services Inc.
 500 Federal Street, Suite 201
 Troy NY 12180

 Tel: (518) 687-6700 x154
 Fax: (518) 687-6799
 Email: [EMAIL PROTECTED]
 http://www.informed-sources.com

-- 
---
Børge
Kennel Arivene 
http://www.arivene.net
---

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



Re: [PHP] if(), else() problem!

2006-10-06 Thread Rahul S. Johari

I'm not sure if I understand your point then! I have about 80 fields in that
database that are fetched and displayed on the page using this code. If
there's a simpler way to do this, and have it work the if() else() error as
well, I would love to know about it...


On 10/6/06 3:47 PM, Børge Holen [EMAIL PROTECTED] wrote:

 On Friday 06 October 2006 21:45, Rahul S. Johari wrote:
 Well, the actual script doesn't just print found number if the number
 exists... It displays all the data from the database of that record, also
 gives an interactive form to update the data and more.
 
 Yes, and my point is still valid. need only to fetch bits'n bytes where
 $thekey is located, leave the rest be.
 
 
 On 10/6/06 3:25 PM, Børge Holen [EMAIL PROTECTED] wrote:
 Why not check if $thekey is in the $db, then else echo not found?
 seems all to much to do so little.
 
 On Friday 06 October 2006 18:35, Rahul S. Johari wrote:
 Ave,
 
 code:
 
 $db = dbase_open(osm.dbf, 0);
 if ($db) {
   $record_numbers = dbase_numrecords($db);
   for ($i = 1; $i = $record_numbers; $i++) {
  $row = dbase_get_record_with_names($db, $i);
  if ($row['PHONE'] == $thekey) {
 echo ³found²;
 }
 else {
 echo ³not found²;
 }
 }
 }
 
 The loop reads each row in the database, and checks whether it matches
 $thekey or not. If it does, it prints ³found², if it doesn¹t, it prints
 ³not found². But this happens for ³each row² in the database. So if
 there are 100 records, and the program does find a match, I¹ll get 99
 ³not found² printed, and one ³found² printed.
 
 I can easily put an ³exit;² after my echo in the else(), but then it
 stops the loop, and doesn¹t go any further.
 
 What do I have to do to get results if the phone matches, print nothing
 for rows where it doesn¹t match, but give one single ³not found² if the
 phone number does not exist in the database?
 
 The logic is just failing me at this point.
 
 Rahul S. Johari
 Supervisor, Internet  Administration
 Informed Marketing Services Inc.
 500 Federal Street, Suite 201
 Troy NY 12180
 
 Tel: (518) 687-6700 x154
 Fax: (518) 687-6799
 Email: [EMAIL PROTECTED]
 http://www.informed-sources.com
 
 Rahul S. Johari
 Supervisor, Internet  Administration
 Informed Marketing Services Inc.
 500 Federal Street, Suite 201
 Troy NY 12180
 
 Tel: (518) 687-6700 x154
 Fax: (518) 687-6799
 Email: [EMAIL PROTECTED]
 http://www.informed-sources.com

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



[PHP] FTP

2006-10-06 Thread Raphael Martins

Hi,
I need to send large files over my website...I was wondering if I could do
this using the PHP FTP Commands. The files will be larger then the
MAX_UPLOAD_SIZE in php.ini.

Is that possible? Or should I use a regular FTP program?

Thank you!


Re: [PHP] PHP4 static properties - PEAR vs my solution

2006-10-06 Thread Richard Lynch
On Fri, October 6, 2006 10:59 am, Hodicska Gergely wrote:
 This would be Really Nifty, if PHP allowed multiple inheritence so
 you
 could have a mixin class...

 Otherwise, however, you have to have a common base class across all
 the various class systems in use in your multitude of web
 applications, or duplicate the code (ugh!) in each.

 So if you have a single base class to throw this into, it's great.

 If you have a plethora of code-bases you work with, the global
 variable hack is probably more suitable.

 Maybe you missed the subject of my mail. This wouldn't be a general
 solution, just a better one than it is now in PEAR. And PEAR has a
 base
 class, all PEAR classes have to extend it.

But users of the PEAR solution to staticProperties may or may not want
any other portion of PEAR as well.

So it's only better if it suits the needs of the user.

You'd have to ask the PEAR users if it's better for them.

Perhaps you meant to post on a PEAR list.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] ftp_put and ftp_chmod does not work

2006-10-06 Thread Jo�o C�ndido de Souza Neto
Hello everyone.

I have got some parts of my system where some files are sent and i use ftp 
functions to save suche files.

When i run it in my local machine, it works fine but, when it is on the 
server i got some errors.

I was using ftp_put to copy such files from upload_temp folder of php to my 
system own folder and it does not work, i thought it could be because the 
ftp user has no permission in upload_temp folder of php.

Then i tried to use php_chmod to give permissions for the apache user, 
move_uploaded_files to move such file and ftp_chmod agais to remove 
permissions. It does not work too, i think it is because the server has 
safe_mode on.

Someone know what can i do to upload these files?

Best regards.


-- 
João Cândido de Souza Neto
Curitiba Online
[EMAIL PROTECTED]
(41) 3324-2294 (41) 9985-6894
http://www.curitibaonline.com.br 

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



Re: [PHP] ftp_put and ftp_chmod does not work

2006-10-06 Thread Richard Lynch
On Fri, October 6, 2006 3:32 pm, João Cândido de Souza Neto wrote:
 when it is on
 the
 server i got some errors.

If you tell us what errors, you change the problem from an infinitely
large set of what could go wrong, to a rather small set of what
probably went wrong...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] ftp_put and ftp_chmod does not work

2006-10-06 Thread Jo�o C�ndido de Souza Neto
In both case the functions just returns false.

Richard Lynch [EMAIL PROTECTED] escreveu na mensagem 
news:[EMAIL PROTECTED]
 On Fri, October 6, 2006 3:32 pm, João Cândido de Souza Neto wrote:
 when it is on
 the
 server i got some errors.

 If you tell us what errors, you change the problem from an infinitely
 large set of what could go wrong, to a rather small set of what
 probably went wrong...

 -- 
 Some people have a gift link here.
 Know what I want?
 I want you to buy a CD from some starving artist.
 http://cdbaby.com/browse/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] PHP4 static properties - PEAR vs my solution

2006-10-06 Thread Hodicska Gergely

But users of the PEAR solution to staticProperties may or may not want
any other portion of PEAR as well.

But they have the possibility to choose. ;)


So it's only better if it suits the needs of the user.
You'd have to ask the PEAR users if it's better for them.
1. I sent it here  because I think it is an interesting solution, it 
could be useful for any PHP programmer who wants to know more than the 
surface.

2. I'm not a PEAR fan but I think that PEAR is very close to PHP.


Perhaps you meant to post on a PEAR list.
I sent it to the pear-dev list too, and I never thought that after a 
mail they will change the 4 years old code, and make a BC change. I just 
was curious if they choose knowingly their solution.



Regards,
Felhő

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



Re: [PHP] image protection

2006-10-06 Thread Richard Lynch
On Fri, October 6, 2006 12:44 pm, tedd wrote:
 What would be the best way to protect images in a directory from
 being harvested?

Tell the client that correctly linked and tagged images INCREASE
traffic because the search engines can find them and suck people in,
so hiding them is a Bad Idea. :-)

 But, is there a way to protect a directory such that an application
 such as SightSucker (nice program btw), can't retrieve it's
 contents, while your php script can?

But it this way:
You can erect as many barriers as you like.

Some of them will stop some automated scripts.
Many of them will stop legitimate use.
Most of them will incovenience legitimate users.
None of them will stop a determined writer of an automated script.

[irony]
I type this message as my PHP script is surfing to our site on IE in
the background, trying to trigger an intermittent session disappearing
bug.
[/irony]

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] Problem receiving POSTed data

2006-10-06 Thread Andy Hultgren

Hi everyone,

So, I'm trying to receive POSTed data which is being sent from Flash
structured as a nested array pictured (conceptually):

id contains (a, b, c)
a contains (prop1 = a1, prop2 = a2, ...)
b contains (prop1 = b1, prop2 = b2, ...)
c contains (prop1 = c1, prop2 = c2, ...)

where a1, a2, b1, b2, c1, c2 are values stored in the keys prop1, prop2 etc.
of their respective arrays.  That's the conceptual structure, but that isn't
how the information is passed to PHP from Flash.  In Flash (which uses .
notation for arrays), the data is packaged with a LoadVars object (for those
who care) as follows:

postObject.id1
postObject.id1.prop1 = a1
postObject.id1.prop2 = a2
...
postObject.id2.prop1 = b1
postObject.id2.prop2 = b2
...
etc.

I *think* this data *should be* received by PHP (with dots converted to
_ since that's what I've read php does) in the $_POST array as follows:

$_POST contains (id1 - a, id1_prop1 - a1, id1_prop2 - a2, ..., id2 - b,
id2_prop1 - b1, id2_prop2 - b2, ...)

However, that's not what I appear to be getting from the $_POST array.  When
I run this code:

/*/
$data = $_POST;
$stuff = \n \n Post contains:;

foreach($data as $prop = $val) {
$stuff .= \n {$prop}: {$val};
}
/*/

and write $stuff to a .txt file, I get the following output:

Post contains:
id1: a
id2: b
id3: c

and that's it!  No information at all about id1_prop1, id1_prop2, id2_prop1,
etc etc.

I am really stuck at this point.  Does anyone know how multidimensional
information is passed to the $_POST variable?  I know it can be done with
HTML forms and arrays, but I'm using flash and so I think my
multidimensional array of information simply gets flattened into a
one-dimensional array when POSTed as a described above (since Flash uses dot
notation for arrays and php changes dots to underscores and just makes it
one long variable name).  And that would work fine if that's what it was
doing, but, for some reason, $_POST doesn't seem to be receiving the second
array dimension at all which contains all of my property information (which
should have been flattened into the first dimension).

If that's doesn't make any sense please let me know and I will attempt to
clarify.  Otherwise, any and all help is very much appreciated!

Andy


RE: [PHP] Unicode Problem

2006-10-06 Thread Richard Lynch
On Fri, October 6, 2006 12:29 pm, tedd wrote:
 No, that's not what I meant. I know how to convert DEC - HEX.

 What I was talking about is called a NCRs, or Numeric Character
 References

 One could use the Unicode DEC value directly, such as:

  #8226;

 or the Unicode HEX value directly, such as:

  #x2002;
I think you meant x2022 a.k.a. (dec)8226 :-)

8226 or x2022 is the same number, so whatever it is, it should work
the same.

And maybe those will work the same as bull; on all modern browser now.

But that was not my experience in the past.

Perhaps you would care to extend your browsercam test to some
regression testing of more ancient browsers -- on Mac OS.

 Note, either will produce a bullet in most browsers.

But #8226; is almost-for-sure *ONLY* going to look right on MS IE.

 Not true, for most (and all most current) browsers do render that
 glyph correctly (other glyphs may vary), please review:

 http://www.browsercam.com/public.aspx?proj_id=289683

 The first bullet is 149; (same as ALT 0149 on the windoze keyboard).

 The second is #8226; and third is #x2002;

 Note all three produce a bullet -- oh and don't forget bull;, which
 will produce the same result.

 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




-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] Problem receiving POSTed data

2006-10-06 Thread Andy Hultgren

Hang on - my php code may be working fine.  It might be a problem with my
actionscript code - particularly that the LoadVars object I'm using to send
the data might not be able to take multidimensional data (though it
definitely does not say that *anywhere* in the documentation!!).  Stupid
actionscript documentation.

Raphael, here is the code I am using (I am iterating through all of the
movieclips in my flash doc and gathering data on their name and position):

/*/
for(var i in _level0) {
  if(typeof(_level0[i]) == movieclip) {
 data_lv[i] = _level0[i];
 data_lv[i].id = _level0[i]._name;
 data_lv[i].x = _level0[i]._x;
 data_lv[i].y = _level0[i]._y;
  }
}
data_lv.sendAndLoad(myScript.php, data_lv, POST);

/**/

The odd thing is that I print out the contents of data_lv and everything is
there as expected in multidimensional form so I thought that was working
fine, but someone on a flash message board just posted saying they thought
LoadVars objects could not handle multidimensional data.  So maybe even
though the contents of the object print as expected, it doesn't send as
expected.  I'll try this in a completely one-dimensional array from flash to
php and see if it works.  If it does, I'll let everyone know.

Andy

On 10/6/06, Raphael Martins [EMAIL PROTECTED] wrote:


Did you explicitly checked if the id1 'a' prop isn´t an array?
Can you post your ActionScript codemaybe it´ll help!

:D

Good Luck

2006/10/6, Andy Hultgren  [EMAIL PROTECTED]:

 Hi everyone,

 So, I'm trying to receive POSTed data which is being sent from Flash
 structured as a nested array pictured (conceptually):

 id contains (a, b, c)
 a contains (prop1 = a1, prop2 = a2, ...)
 b contains (prop1 = b1, prop2 = b2, ...)
 c contains (prop1 = c1, prop2 = c2, ...)

 where a1, a2, b1, b2, c1, c2 are values stored in the keys prop1, prop2
 etc.
 of their respective arrays.  That's the conceptual structure, but that
 isn't
 how the information is passed to PHP from Flash.  In Flash (which uses
 .
 notation for arrays), the data is packaged with a LoadVars object (for
 those
 who care) as follows:

 postObject.id1
 postObject.id1.prop1 = a1
 postObject.id1.prop2 = a2
 ...
 postObject.id2.prop1 = b1
 postObject.id2.prop2 = b2
 ...
 etc.

 I *think* this data *should be* received by PHP (with dots converted to
 _ since that's what I've read php does) in the $_POST array as
 follows:

 $_POST contains (id1 - a, id1_prop1 - a1, id1_prop2 - a2, ..., id2 -
 b,
 id2_prop1 - b1, id2_prop2 - b2, ...)

 However, that's not what I appear to be getting from the $_POST
 array.  When
 I run this code:

 /*/
 $data = $_POST;
 $stuff = \n \n Post contains:;

 foreach($data as $prop = $val) {
  $stuff .= \n {$prop}: {$val};
 }
 /*/

 and write $stuff to a .txt file, I get the following output:

 Post contains:
 id1: a
 id2: b
 id3: c

 and that's it!  No information at all about id1_prop1, id1_prop2,
 id2_prop1,
 etc etc.

 I am really stuck at this point.  Does anyone know how multidimensional
 information is passed to the $_POST variable?  I know it can be done
 with
 HTML forms and arrays, but I'm using flash and so I think my
 multidimensional array of information simply gets flattened into a
 one-dimensional array when POSTed as a described above (since Flash uses
 dot
 notation for arrays and php changes dots to underscores and just makes
 it
 one long variable name).  And that would work fine if that's what it was
 doing, but, for some reason, $_POST doesn't seem to be receiving the
 second
 array dimension at all which contains all of my property information
 (which
 should have been flattened into the first dimension).

 If that's doesn't make any sense please let me know and I will attempt
 to
 clarify.  Otherwise, any and all help is very much appreciated!

 Andy





Re: [PHP] if(), else() problem!

2006-10-06 Thread Richard Lynch
On Fri, October 6, 2006 11:35 am, Rahul S. Johari wrote:
 $db = dbase_open(osm.dbf, 0);
 if ($db) {
   $record_numbers = dbase_numrecords($db);
$found = false;
   for ($i = 1; $i = $record_numbers; $i++) {
  $row = dbase_get_record_with_names($db, $i);
  if ($row['PHONE'] == $thekey) {
 echo ³found²;
$found = $thekey;
 }
 else {
//   echo ³not found²;
// do nothing here
 }
 }

if (!$found) echo not found;

 }


dbase *does* have some kind of way to just search with a query or
something, right?...  Use it if it does.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] if(), else() problem!

2006-10-06 Thread Richard Lynch
On Fri, October 6, 2006 2:45 pm, Rahul S. Johari wrote:
 Well, the actual script doesn't just print found number if the
 number
 exists... It displays all the data from the database of that record,
 also
 gives an interactive form to update the data and more.

None of which is a Good Reason to replace the dbase search with your
own PHP loop...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] if(), else() problem!

2006-10-06 Thread Richard Lynch
On Fri, October 6, 2006 2:59 pm, Rahul S. Johari wrote:
 I'm not sure if I understand your point then! I have about 80 fields
 in that
 database that are fetched and displayed on the page using this code.
 If
 there's a simpler way to do this, and have it work the if() else()
 error as
 well, I would love to know about it...

Are you displaying 79 records not editable, and ONE that is editable,
all on one page?

That's an Okay Reason, but you'd probably have happier users if you
didn't do that...

Give them a link to edit ONE record and let them edit that all by
itself and then come back to the list when they are done.

Too Much Information is not a good thing.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] Detected a pattern that malfunctions includes

2006-10-06 Thread Richard Lynch
On Fri, October 6, 2006 11:27 am, Deckard wrote:
 I've already set my include_path to /var/www/html and good :(

Then you don't need ../ at all...

Copy paste the exact error message you get, and tell us where the URL
is that starts the problem.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] Really strange

2006-10-06 Thread Richard Lynch
On Fri, October 6, 2006 11:26 am, J?rgen Wind wrote:
 if you are using IIS read this:
 http://support.microsoft.com/kb/332117/EN-US/

Only MS would re-title confusing erroneous non-specific error
messages as FRIENDLY! :-v

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] Problem receiving POSTed data

2006-10-06 Thread Richard Lynch
On Fri, October 6, 2006 4:01 pm, Andy Hultgren wrote:
 /*/
 $data = $_POST;
 $stuff = \n \n Post contains:;

 foreach($data as $prop = $val) {
  $stuff .= \n {$prop}: {$val};
 }
 /*/

pre?php var_dump($_POST);?/pre

PHP does pretty minimal munging of the POST data.

It's unlikely that Flash is sending what you think it's sending.

Even if it is, you have two options:

1. Use HTTP_RAW_POST_DATA (turn it on in PHP) and write your own Flash
array parser in PHP.

2. Convince Flash to POST data more like PHP wants it:
id[a][prop1]=a1id[a][prop2]=a2id[b][prop1]=b1...

#2 will probably be WAY easier, unless Flash is even more broken than
I think.  And I think Flash is pretty broken. :-)

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/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] Problem receiving POSTed data

2006-10-06 Thread Andy Hultgren

Am working on #2 right now...

On 10/6/06, Richard Lynch [EMAIL PROTECTED] wrote:


On Fri, October 6, 2006 4:01 pm, Andy Hultgren wrote:
 /*/
 $data = $_POST;
 $stuff = \n \n Post contains:;

 foreach($data as $prop = $val) {
  $stuff .= \n {$prop}: {$val};
 }
 /*/

pre?php var_dump($_POST);?/pre

PHP does pretty minimal munging of the POST data.

It's unlikely that Flash is sending what you think it's sending.

Even if it is, you have two options:

1. Use HTTP_RAW_POST_DATA (turn it on in PHP) and write your own Flash
array parser in PHP.

2. Convince Flash to POST data more like PHP wants it:
id[a][prop1]=a1id[a][prop2]=a2id[b][prop1]=b1...

#2 will probably be WAY easier, unless Flash is even more broken than
I think.  And I think Flash is pretty broken. :-)

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




Re: [PHP] if(), else() problem!

2006-10-06 Thread Børge Holen
On Friday 06 October 2006 21:59, Rahul S. Johari wrote:
 I'm not sure if I understand your point then! I have about 80 fields in
 that database that are fetched and displayed on the page using this code.
 If there's a simpler way to do this, and have it work the if() else() error
 as well, I would love to know about it...

Dunno but this:

 ... for ($i = 1; $i = $record_numbers; $i++) { $row = 
dbase_get_record_with_names($db, $i);
 if ($row['PHONE'] ...

looks like my c++ source of kde, quite heavy. Yes I'm sure a lot of ppl on 
this list like it like that, but from what I've learned is that projects 
needs modifications from time to time. and a lot of jibberish like this 
probably would have caused me a great deal of stress under a time table.

I would go on a problem like this with this solution

select whatever_tables_needed from $db where info=$hastomatch
whilethis and that {
show it all in a fancy form;
}else{
do_woop_that_thing and show something else;
}

That would only leave me with the $thekey  info.

OR, reflecting on yer problem; would there be a possability that $thekey is 
not at all valid?

Whereas you would need to add an error if the select renders no hit


 On 10/6/06 3:47 PM, Børge Holen [EMAIL PROTECTED] wrote:
  On Friday 06 October 2006 21:45, Rahul S. Johari wrote:
  Well, the actual script doesn't just print found number if the number
  exists... It displays all the data from the database of that record,
  also gives an interactive form to update the data and more.
 
  Yes, and my point is still valid. need only to fetch bits'n bytes where
  $thekey is located, leave the rest be.
 
  On 10/6/06 3:25 PM, Børge Holen [EMAIL PROTECTED] wrote:
  Why not check if $thekey is in the $db, then else echo not found?
  seems all to much to do so little.
 
  On Friday 06 October 2006 18:35, Rahul S. Johari wrote:
  Ave,
 
  code:
 
  $db = dbase_open(osm.dbf, 0);
  if ($db) {
$record_numbers = dbase_numrecords($db);
for ($i = 1; $i = $record_numbers; $i++) {
   $row = dbase_get_record_with_names($db, $i);
   if ($row['PHONE'] == $thekey) {
  echo ³found²;
  }
  else {
  echo ³not found²;
  }
  }
  }
 
  The loop reads each row in the database, and checks whether it matches
  $thekey or not. If it does, it prints ³found², if it doesn¹t, it
  prints ³not found². But this happens for ³each row² in the database.
  So if there are 100 records, and the program does find a match, I¹ll
  get 99 ³not found² printed, and one ³found² printed.
 
  I can easily put an ³exit;² after my echo in the else(), but then it
  stops the loop, and doesn¹t go any further.
 
  What do I have to do to get results if the phone matches, print
  nothing for rows where it doesn¹t match, but give one single ³not
  found² if the phone number does not exist in the database?
 
  The logic is just failing me at this point.
 
  Rahul S. Johari
  Supervisor, Internet  Administration
  Informed Marketing Services Inc.
  500 Federal Street, Suite 201
  Troy NY 12180
 
  Tel: (518) 687-6700 x154
  Fax: (518) 687-6799
  Email: [EMAIL PROTECTED]
  http://www.informed-sources.com
 
  Rahul S. Johari
  Supervisor, Internet  Administration
  Informed Marketing Services Inc.
  500 Federal Street, Suite 201
  Troy NY 12180
 
  Tel: (518) 687-6700 x154
  Fax: (518) 687-6799
  Email: [EMAIL PROTECTED]
  http://www.informed-sources.com

 Rahul S. Johari
 Supervisor, Internet  Administration
 Informed Marketing Services Inc.
 500 Federal Street, Suite 201
 Troy NY 12180

 Tel: (518) 687-6700 x154
 Fax: (518) 687-6799
 Email: [EMAIL PROTECTED]
 http://www.informed-sources.com

-- 
---
Børge
Kennel Arivene 
http://www.arivene.net
---

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



Re: [PHP] Problem receiving POSTed data

2006-10-06 Thread Andy Hultgren

Problem solved: it was indeed that the flash object did not like
multidimensional data.

I didn't change my PHP code one little bit.  But I changed my my
ActionScript code to write the data in a 1-dimensional form as follows:

/*/
for(var i in _level0) {
  if(typeof(_level0[i]) == movieclip) {
 data_lv[i + _path] = _level0[i];
 data_lv[i + _id] = _level0[i]._name;
 data_lv[i + _x] = _level0[i]._x;
 data_lv[i + _y] = _level0[i]._y;
  }
}
data_lv.sendAndLoad(myScript.php, data_lv, POST);

/**/


This works perfectly and php receives all of the data correctly.  Thanks
guys for your thoughts.  I'm going to be posting an addition to the online
ActionScript documentation to hopefully help others avoid this pitfall!

Andy

On 10/6/06, Andy Hultgren [EMAIL PROTECTED] wrote:


Am working on #2 right now...

On 10/6/06, Richard Lynch [EMAIL PROTECTED] wrote:

 On Fri, October 6, 2006 4:01 pm, Andy Hultgren wrote:
  /*/
  $data = $_POST;
  $stuff = \n \n Post contains:;
 
  foreach($data as $prop = $val) {
   $stuff .= \n {$prop}: {$val};
  }
  /*/

 pre?php var_dump($_POST);?/pre

 PHP does pretty minimal munging of the POST data.

 It's unlikely that Flash is sending what you think it's sending.

 Even if it is, you have two options:

 1. Use HTTP_RAW_POST_DATA (turn it on in PHP) and write your own Flash
 array parser in PHP.

 2. Convince Flash to POST data more like PHP wants it:
 id[a][prop1]=a1id[a][prop2]=a2id[b][prop1]=b1...

 #2 will probably be WAY easier, unless Flash is even more broken than
 I think.  And I think Flash is pretty broken. :-)

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