[PHP] Re: Environment variables in php.ini

2007-04-06 Thread Abdullah Ramazanoglu
Jim Lucas dedi ki:
 Abdullah Ramazanoglu wrote:

  --8--

 Is it possible at all to use environment variables in php.ini, or is
 there any other solution to the problem above?
 
 Thank you.
 
 Read this:
 
 http://us3.php.net/manual/en/configuration.php#configuration.file
 
 You can put a file in any other these locations that will be read by the
 cgi when it is started.
 
 my suggestion would be to use a single php.ini file in a global location.
  Then symlink a php.ini to there home directory or web root.
 
 Then set perms on the single global file such that only you can write to
 it, but everybody can read
 it.  This should work for you.

That was also my first inclination but I had to abandon it, because then I
couldn't give different parameters for different virtual hosts.

For instance currently I (have to) centrally use error_log=php_error.log
and this causes a php_error.log been created everywhere (as I can't give
absolute address, each php script creates a log in the directory it
resides in.) If only I would have been able to give something to the
effect of php_error=$HOME/php_error.log then every user would've had
only one log file.

Another drawback with central read-only php.ini is that users won't be able
to tweak php.ini to certain extent (but not much - just like php_flag and
php_value). With cgi-php, users are either too restricted (r/o php.ini) or
too free (r/w php.ini).

Thanks and regards
-- 
Abdullah Ramazanoglu
aramazan ÄT myrealbox D0T cöm

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



Re: [PHP] HELP with mail()

2007-04-06 Thread Tijnema !

On 4/6/07, Zhimmy Kanata [EMAIL PROTECTED] wrote:

I created the following email program from a email function that I know works 
in another program.

 When I create a simple form page listed below and submit it. It echos the 
$email and the $username and it writes it to the page. So it is finding the 
variables within the transfering url in the form of a post.  It doesn't give me 
an error message but I don't get an email? Should the Linux server not be 
executing the mail() function?

 What the beep!???

 Again thanks in advance for any help.

 Zhimmy

 ?php
 $email = strtolower($email);
echo $email, $username;

function sendEmail($email, $username) {
   $mailTo = $username $email;

   $mailSubject = Your registration confirmation...;
   $mailBody = Dear $name,\n\nYour details have been added to my email list.\n\n To 
unsubscribe click on the link 
below\nhttp://www.sitename.com/mail.php?action=unsubscribeemail=$email;;

 mail($email, Registration Confirmation, $mailBody,
From: \r\n
   .Reply-To: \r\n
   .X-Mailer: PHP/ . phpversion());
 }
?

snip

Try hardcoding the email, i've seen this problem more on this list.Try
the code below and see if it solves your problem.

Tijnema

?php
$email = strtolower($email);
echo $email, $username;

function sendEmail($email, $username) {
  $mailTo = $username $email;

  $mailSubject = Your registration confirmation...;
  $mailBody = Dear $name,\n\nYour details have been added to my
email list.\n\n To unsubscribe click on the link
below\nhttp://www.sitename.com/mail.php?action=unsubscribeemail=$email;;

mail([EMAIL PROTECTED], Registration Confirmation, $mailBody,
   From: \r\n
  .Reply-To: \r\n
  .X-Mailer: PHP/ . phpversion());
}
?

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



Re: [PHP] PHP textbook suggestions?

2007-04-06 Thread Zoltán Németh
2007. 04. 5, csütörtök keltezéssel 20.29-kor itoctopus ezt írta:
 I beg to differ with everyone who said there's no difference between the
 single quote and double quote.
 Although the double quote is much more flexible, the single quote is better,
 as there will be no evaluation of the string for potential variables inside
 the string.

at the opcode level there is no difference if there are no variables
involved. of course, the compiler in the first pass must check for
variables within double quotes, but it does check strings within single
quotes also - for escaped characters and stuff like that.

greets
Zoltán Németh

 
 And Chris, about the book, go for PHP5 Power Programming by Prentice Hall,
 it's the best in the market in my opinion, it teaches the language itself,
 as well as best practices, all in an OOP twist.
 
 --
 itoctopus - http://www.itoctopus.com
 Tijnema ! [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 On 4/5/07, Zoltn Nmeth [EMAIL PROTECTED] wrote:
  2007. 04. 5, cstrtk keltezssel 12.52-kor Chris Lott ezt rta:
   Looking for suggestions for a PHP textbook for an Intro to Web
   Programming class that will be using PHP5 and MySQL. This is a
   first-semester course, so no programming experience required.
  
   It would be nice to have a text that adhered to (what I see as) good
   practice using quotation marks... i.e.
  
   print 'The cost is ' . $cost;
   NOT
   print The cost is $cost;
   AND CERTAINLY NOT
   print (The cost is $cost);
  
   echo substr('abcdef', 1);
   NOT
   echo substr(abcdef, 1);
 
  there is no difference between the above two echo statements. I'm almost
  sure that there is absolutely zero difference between the two kind of
  quotes when there are no variables involved
 
  greets
  Zoltn Nmeth
 
 I prefer using double quotes ( ) around strings, because i don't
 have to escape single quotes (' ') in words like I'm, don't, etc.
 
 Tijnema
 
  
  
   I will be teaching, so a book that a student can-- before the class--
   work through and understand is good-- doesn't have to be a traditional
   textbook! But it shouldn't be a reference manual either.
  
   c
   --
   Chris Lott
  
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 

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



Re: [PHP] Using /index.php/this/that/343/3 style links but having a prob!

2007-04-06 Thread Zoltán Németh
2007. 04. 5, csütörtök keltezéssel 19.01-kor Mike Shanley ezt írta:
 Hi,
 
 I'm trying to make friends with search-engines, but I'm having a problem.
 
 When I use my links (right now, I've only got the forums on my site up), 
 they take me to the right place, however, the browser only displays part 
 of the url...
 
 for instance:
 http://www.omniversalism.com/index.php/forums/fcat/view/1
 will take you to a page titled O.com Connections
 
 but the link shows:
 http://www.omniversalism.com/index.php/forums
 which would take you to the main forums page...
 
 So what's going on???

I don't know, everything works OK for me on Linux/Firefox

greets
Zoltán Németh

 
 The only code that deal with this is:
 $CALL = array_values(array_unique(explode('/',$PHP_SELF)));
 unset($CALL[0],$CALL[(array_search('index.php',$CALL))]);
 $CALL = array_values($CALL);
 
 and all that does is hand me the info to call my pages...
 
 Thanks
 
 -- 
 Mike Shanley
 
 ~you are almost there~
 

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



[PHP] PHP textbook suggestions?

2007-04-06 Thread Danial Rahmanzadeh

I think PHP Architect's Zend PHP5 certification Study guide is good. as
authors indicate in the book:

We wrote php|architect's Zend PHP 5 Certification Study Guide with the
specific intent
of making it useful in two situations:
• For candidates who are preparing for the Zend exam
• For student of instructor-led classes who are approaching and studying PHP
for the first time

Dan


[PHP] How to disable the Daylight saving time in PHP 5?

2007-04-06 Thread SED
I need to disable the Daylight saving time in PHP 5.

My servers (Windows, both XP and Vista) have correct local time but PHP 5
adds an extra hour when I use date(H) or other time functions. Instead of
getting 9 AM, I get 10 AM.

If I run date(I), I get 1, which confirms that PHP 5 is using Daylight
saving time. If I change the system date to January I get correct hour.

I have tried google.com and I ran through the php.net manual but I didn't
find a solution. I cannot add time-fix on every php-page, they are to many.

Regards,
Summi

Netfang [EMAIL PROTECTED]
Heimasíða http://www.sed.is

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



Re: [PHP] How to disable the Daylight saving time in PHP 5?

2007-04-06 Thread Tijnema !

On 4/6/07, SED [EMAIL PROTECTED] wrote:

I need to disable the Daylight saving time in PHP 5.

My servers (Windows, both XP and Vista) have correct local time but PHP 5
adds an extra hour when I use date(H) or other time functions. Instead of
getting 9 AM, I get 10 AM.

If I run date(I), I get 1, which confirms that PHP 5 is using Daylight
saving time. If I change the system date to January I get correct hour.

I have tried google.com and I ran through the php.net manual but I didn't
find a solution. I cannot add time-fix on every php-page, they are to many.

Regards,
Summi

Netfang [EMAIL PROTECTED]
Heimasíða http://www.sed.is



I don't know a way to disable DST, but you can change your timezone in
the php.ini, so that you set it an hour back again :)
manual about date.timezone:
http://www.php.net/manual/en/ref.datetime.php#ini.date.timezone

Tijnema





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



Re: [PHP] How to disable the Daylight saving time in PHP 5?

2007-04-06 Thread Jochem Maas
Tijnema ! wrote:
 On 4/6/07, SED [EMAIL PROTECTED] wrote:
 I need to disable the Daylight saving time in PHP 5.

 My servers (Windows, both XP and Vista) have correct local time but PHP 5

these are not servers - they barely run something worthy of calling an OS.

 adds an extra hour when I use date(H) or other time functions.
 Instead of
 getting 9 AM, I get 10 AM.

 If I run date(I), I get 1, which confirms that PHP 5 is using Daylight
 saving time. If I change the system date to January I get correct hour.

 I have tried google.com and I ran through the php.net manual but I didn't
 find a solution. I cannot add time-fix on every php-page, they are to
 many.

 Regards,
 Summi

 Netfang [EMAIL PROTECTED]
 Heimasíða http://www.sed.is
 
 
 I don't know a way to disable DST, but you can change your timezone in
 the php.ini, so that you set it an hour back again :)
 manual about date.timezone:
 http://www.php.net/manual/en/ref.datetime.php#ini.date.timezone

yeah - chances are the default timezone is not your timezone - setting
the correct one may fix it.

also what happens if you turn of the windows 'auto update DST' setting?

 
 Tijnema


 

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



RE: [PHP] How to disable the Daylight saving time in PHP 5?

2007-04-06 Thread SED
I changed my timezone in php.ini to:

date.timezone = GMT0 ;

...and it works! Thanks!

Regards,
Summi

Netfang [EMAIL PROTECTED]
Heimasíða http://www.sed.is 
-Original Message-
From: Tijnema ! [mailto:[EMAIL PROTECTED] 
Sent: 6. apríl 2007 09:43
To: SED
Cc: php-general@lists.php.net
Subject: Re: [PHP] How to disable the Daylight saving time in PHP 5?

On 4/6/07, SED [EMAIL PROTECTED] wrote:
 I need to disable the Daylight saving time in PHP 5.

 My servers (Windows, both XP and Vista) have correct local time but PHP 5
 adds an extra hour when I use date(H) or other time functions. Instead
of
 getting 9 AM, I get 10 AM.

 If I run date(I), I get 1, which confirms that PHP 5 is using Daylight
 saving time. If I change the system date to January I get correct hour.

 I have tried google.com and I ran through the php.net manual but I didn't
 find a solution. I cannot add time-fix on every php-page, they are to
many.

 Regards,
 Summi

 Netfang [EMAIL PROTECTED]
 Heimasíða http://www.sed.is


I don't know a way to disable DST, but you can change your timezone in
the php.ini, so that you set it an hour back again :)
manual about date.timezone:
http://www.php.net/manual/en/ref.datetime.php#ini.date.timezone

Tijnema



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



RE: [PHP] How to disable the Daylight saving time in PHP 5?

2007-04-06 Thread SED
The Windows clocks are correct. The PHP 5 added always one hour. However,
Tijnema pointed me to his solution:

Change in php.ini date.timezone = GMT0

And therefore it will not add one hour to the system clock which is correct.

Regards,
Summi

Netfang [EMAIL PROTECTED]
Heimasíða http://www.sed.is 

-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: 6. apríl 2007 10:06
To: Tijnema !
Cc: SED; php-general@lists.php.net
Subject: Re: [PHP] How to disable the Daylight saving time in PHP 5?

Tijnema ! wrote:
 On 4/6/07, SED [EMAIL PROTECTED] wrote:
 I need to disable the Daylight saving time in PHP 5.

 My servers (Windows, both XP and Vista) have correct local time but PHP 5

these are not servers - they barely run something worthy of calling an OS.

 adds an extra hour when I use date(H) or other time functions.
 Instead of
 getting 9 AM, I get 10 AM.

 If I run date(I), I get 1, which confirms that PHP 5 is using Daylight
 saving time. If I change the system date to January I get correct hour.

 I have tried google.com and I ran through the php.net manual but I didn't
 find a solution. I cannot add time-fix on every php-page, they are to
 many.

 Regards,
 Summi

 Netfang [EMAIL PROTECTED]
 Heimasíða http://www.sed.is
 
 
 I don't know a way to disable DST, but you can change your timezone in
 the php.ini, so that you set it an hour back again :)
 manual about date.timezone:
 http://www.php.net/manual/en/ref.datetime.php#ini.date.timezone

yeah - chances are the default timezone is not your timezone - setting
the correct one may fix it.

also what happens if you turn of the windows 'auto update DST' setting?

 
 Tijnema


 

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



Re: [PHP] PHP textbook suggestions?

2007-04-06 Thread Jochem Maas
Danial Rahmanzadeh wrote:
 I think PHP Architect's Zend PHP5 certification Study guide is good. as
 authors indicate in the book:
 
 We wrote php|architect's Zend PHP 5 Certification Study Guide with the
 specific intent
 of making it useful in two situations:
 • For candidates who are preparing for the Zend exam
 • For student of instructor-led classes who are approaching and studying
 PHP
 for the first time

the OP made the point that his class would [probably] contain people
with no programming experience (it was not a prerequisite) ... in the context
of the Study Guide you mention I hope that 'studying php for the first time'
does not mean the same as 'no programming experience' ...  if it does then that
puts the bar very low for Zend Certification, because, let's be honest, unless 
your
a genius, it really does take a while before someone reaches a certain level of
professionalism with regard to programming ... it's somewhat more involved
than mowing the lawn. I have always assumed that Zend Certification implied a
certain level of professionalism that one cannot expect from complete newcomers,
maybe I'm mistaken.

 
 Dan
 

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



Re: [PHP] DOMDocument::schemaValidate() - libxml_get_errors()

2007-04-06 Thread Rob Richards

Tijnema ! wrote:

On 4/5/07, Sébastien WENSKE [EMAIL PROTECTED] wrote:


Yes it's exactly the error, see the output :

DOMDocument::schemaValidate() Generated Errors!



Error 1871: Element 'EcheanceRMC': This element is not expected. in
file:///D%3A/wamp/www/XML%20Validator/xml/Edit4.xml on line
65535 - that's wrong the real line number is upper
 [...]


...


I don't think it has to do with integer, unless you're running in
16bit mode.. (PHP can't even run under 16bit i guess..). An integer
could a lot more. I think there are 2 options that make this error:
1) The libxml library itself doesn't support it.
2) The PHP bindings with the libxml don't support it.

In the first case you would need to contact the libxml authors, in the
second case, you might want to write a patch that fixes it :)


It is due to the structure in libxml2 (the line number in this case is 
defined as unsigned short). This has been brought up before and wont be 
changing as it would break API/AB compatibility. There really is little 
you can do here.


Rob

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



[PHP] link counting

2007-04-06 Thread Sebe

i thought of an idea of counting the number of links to reduce comment spam.

unfortunately my methods is not reliable, i haven't tested it yet 
though.. anyone have maybe a better solution using some regexp?


$links = array('http://', 'https://', 'www.');

$total_links = 0;
foreach($links as $link)
{
$total_links = substr_count($string, $link);
}
  
if($total_links  X)

{
   .
}

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



Re: [PHP] Audio CAPTCHA review request

2007-04-06 Thread tedd

At 6:36 PM -0400 4/5/07, Robert Cummings wrote:

But still, relying on Javascript is a bit flakey IMHO.


There's nothing wrong with javascript -- you just need to know it's 
limitations.


My audio captcha relies on javascript, namely ajax. The problem I had 
was how to deliver the sound once the user requested it from the main 
page. I used bgsound and embed tags to accomplish that after 
browser sniffing. However, those tags had to be in a new page to 
play, which required a refresh. After that, the user had to be sent 
back to the main page to enter the key, which required another 
refresh. A screen reader will re-read each page out-loud upon each 
refresh and that was unacceptable.


So, I used ajax to change the main page without a refresh using an 
iframe tag. That way the sound file was played without refreshing 
anything. I thought that clever. :-)


In this case, there was no way to get around using javascript. 
However, that's not a problem for visually impaired users nor is it a 
security issue.


At 6:36 PM -0400 4/5/07, Robert Cummings wrote:

Perhaps using two
combined systems... more traditional obscured writing on image captcha,
or a simple mathematical question for texties, or the system you
presented with an audible ding for blind people to know they are within
the field of success.


That's the idea unless I can come up with a way that would be 
accessible to all. I think simple captchas like type in the number 
seven four six would be one, but that appears easy to crack.


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] link counting

2007-04-06 Thread Tijnema !

On 4/6/07, Sebe [EMAIL PROTECTED] wrote:

i thought of an idea of counting the number of links to reduce comment spam.

unfortunately my methods is not reliable, i haven't tested it yet
though.. anyone have maybe a better solution using some regexp?

$links = array('http://', 'https://', 'www.');

$total_links = 0;
foreach($links as $link)
{
$total_links = substr_count($string, $link);
}

if($total_links  X)
{
   .
}



I don't have a better way, but links starting with http://www. or
https://www. are counted twice in your script...

Tijnema

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




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



RE: [PHP] link counting

2007-04-06 Thread Jay Blanchard
[snip]
i thought of an idea of counting the number of links to reduce comment
spam.

unfortunately my methods is not reliable, i haven't tested it yet 
though.. anyone have maybe a better solution using some regexp?

$links = array('http://', 'https://', 'www.');

$total_links = 0;
foreach($links as $link)
{
 $total_links = substr_count($string, $link);
}
   
if($total_links  X)
{
.
}
[/snip]

External links or internal links? Regardless, start with counting anchor
tags. If you need to make it more granular you can work from there with
regex.

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



Re: [PHP] Audio CAPTCHA review request

2007-04-06 Thread Robert Cummings
On Fri, 2007-04-06 at 09:08 -0400, tedd wrote:
 At 6:36 PM -0400 4/5/07, Robert Cummings wrote:
 But still, relying on Javascript is a bit flakey IMHO.
 
 There's nothing wrong with javascript -- you just need to know it's 
 limitations.

*lol* You misunderstood me, I'm in no way dissing on Javascript, in fact
I love Javascript, I wish we could re-bind functions and stuff (without
runkit :) and have closures in PHP. What I'm saying is that's it's a
fairly poor choice from an accessibility perspective.

 My audio captcha relies on javascript, namely ajax. The problem I had 
 was how to deliver the sound once the user requested it from the main 
 page. I used bgsound and embed tags to accomplish that after 
 browser sniffing. However, those tags had to be in a new page to 
 play, which required a refresh.

Why do you need to refresh? I had a DHTML/Ajax chat client I built and I
just pumped flash tags into a div to play tones when new messages were
detected. I didn't bother browser sniffing though, just made the
assumption that flash existed.

  After that, the user had to be sent 
 back to the main page to enter the key, which required another 
 refresh. A screen reader will re-read each page out-loud upon each 
 refresh and that was unacceptable.
 
 So, I used ajax to change the main page without a refresh using an 
 iframe tag. That way the sound file was played without refreshing 
 anything. I thought that clever. :-)
 
 In this case, there was no way to get around using javascript. 
 However, that's not a problem for visually impaired users nor is it a 
 security issue.
 
 At 6:36 PM -0400 4/5/07, Robert Cummings wrote:
 Perhaps using two
 combined systems... more traditional obscured writing on image captcha,
 or a simple mathematical question for texties, or the system you
 presented with an audible ding for blind people to know they are within
 the field of success.
 
 That's the idea unless I can come up with a way that would be 
 accessible to all. I think simple captchas like type in the number 
 seven four six would be one, but that appears easy to crack.

I think in general, unless you're hosting a hugely popular site, few wil
attempt to custom crack your site's captcha -- there's an expected value
investment to going to the trouble. Perhaps a good system would be to
treat captcha algorithms like passwords, and change the way it works
every few weeks :) On of the great things about the English language is
that so many things can be written in so many ways. One of the bad
things about the English language is that so many things can be written
in so many ways. :B

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Audio CAPTCHA review request

2007-04-06 Thread tedd

At 7:54 PM +0200 4/5/07, Tijnema ! wrote:

About your dot-captcha program tedd, it's another trick, it hasn't
been used yet, so somebody needs to look at it to crack. Like Jochem
said, if someone really wants to break it, he will do it. Making a
real though CAPTCHA isn't that hard, it's hard to create a CAPTCHA
that's easy to the user, but very hard to bots.


I realize that no captcha will be 100 percent successful in keeping 
spammy out for if it was then spammy would hire cheap human help to 
defeat them. However, that's more expensive than a bots and I like 
making spammy's job harder and more expensive.


Side note -- I've actually had spammy single me out and do all sorts 
of nasty stuff, so my efforts are not going unnoticed.



I was thinking about animation, very simple like a moving dot. Did it
move from left to right, right to left, top to bottom or bottom to
top?


What about the dyslexic?

I had a similar idea in that I would present a string like A7F3 
where I would ask Please enter the second character from the left. 
Unfortunately, those who are dyslexic would have problems with that.



As animated images/flash/movies are really though items to parse for a
bot. So just creating an AVI made up from a few simple frames.
Everyone can see if which side the dot moves. But yet, there's no
movie support in PHP, i discussed this on the internals list, but
nobody seems interested, and this is the case i need it again :).


For animated images, I use gifs (like a spinning wait gif). Your idea 
could be done with that, but again asking someone which way the dot 
moves is not accessible -- it even narrows the numbers for the 
sighted group.



I was thinking about creating random frames from PHP(also a random
number, with different frame rates) and then creating an movie from
that frames. I prefer no compression then, because that would require
the user to install decoders. I think these days every user has a
browser supporting inline movies right?
I know, this wouldn't stop the semi-automatic bots, but i think these
are very hard to stop. (Unstoppable maybe?)


Php animation could be done via ajax. You need to have something on 
the user's side to communicate when to run each php frame. This is 
similar to trying to write a php progress bar for up/down-loading -- 
it's a question of communication and timing.


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] Error after add php_apc.dll

2007-04-06 Thread Bagus Nugroho
Hi All,
I'm just add php_apc.dll in my module, but when I'm restart apache there error 
as :

The instruction at 0x097f2e5e referenced memory at 0x0019. The memory 
could not be read.

 
Is this cause of the module or apache itself?
 
Thanks in advance
bn


Re: [PHP] Audio CAPTCHA review request

2007-04-06 Thread Tijnema !

On 4/6/07, tedd [EMAIL PROTECTED] wrote:

At 7:54 PM +0200 4/5/07, Tijnema ! wrote:
About your dot-captcha program tedd, it's another trick, it hasn't
been used yet, so somebody needs to look at it to crack. Like Jochem
said, if someone really wants to break it, he will do it. Making a
real though CAPTCHA isn't that hard, it's hard to create a CAPTCHA
that's easy to the user, but very hard to bots.

I realize that no captcha will be 100 percent successful in keeping
spammy out for if it was then spammy would hire cheap human help to
defeat them. However, that's more expensive than a bots and I like
making spammy's job harder and more expensive.

Side note -- I've actually had spammy single me out and do all sorts
of nasty stuff, so my efforts are not going unnoticed.

I was thinking about animation, very simple like a moving dot. Did it
move from left to right, right to left, top to bottom or bottom to
top?

What about the dyslexic?

I had a similar idea in that I would present a string like A7F3
where I would ask Please enter the second character from the left.
Unfortunately, those who are dyslexic would have problems with that.


Nah, maybe clarify it with images, then nobody would have trouble
seeing what it does,atleast everyone that still can see :)


As animated images/flash/movies are really though items to parse for a
bot. So just creating an AVI made up from a few simple frames.
Everyone can see if which side the dot moves. But yet, there's no
movie support in PHP, i discussed this on the internals list, but
nobody seems interested, and this is the case i need it again :).

For animated images, I use gifs (like a spinning wait gif). Your idea
could be done with that, but again asking someone which way the dot
moves is not accessible -- it even narrows the numbers for the
sighted group.


I know, but animated gifs are still quite easy to read with a bot.


I was thinking about creating random frames from PHP(also a random
number, with different frame rates) and then creating an movie from
that frames. I prefer no compression then, because that would require
the user to install decoders. I think these days every user has a
browser supporting inline movies right?
I know, this wouldn't stop the semi-automatic bots, but i think these
are very hard to stop. (Unstoppable maybe?)

Php animation could be done via ajax. You need to have something on
the user's side to communicate when to run each php frame. This is
similar to trying to write a php progress bar for up/down-loading --
it's a question of communication and timing.

Cheers,

tedd


Also using this solution, it probably will work, but it will be easy
to crack

Tijnema

--
---
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] Simple question on simplexml

2007-04-06 Thread Timothy Murphy

I have a catalog in XML format:
?xml version=1.0 encoding=iso-8859-1 ?
catalog
  book
...
  book
  book
...
  book
  ...
/catalog

Now I want to add another book,
which I have as a SimpleXMLElement:

$book = new SimpleXMLElement($string);

where $string reads
  book
...
  book

Can I add this new entry to the catalog
using SimpleXML functions,
or do I have to introduce a DOMDocument?

As may be obvious, I am very new to PHP programming;
and advice or suggestions gratefully received.

-- 
Timothy Murphy  
e-mail (80k only): tim /at/ birdsnest.maths.tcd.ie
tel: +353-86-2336090, +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

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



Re: [PHP] Audio CAPTCHA review request

2007-04-06 Thread tedd

At 10:17 AM -0400 4/5/07, Jason Pruim wrote:

There has to be some commonality -- any suggestions?


Would it be possible to change the phrase in your audio captcha 
depending on the character set chosen by the user? In other words, 
if someone is using a chinese character set, could you have it say 
3 5 7 in chinese?


Certainly, that's possible. However, I don't speak any of those languages.

I did think of a way if a user wanted to use my technique could speak 
a single phrase counting from zero to nine and my software could 
create the necessary files from that. So, that could be done -- 
however, I don't have the resources/people to distribute it.


Or maybe just have a button to select to play it in chinese (Or 
french, dutch, spanish, etc. etc.)


Interesting -- I had a lengthy discussion as to what that button 
would be. I thought a flag icon would do, but wouldn't work. The 
best solution was to use text of the language to spell the language.


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] PHP textbook suggestions?

2007-04-06 Thread Chris Lott

I'd still like some actual recommendations for a good book for beginners.

I think this discussion is getting a little ridiculous... I have my
preferences for a textbook based on 5 years of experience in teaching
this class. Of course I teach my students about superfluous
parentheses as in:

print (me);

And the difference in quoting styles...

But these are COMPLETE beginners, even beyond beginners, many having
never even really thought about programming. I am lucky if 1/2 of them
have basic HTML. So they get easily confused by differences in sample
code... sure they learn, eventually, to deal with that, but if I can
avoid making it harder on them I will.

I prefer not having variables in double quotes for the most part--
syntax highlighters do a better job, and in the confusing (especially
for a beginners) jumble of quoted HTML attributes and PHP syntax,
etc... it is easier to spot and see the variables. And it reinforces
the difference between displaying a variable and its contents.

All that being said, I've yet to see two books that are consistent
with one another, much less with me, so I said it was a PREFERENCE.
All of your argument has resulted in-- as far as I can tell-- one
anti-recommendation.

So if anyone has any productive ideas for a good textbook for
beginners, my ears are open.

c
--
Chris Lott

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



Re: [PHP] PHP textbook suggestions?

2007-04-06 Thread Chris Lott

I see a couple of recommendations for textbooks now... thanks.

As to why I think one style is good or bad-- probably the same reasons
any of you prefer yours + in my experience, the style that I have
adopted is the easiest for the beginners to understand and not be
confused by. This list (naturally) underestimates how hard it is for
non-techie, non naturally tech-inclined newbies to approach language
syntax. The quotation thing is a good example-- they are taught about
interpolation and trying to learn about quotation marks and escaping
and when each is appropriate, then they are shown code like:

echo substr(abcdef, 1);

So they naturally want to know-- why the double quotes? And there's no
good logical reason for double quotes in the example-- and there are
languages where the function could take a variable to be interpolated
that DOES need double quotes-- so it is very confusing to them.

If I CAN, I would like to avoid that confusion so *I* Can teach them
about the differences.

Similarly my preference and teaching that they keep variables out of
quotes-- it's a style thing, something I consider good practice,
something I see most code examples I find use, so if I could find a
text that did it, that would be great. For that matter, even a text
that didn't do it but was CONSISTENT. It's amazing how many books are
totally inconsistent. These students aren't at a level where
inconsistency is the best approach to stimulating their learning. They
get there, but it takes a while.

c
--
Chris Lott

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



RE: [PHP] PHP textbook suggestions?

2007-04-06 Thread Jay Blanchard
[snip]
I see a couple of recommendations for textbooks now... thanks.
[/snip]

One of the problems is trying to find a textbook for beginning
programmers, then adding the specifics of PHP on top of it. The best
that I can think of would be PHP for Dummies as it assumes no prior
programming experience, is a light-hearted read, and covers such basic
topics as why double quotes and basic logic. You will even get a dose
of OOP thrown in for good measure.

Things like quoting styles are the foundations for holy wars, much like
the wars concerning print v. echo, bracket style, etc. and really have
no relevance to what you are trying to do (I appreciate those who
weighed in on the subject...but it was of little help to the OP). There
are several good PHP books out, but most if not all assume a certain
level of experience with regards to programming; procedural v. OOP, a
knowledge of HTML, etc.

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



Re: [PHP] Audio CAPTCHA review request

2007-04-06 Thread tedd

At 9:24 AM -0400 4/6/07, Robert Cummings wrote:

What I'm saying is that's it's a
fairly poor choice from an accessibility perspective.


I thought that as well, but it seems that at least visually impaired 
users using screen readers don't have any problems with it.


Not that I have any support for this claim, but perhaps relying on a 
screen reader requires it's use -- I don't know.





 My audio captcha relies on javascript, namely ajax. The problem I had
 was how to deliver the sound once the user requested it from the main
 page. I used bgsound and embed tags to accomplish that after
 browser sniffing. However, those tags had to be in a new page to
 play, which required a refresh.


Why do you need to refresh? I had a DHTML/Ajax chat client I built and I
just pumped flash tags into a div to play tones when new messages were
detected. I didn't bother browser sniffing though, just made the
assumption that flash existed.


I tried flash, see:

http://sperling.com/examples/assorted-captcha/

but that required that flash to be turned on and not all visually 
impaired users have a need for flash. In fact, if you do use flash, 
then you have to tell them or they don't know what you're trying to 
do.


It was much simpler to do it the way I did with just html.


I think in general, unless you're hosting a hugely popular site, few wil
attempt to custom crack your site's captcha -- there's an expected value
investment to going to the trouble. Perhaps a good system would be to
treat captcha algorithms like passwords, and change the way it works
every few weeks


I've thought about creating a database that would provide questions 
and answers for my captcha's. That way I could add questions everyday 
creating thousands of different combinations of simple questions. 
However, this would require the user to have his own dB and update 
his dB from my site periodically -- thus, a bit more sophisticated 
user. I would be willing to do this once I'm convinced that this 
method would be more accessible than any other.


However, it would be a simple matter for spammy to download all the 
keys from my site and use them thus defeating the whole idea, duh. 
So, if I was to support this method, then each capatcha user would 
have to come up with their own questions, which could be problematic.


Need to think more.

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] Audio CAPTCHA review request

2007-04-06 Thread tedd

At 2:55 PM +0100 4/6/07, Tijnema ! wrote:

I know, but animated gifs are still quite easy to read with a bot.


Really?

What if I a created a box surrounded by letters, like so:

A B C
D E F
G H I

However, where E is located I have a gif (animated or not) pointing 
to a letter, which would be the key. How would a bot read that?


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] Re: link counting

2007-04-06 Thread Jonesy
On Fri, 06 Apr 2007 09:01:20 -0400, Sebe wrote:
 i thought of an idea of counting the number of links to reduce comment spam.

 unfortunately my methods is not reliable, i haven't tested it yet 
 though.. anyone have maybe a better solution using some regexp?

 $links = array('http://', 'https://', 'www.');

 $total_links = 0;
 foreach($links as $link)
 {
  $total_links = substr_count($string, $link);
 }

 if($total_links  X)
 {
 .
 }

What I use:


 function check_bad_content($string)
 {
  // Stuff that spammers post with:
  $bad_strings =  array('www.','/url]','ttp://','ttps://') ;

  foreach( $bad_strings as $bad_string )
  {
   if ( ereg( $bad_string, $string ) ) return false ;
  }

  return true;

 }  // E-O- function check_bad_content


I permit _*NO*_ URL's on my message board.  I guess you could just as 
easily count them in the function above -- versus setting TRUE/FALSE.

Jonesy
-- 
  Marvin L Jones| jonz  | W3DHJ  | linux
   38.24N  104.55W  |  @ config.com | Jonesy |  OS/2
*** Killfiling google posts: http://jonz.net/ng.htm

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



Re: [PHP] Idea/Suggestion for PHP App

2007-04-06 Thread tedd

At 2:06 PM -0500 4/5/07, [EMAIL PROTECTED] wrote:
Hey... I am new to the list so please forgive me if I say anything 
that might have already been discussed.  So here we go...


OK I am attempting to start a new application using PHP.  I have 
started and stoped this application now 2 times cause I get moving 
then I stop realizing I should have done this work before hand and 
in a differant way.  I was wondering does anyone have any places I 
can read on how develope a PHP Web application like what area should 
I start with first, what are somethings I need to think about before 
hand.  The application I am working on is Database driven app.  It 
will have data inserted into the DB from various data sources that 
are manually entered.


However I need to develope the app as dynamic as possible for future 
add-ons... I know I am probably biting off more then I can chew at 
this time... So any pointers or exampled (which would be great) on 
how to start an app from scratch and also how to use OOP (Which I 
have a feeling is what I need to learn) would be wonderful.  Thank 
you all for any help you can provide.


Thanks,

Billy S.


Billy:

The best advice I can give you is to buy several php/mysql books and 
read them. Then implement the examples they give you and slowly build 
all the routines you will need to create your application.


The idea that you can create a complicated application without 
knowing how, is filed with unnecessary complications and frustrations 
-- don't do it.


As with ALL programming problems -- start small, reduce all problems 
into smaller problems that you can solve. Then assemble the small 
solutions together after careful consideration of what you're trying 
to do.


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] Idea/Suggestion for PHP App

2007-04-06 Thread tedd

At 9:59 PM +0200 4/5/07, [EMAIL PROTECTED] wrote:

and yes, I (still) use paper and pencil because never find good app for
it. if you can recommend - I'll be more than happy to use it and stop
wasting paper (agree with you on poor tree :D)

-afan


Pencil and paper? What's that?

I had a good friend who said -- A program is nothing more than three 
steps: input; calculation; and display. I've always found that's a 
good start.


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] PHP textbook suggestions?

2007-04-06 Thread Jochem Maas
Chris Lott wrote:
 I'd still like some actual recommendations for a good book for beginners.
 
 I think this discussion is getting a little ridiculous... I have my
 preferences for a textbook based on 5 years of experience in teaching
 this class. Of course I teach my students about superfluous
 parentheses as in:
 
 print (me);
 
 And the difference in quoting styles...
 
 But these are COMPLETE beginners, even beyond beginners, many having
 never even really thought about programming. I am lucky if 1/2 of them
 have basic HTML. So they get easily confused by differences in sample
 code... sure they learn, eventually, to deal with that, but if I can
 avoid making it harder on them I will.
 
 I prefer not having variables in double quotes for the most part--
 syntax highlighters do a better job, and in the confusing (especially
 for a beginners) jumble of quoted HTML attributes and PHP syntax,
 etc... it is easier to spot and see the variables. And it reinforces
 the difference between displaying a variable and its contents.
 
 All that being said, I've yet to see two books that are consistent
 with one another, much less with me, so I said it was a PREFERENCE.
 All of your argument has resulted in-- as far as I can tell-- one
 anti-recommendation.

which Jay completely countered ;-)

 
 So if anyone has any productive ideas for a good textbook for
 beginners, my ears are open.

I don't have personal experience with beginner books but the following
caught my attention, it seems to have pretty good reader reviews:

http://www.amazon.com/PHP-MySQL-Dynamic-Web-Sites/dp/0321186486/sr=8-6/qid=1162762408/ref=pd_bbs_6/002-0085017-3836034?ie=UTF8s=books


 
 c
 -- 
 Chris Lott
 

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



Re: [PHP] Simple question on simplexml

2007-04-06 Thread Jochem Maas
there is this:

http://php.net/manual/en/function.simplexml-element-addChild.php

which will allow adding of string data (so you won't be needing to
create the new SimpleXMLElement object as per your example below).

obviously you will have to first load tghe complete xml document
into simplexml using one of the following:

http://php.net/manual/en/function.simplexml-load-file.php
http://php.net/manual/en/function.simplexml-load-string.php

Timothy Murphy wrote:
 I have a catalog in XML format:
 ?xml version=1.0 encoding=iso-8859-1 ?
 catalog
   book
 ...
   book
   book
 ...
   book
   ...
 /catalog
 
 Now I want to add another book,
 which I have as a SimpleXMLElement:
 
 $book = new SimpleXMLElement($string);
 
 where $string reads
   book
 ...
   book
 
 Can I add this new entry to the catalog
 using SimpleXML functions,
 or do I have to introduce a DOMDocument?
 
 As may be obvious, I am very new to PHP programming;
 and advice or suggestions gratefully received.
 

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



Re: [PHP] Idea/Suggestion for PHP App

2007-04-06 Thread tedd

At 4:23 PM -0400 4/5/07, Robert Cummings wrote:

I use two things... my brain for the overall idea. A notes.txt file for
specific remarks that are too complicated to keep up top :)

Cheers,
Rob.


I use: 1) my vast (literally hundreds) of working examples created 
from dozens of my php, mysql, ajax, html, and javascript books; 2) 
online resources; 3) and hundreds of various common functions stored 
in my notes application Yojimbo.


From there, it's a matter of assembling the right routines to solve 
the problem at hand.


It's kind of a learned the hard way perspective to design patterns. 
I'm one of those types that think nothing is impossible with the 
right money and enough time.


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] link counting

2007-04-06 Thread Paul Novitski

At 4/6/2007 06:01 AM, Sebe wrote:

i thought of an idea of counting the number of links to reduce comment spam.



I do this by counting the number of 'http://' instances in the 
text.  You can use a variety of PHP functions:


- substr_count()
- preg_match_all() then count() the result array
- str_split() then count()
- preg_split() then count()

preg_split() is useful if you want to split the text by more than one 
string; simply separate alternative strings in the pattern with the 
pipe: '(http://|a )'


However, in my personal experience, contact form spam links always 
contain 'http://' but they're not always couched in anchor tags, so 
I've never found the need to search for more than the one pattern.


substr_count() is case-sensitive so you'll want to make a copy of the 
message text lowercase using strtolower() to catch all variants of 
http|HTTP|Http|...  substr_count() is probably also faster than the 
regular expression functions -- not that a difference of microseconds 
or milliseconds need necessarily concern you if you're not executing 
many iterations.


I usually set the limit of permissible links to three.  Since it's 
entirely possible that a genuine correspondent might send more than 
three links someday, I don't throw away suspect messages but instead 
send them to my own mailbox coded so they're easy to catch and file 
on receipt; that way I can monitor the health of the system and watch 
for false positives while still shielding my clients from spam.


Typically I'll display an error message when someone fills out a 
contact form incorrectly, for example asking them to enter a valid 
email address.  Recently, however, I've stopped warning the sender if 
they try to send a message that looks like spam because I don't want 
to tech spammers how to circumvent my criteria.  I send the suspect 
message to my monitoring mailbox instead of to the intended recipient 
and let the spammers think they've succeeded.  I feared at first that 
this would encourage spammers to use my contact forms more, but it 
hasn't appeared to have had that effect.


Documentation links:
http://php.net/count
http://php.net/pcre.pattern.syntax
http://php.net/preg_match_all
http://php.net/preg_match_all
http://php.net/preg_split
http://php.net/strtolower
http://php.net/substr-count

Regards,

Paul
__

Paul Novitski
Juniper Webcraft Ltd.
http://juniperwebcraft.com 


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



RE: [PHP] Idea/Suggestion for PHP App

2007-04-06 Thread tedd

At 1:36 PM -0700 4/5/07, Warren Vail wrote:

 (Google is also your friend :-)).  Look for code
and modules that you can employ in your solutions



Let me add to that -- sometimes when I am trying to see how a 
function/technique/code is used, I simply take a quoted portion of 
the code and Google it. It's surprising how many examples you can 
find to review as to how others implemented that small piece of code.


This is truly a resource that has never been there for programmers before.

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] Idea/Suggestion for PHP App

2007-04-06 Thread Robert Cummings
On Fri, 2007-04-06 at 11:41 -0400, tedd wrote:
 At 4:23 PM -0400 4/5/07, Robert Cummings wrote:
 I use two things... my brain for the overall idea. A notes.txt file for
 specific remarks that are too complicated to keep up top :)
 
 Cheers,
 Rob.
 
 I use: 1) my vast (literally hundreds) of working examples created 
 from dozens of my php, mysql, ajax, html, and javascript books; 2) 
 online resources; 3) and hundreds of various common functions stored 
 in my notes application Yojimbo.
 
  From there, it's a matter of assembling the right routines to solve 
 the problem at hand.
 
 It's kind of a learned the hard way perspective to design patterns. 
 I'm one of those types that think nothing is impossible with the 
 right money and enough time.

All these things require your brain.

Thank you, I'll be here all day :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Bug with passing objects by reference and assigning a defeault null?

2007-04-06 Thread Shu Chow
Has anyone tried to assign a default value of null for an object passed 
by reference in PHP4?


Let's say I had this code:

  $mObj = new testModel();
  $mObj-msg = Bubba;

  testFunc();

  class testModel {
var $msg;
  }

  function testFunc($msg=null) {
echo $msg-msg;
  }

Under PHP5, this works fine.

Under PHP4, the = will cause an error:  Parse error: syntax error, 
unexpected '=', expecting ')'.  Removing the  in the parameter 
definition makes it work.  I'm using 4.4.2 right now, but don't see 
anything in the later change logs that say this was fixed.  I also don't 
find any mention of it in the bugs list.  Is this a legit bug or am I 
committing a big no-no?


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



Re: [PHP] Bug with passing objects by reference and assigning a defeault null?

2007-04-06 Thread Robert Cummings
On Fri, 2007-04-06 at 12:19 -0400, Shu Chow wrote:
 Has anyone tried to assign a default value of null for an object passed 
 by reference in PHP4?
 
 Let's say I had this code:
 
$mObj = new testModel();
$mObj-msg = Bubba;
 
testFunc();
 
class testModel {
  var $msg;
}
 
function testFunc($msg=null) {
  echo $msg-msg;
}
 
 Under PHP5, this works fine.
 
 Under PHP4, the = will cause an error:  Parse error: syntax error, 
 unexpected '=', expecting ')'.  Removing the  in the parameter 
 definition makes it work.  I'm using 4.4.2 right now, but don't see 
 anything in the later change logs that say this was fixed.  I also don't 
 find any mention of it in the bugs list.  Is this a legit bug or am I 
 committing a big no-no?

Not a bug, it's a limitation of PHP4.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Audio CAPTCHA review request

2007-04-06 Thread Tijnema !

On 4/6/07, tedd [EMAIL PROTECTED] wrote:

At 2:55 PM +0100 4/6/07, Tijnema ! wrote:
I know, but animated gifs are still quite easy to read with a bot.

Really?

What if I a created a box surrounded by letters, like so:

A B C
D E F
G H I

However, where E is located I have a gif (animated or not) pointing
to a letter, which would be the key. How would a bot read that?

Cheers,

tedd


Assuming you're using the same arrow the whole time, you could use md5
check for example. Save MD5 for all directions of the arrow and
compare :)

Tijnema


--
---
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Submitting as POST. Why?

2007-04-06 Thread barophobia

My Peeps,

I only know of one reason to submit a form as POST and that is because
you can submit more data in one shot.


What other reasons are there?



Chris.

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



[PHP] Need a working SOAP example using PHP SOAP

2007-04-06 Thread Daevid Vincent
I've been searching all day (read wasting) trying to get a working SOAP
example that uses the new PHP SOAP functions.

http://us2.php.net/manual/en/ref.soap.php

I've tried this one from nearly THREE years ago (03/16/2004):
http://devzone.zend.com/node/view/id/689

And this one, which is apparently written in the future (05/01/2007):
http://www.netmag.co.uk/zine/develop/make-your-own-soap

Nothing works. Mostly I get these very unhelpful errors:

Fatal error:  Uncaught SoapFault exception: [HTTP] Could not connect to host
in /home/machine/StockQuote/client3.php:6
Stack trace:
#0 [internal function]: SoapClient-__doRequest('?xml version=...',
'http://machine', 'urn:xmethods-de...', 1, 0)
#1 [internal function]: SoapClient-__call('getQuote', Array)
#2 /home/machine/StockQuote/client3.php(6): SoapClient-getQuote('ibm')
#3 {main}
  thrown in /home/machine/StockQuote/client3.php on line 6

Now you might think, Can you actually get to the host?. And why YES, if I
try to hit the server1.php page that is defined in the WDSL file, I get
this error:

SOAP-ENV:ServerBad Request. Can't find HTTP_RAW_POST_DATA

Also, I have soap.wsdl_cache_enabled = 0, yet how come I still see
wsdl-47087234058273450982734508 files in /tmp ?! (yes I've restarted apache)

Does anyone know of a current, WORKING, example, ideally in a .tar file or
something so I don't have to waste a lot more time copy/paste/format/remove
whitespace/etc.?

It's also frustrating that the PHP SOAP function section doesn't have an
example, nor even links to an example. :-\

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



Re: [PHP] Submitting as POST. Why?

2007-04-06 Thread Jochem Maas
barophobia wrote:
 My Peeps,
 
 I only know of one reason to submit a form as POST and that is because
 you can submit more data in one shot.
 
 
 What other reasons are there?

upload a file?
not have bag of cruft in the url/addressbar?
because POST and GET are semantically different ...

POST assumes that the submission may have side effects (e.g. registration, send 
a email, update a page)
GET assumes no such thing, you merely 'get' a page from the server.

 
 
 
 Chris.
 

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



Re: [PHP] Submitting as POST. Why?

2007-04-06 Thread Mike Shanley

Chris,

When you submit via GET, all the info shows up in the URL, so people can 
tamper with it however they like. Also, people can bookmark it as well.


With POST, everything stays hidden, mostly untamperable, and 
unbookmarkable. POST might sound clearly better, but unless it's 
important that people don't change anything, then go with GET.


barophobia wrote:

My Peeps,

I only know of one reason to submit a form as POST and that is because
you can submit more data in one shot.


What other reasons are there?



Chris.



--
Mike Shanley

~you are almost there~

A new eye opens on March 5. -Omniversalism.com

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



Re: [PHP] Need a working SOAP example using PHP SOAP

2007-04-06 Thread Jochem Maas
not very helpful, but an apt quote from 'the man':

http://fplanque.net/Blog/devblog/2005/12/21/rasmus_i_don_t_like_soap

Daevid Vincent wrote:
 I've been searching all day (read wasting) trying to get a working SOAP
 example that uses the new PHP SOAP functions.
 
 http://us2.php.net/manual/en/ref.soap.php
 
 I've tried this one from nearly THREE years ago (03/16/2004):
 http://devzone.zend.com/node/view/id/689
 
 And this one, which is apparently written in the future (05/01/2007):
 http://www.netmag.co.uk/zine/develop/make-your-own-soap
 
 Nothing works. Mostly I get these very unhelpful errors:

a, they are helpful
b, you should catch exceptions
c, could you be having a problem related to the allow_url_fopen ini setting?

 
 Fatal error:  Uncaught SoapFault exception: [HTTP] Could not connect to host
 in /home/machine/StockQuote/client3.php:6
 Stack trace:
 #0 [internal function]: SoapClient-__doRequest('?xml version=...',
 'http://machine', 'urn:xmethods-de...', 1, 0)
 #1 [internal function]: SoapClient-__call('getQuote', Array)
 #2 /home/machine/StockQuote/client3.php(6): SoapClient-getQuote('ibm')
 #3 {main}
   thrown in /home/machine/StockQuote/client3.php on line 6
 
 Now you might think, Can you actually get to the host?. And why YES, if I
 try to hit the server1.php page that is defined in the WDSL file, I get
 this error:
 
 SOAP-ENV:ServerBad Request. Can't find HTTP_RAW_POST_DATA
 
 Also, I have soap.wsdl_cache_enabled = 0, yet how come I still see
 wsdl-47087234058273450982734508 files in /tmp ?! (yes I've restarted apache)

probably soap uses these tmp files but because soap.wsdl_cache_enabled is Off
the files are being regenerated on each request (check the file mtimes).
alternatively you may think soap.wsdl_cache_enabled is Off but actually its 
being
turned On somewhere?

 
 Does anyone know of a current, WORKING, example, ideally in a .tar file or
 something so I don't have to waste a lot more time copy/paste/format/remove
 whitespace/etc.?
 
 It's also frustrating that the PHP SOAP function section doesn't have an
 example, nor even links to an example. :-\

there is quite a bit of example code in the SOAP section if you ask me:

http://php.net/manual/en/function.soap-soapclient-construct.php

 

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



Re: [PHP] Submitting as POST. Why?

2007-04-06 Thread Robert Cummings
On Fri, 2007-04-06 at 20:44 -0400, Mike Shanley wrote:
 Chris,
 
 When you submit via GET, all the info shows up in the URL, so people can 
 tamper with it however they like. Also, people can bookmark it as well.

Quite true.

 With POST, everything stays hidden, mostly untamperable, and 

Bullshit. It is VERY easy to tamper with post data.

 unbookmarkable. POST might sound clearly better, but unless it's 
 important that people don't change anything, then go with GET.

I go with POST almost exclusively when doing forms. I do so because my
form engine embeds various information (non-security sensitive
information) for the form. It works using get also, but it's ugly having
stuff like that in the URL. Additionally, for longer forms, there's a
limit to which browsers must adhere to acknowledge. I believe browsers
are only required to process 1024 bytes from a URL. Obviously some
browsers will process more, but now you're counting on a non-standard
feature. For the most part, if there's stuff in the URL parameters, then
they came from a link or a redirect.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



RE: [PHP] Need a working SOAP example using PHP SOAP

2007-04-06 Thread Daevid Vincent
 not very helpful, but an apt quote from 'the man':
 http://fplanque.net/Blog/devblog/2005/12/21/rasmus_i_don_t_like_soap

Yeah, unfortunately, I *must* use SOAP. Not my choice, but politics and
company decree, blah blah...

 b, you should catch exceptions

These were the examples from the page. I didn't want to add extra
complexity.

 c, could you be having a problem related to the 
 allow_url_fopen ini setting?

Now we're talkin!

Okay, I made sure that allow_url_fopen and allow_url_include are both on.
Verified via phpinfo();

Still no luck. :-\

However, this sparked an idea...

I have been using my WinXP and IE to hit my Gentoo notebook running
apache2/php/etc. (samba mounting the /home/machine/... to edit the files)

When I fired up KDE and hit the EXACT same pages (which are now local), they
magically worked!

So now the question is, what setting do I have to change in my php.ini file
to get remote requests to work?

 alternatively you may think soap.wsdl_cache_enabled is Off 
 but actually its being
 turned On somewhere?

It's off in the php.ini file, also specifically turned off in each
server.php file. Verified off via phpinfo();

  It's also frustrating that the PHP SOAP function section 
 doesn't have an
  example, nor even links to an example. :-\
 
 there is quite a bit of example code in the SOAP section if 
 you ask me:
 
   http://php.net/manual/en/function.soap-soapclient-construct.php

No. those are fragments of ways to call the methods. 
NOT full working examples of client/server/wsdl

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



Re: [PHP] Submitting as POST. Why?

2007-04-06 Thread Paul Novitski



barophobia wrote:

I only know of one reason to submit a form as POST and that is because
you can submit more data in one shot.


At 4/6/2007 05:44 PM, Mike Shanley wrote:
When you submit via GET, all the info shows up in the URL, so people 
can tamper with it however they like. Also, people can bookmark it as well.



In fact that very tamperability is one of the advantages of GET.  For 
certain types of service it can be a boon to the user to be able to 
tweak the querystring.  It enables even mildly technically-oriented 
people to roll their own queries for search engines, map engines, 
online resource guides, catalogs, etc.


When I deliberately expose the communication channel between a form 
and a lookup engine like that, I try to choose querystring parameter 
names that are simple and easy to remember such as isbn, author, and title.


Obviously you have to make sure someone can't hack your system 
through the querystring, but you should already be doing this anyway 
whether you're using POST or GET.


Regards,

Paul
__

Paul Novitski
Juniper Webcraft Ltd.
http://juniperwebcraft.com 


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



[PHP] PHP has encountered an Access Violation at 01F13157?!?!?!?

2007-04-06 Thread Afan Pasalic

hi,
I just installed php 5.2.1-win32-installer on win box (XP). use IIS.
created index.html file and localhost/index.html is ok.
created phpinfo.php (with only phpinfo()) and was ok.
then installed Zend 5.5.0 (try) and suddenly, IE is giving me blank screen.
installed firefox 2 and got the error message from subject line.

according google and php.net, it's bug?!?

any idea?

thanks for any help.

-afan

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