php-general Digest 29 Aug 2008 07:53:34 -0000 Issue 5651
php-general Digest 29 Aug 2008 07:53:34 - Issue 5651 Topics (messages 278915 through 278939): Re: Regex for email validation 278915 by: tedd www.yfrindia.com 278916 by: YFR India Re: concatenating with . or , 278917 by: tedd Re: Manual Coding vs. CMS Systems OT 278918 by: Jochem Maas Re: grab the complete commandline used ... 278919 by: Jochem Maas 278920 by: Jochem Maas 278928 by: Micah Gersten 278933 by: Jochem Maas 278935 by: Robert Cummings A better XSS trap (Feedback wanted) 278921 by: Christopher Vogt Problems sending $_POST vairable to an ASP page 278922 by: shaun thornburgh 278923 by: Jay Blanchard 278924 by: Ólafur Waage 278925 by: shaun thornburgh 278926 by: Jay Blanchard 278930 by: shaun thornburgh 278937 by: Stut ASCII Captcha 278927 by: Ólafur Waage 278932 by: tedd Re: Manual Coding vs. CMS Systems 278929 by: Lester Caine 278931 by: Larry Garfield 278934 by: Jochem Maas Re: Variable name as a string 278936 by: ioannes 278939 by: Bren Norris Is this a bug? 278938 by: Catalin Zamfir Alexandru, DATAGRAM SRL Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- At 9:34 AM +0200 8/28/08, Per Jessen wrote: Yeti wrote: That Rx.com domain name is really great stuff, but how do you expect the average user to type it in? Sorry, I don't understand the problem. The average user will obviously have a suitable keyboard, such as this for instance: http://en.wikipedia.org/wiki/Image:KB_Swiss.svg /Per Jessen, Zürich I hope you're right. However, it's one thing to have a keyboard designed for a specific language and another to be able to enter code-points that aren't associated with any specific language (i.e., Dingbats and Math Symbols). For example, note that Rx,com is not associated with any language, which is the same as many of my other domains, as you can see some here: http://symboldomains.com/symbol-domains-for-sale.html I bought most of these eight years ago hoping that someone would see things the way I do. But despite all my time, effort, and cost -- the only thing I have received is being called a goofy nitwit -- which I probably am -- but I would like to think of myself as an entertaining nitwit. :-) I have grandiose plans, but unfortunately I'm the only one who see's them. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- http://www.yfrindia.com/ Take FREE online TEST, read FREE articles, download FREE presentation, use FREE source code, useful links, competition updates, free ONLINE TEST TESTS, http://www.yfrindia.com/resources/Tests free APTITUDE TEST, English Test, Computer Test, Mechanical Test, Electronics Test, Electrical Test, GATE preparation, CAT preparation, Job preparation, resume. http://www.yfrindia.com -- View this message in context: http://www.nabble.com/www.yfrindia.com-tp19208138p19208138.html Sent from the PHP - General mailing list archive at Nabble.com. ---End Message--- ---BeginMessage--- At 5:44 PM +0100 8/28/08, Ford, Mike wrote: Santa Monica, CA. I moved from Missouri to California when I was 12 just after the Feds paid my father a visit and my father took-off for parts unknown -- apparently they frown on embezzling. I didn't see my father again until I turned 30. I lived in the San Fernando Valley until after graduating from CSUN in 1975. Then I went to Michigan where I met my wife and received my MSc from MSU. Michigan is like big minnow trap -- once you swim in, you're caught. But, I don't miss California -- nice weather, but too much crime and too many people. At least Michigan is green and if you stay away from Detroit, there's not much crime either. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- Carlos Medina schreef: Watch him go... there is Carloos, the man infront of all the others. He is WAY ahead, and he is gaining more and more speed. He is an adult, and he is sooo adult that he can't even take a laugh... see him run from the humor! Faster and faster he runs... and there it is: the goal: an open casket for the people going through life without having a good laugh every now and then :o Aaanyhow... *grabs his coffee and keeps working while shaking his head because of the stupid comment posted by Carlos* Cheers :o :-) Kids yes I have one, so? did he build your website per chance? :-P btw: I have two handcoded cmses that I use to build sites with, a bunch
Re: [PHP] Problems sending $_POST vairable to an ASP page
On 28 Aug 2008, at 22:17, shaun thornburgh wrote: Hi guys, I need to send post variables to an ASP page. I have the following code which isn't producing any errors but isn't working either: foreach($_POST['newsletter-group'] as $key = $value) { $_POST['addressbookid'] = $value; $out = POST /signup.ashx; $fp = fsockopen(dmtrk.net, 80, $errno, $errstr, 30); if (!$fp) { echo $errstr ($errno)br /\n; } else { fputs($fp, $out . \r \n); } fclose($fp); } Can anyone tell me what I am doing wrong please? ?php $result = false; // I can't see in your example where you're building the POST data, but here's an example $postdata = 'var='.urlencode($value); $fp = fsockopen('dmtrk.net', 80, $errno, $errstr, 30); if (!$fp) { $result = 'Connection failed: ['.$errno.'] '.$errstr; } else { fwrite($fp, POST /signup.ashx HTTP/1.1\n); fwrite($fp, Connection: close\n); fwrite($fp, Host: dmtrk.net\n); fwrite($fp, Content-Length: .strlen($postdata).\n); fwrite($fp, Content-Type: application/x-www-form-urlencoded\n); fwrite($fp, \n.$postdata.\n); // Get the status $response = fgets($fp); $result = (strpos($response, ' 200 ') !== false); // Read the rest of the response while (!feof($fp)) { $response .= fgets($fp); } @fclose($fp); if (!$result) $result = $response; } // At this point $result will either be === true or it will contain an error message // Please don't ask a question again without doing a reasonable amount of research first. In this case that would be the HTTP spec and the PHP socket function documentation. This was not difficult! ? -Stut -- http://stut.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is this a bug?
Hello guys, I've been stalking on the list for some time. Didn't have anything to report/talk, until now. I have a code like this, maybe you guys can reproduce it, with output buffering started: Echo 'something'; Echo 'another thing'; Echo 'something br /'\; What happens is that ANYTHING that was echo'ed until that \, will not reach the buffer. Although, this should actually be a Parse Error, it isn't, it just echoes what was echoed after the god damned \. It took me two hours to find this typo in the code . Can you guys reproduce the error? I can actually give you a link to the server where this code runs.
RE: [PHP] Re: Variable name as a string
That solution would probably work just nicely. That being said however, If you want to be sophisticated about this you would make good use of JSON and php's corresponding functions json_decode/encode which is common way to transport arrays as strings - and much more. -Original Message- From: ioannes [mailto:[EMAIL PROTECTED] Sent: Friday, 29 August 2008 1:22 PM To: php-general@lists.php.net Subject: Re: [PHP] Re: Variable name as a string In writing the script, though, there are two points. I don't always use checkboxes, sometimes I just want to update all the records on the form. Eg I have a series of images and related text each with their ID in the database table, on clicking update all the form elements get submitted and I need to relate the relevant image, text, etc with the table ID. So I can't rely on checkboxes which only get posted if ticked. So again I have to iterate through all possible IDs. Which normally can be done but it is longer, eg because the images on the page in the first place may not be the result of a simple select query. So I suppose the solution there is to have a hidden field with all the IDs as a string, explode that and then iterate through that. Eg input type=hidden value=1_2_3 name=all_IDs $IDs=explode(_,$_POST['all_IDs']); and that gives me the table IDs to do update queries on etc. John ioannes wrote: Actually, you are right, as you just put the checkbox index in the POST and get the value from there. So you just need the number of checkboxes...sorry. ioannes wrote: Yes, Tedd, this does however incur the overhead of find out what i is, because it could be a range of IDs from the database, not necessarily a count of the checkboxes on the page: for ($i = 1; $i = 4; $i++) { $a = 'a' . $i; $b = 'whatever' . $i; if($_POST[$a] == 'on') { my_array[] = $_POST[$b] } } John -- 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] Is this a bug?
On Fri, 2008-08-29 at 10:40 +0300, Catalin Zamfir Alexandru, DATAGRAM SRL wrote: Echo 'something'; Echo 'another thing'; Echo 'something br /'\; I got the following output in both php5 and php4: Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/rob/bleh.php on line 7 somethinganother thingsomething br / You might want to crank up your error reporting. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
Has anyone tried a ASCII Captcha method. To use a similar method like this ASCII generator (http://www.network-science.de/ascii/) Or even gone the next level and have an ASCII based simple math question? My advice is to stick with what works. Though if you really wanted to you could investigate using Figlet to generate some ASCII and use that in a basic CAPTCHA. -- Richard Heyes HTML5 Graphing: http://www.phpguru.org/RGraph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems sending $_POST vairable to an ASP page
On 28 Aug 2008, at 23:01, shaun thornburgh wrote: Date: Thu, 28 Aug 2008 16:24:58 -0500 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; php-general@lists.php.net Subject: RE: [PHP] Problems sending $_POST vairable to an ASP page [snip] Unfortunately I don't have curl installed on my server. [/snip] Unless you can open a socket or a curl session you will not be able to post values to a remote page. Curl is your best bet, can it be installed? -- PHP General Mailing List (http://www.php.net/ ) To unsubscribe, visit: http://www.php.net/unsub.php It appears I was wrong, I do have cURL installed! In that case I'll amend my earlier answer to the following... ?php // I can't see in your example where you're building the POST data, but here's an example $postdata = 'var='.urlencode($value); if (function_exists('curl_init')) { // Do it with CURL $curl_handle = curl_init(); curl_setopt($curl_handle, CURLOPT_URL, 'http://dmtrk.net/signup.ashx') ; curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_POST, 1); curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $postdata); $result = curl_exec($curl_handle); curl_close($curl_handle); } elseif (function_exists('fsockopen')) { $fp = fsockopen('dmtrk.net', 80, $errno, $errstr, 30); if (!$fp) { $result = 'Connection failed: ['.$errno.'] '.$errstr; } else { fwrite($fp, POST /signup.ashx HTTP/1.1\n); fwrite($fp, Connection: close\n); fwrite($fp, Host: dmtrk.net\n); fwrite($fp, Content-Length: .strlen($postdata).\n); fwrite($fp, Content-Type: application/x-www-form-urlencoded\n); fwrite($fp, \n.$postdata.\n); // Get the status $response = fgets($fp); $result = (strpos($response, ' 200 ') !== false); // Read the rest of the response while (!feof($fp)) { $response .= fgets($fp); } @fclose($fp); if (!$result) $result = $response; } } else { die('No suitable mechanism for POSTing available.'); } ? Note that I've not tested this at all, but it should work. Also it would be better wrapped up in a function, but unfortunately I have real work to do today. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
On 29 Aug 2008, at 03:45, tedd wrote: These are what I've come up with: http://webbytedd.com/aa/assorted-captcha/ Just curious tedd, but what do you mean by CAPTCHA's show the world that you really haven't thought this out. If you have a better alternative I'd love to hear about it. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is this a bug?
Catalin Zamfir Alexandru, DATAGRAM SRL wrote: Hello guys, I've been stalking on the list for some time. Didn't have anything to report/talk, until now. I have a code like this, maybe you guys can reproduce it, with output buffering started: Echo 'something'; Echo 'another thing'; Echo 'something br /'\; What happens is that ANYTHING that was echo'ed until that \, will not reach the buffer. Although, this should actually be a Parse Error, it isn't, it just echoes what was echoed after the god damned \. It took me two hours to find this typo in the code . Can you guys reproduce the error? I can actually give you a link to the server where this code runs. The script doesn't cause a parse error Instead it throws a warning. 'PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in' Don't think it's a bug. And the reason there's no syntax error is because the \ is a PHP escape character. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is this a bug?
I'm using a custom ob_handler (it's a MVC framework, we need this handler). The ironic thing is that, executed once, the error doesn't show. Executed twice, the error you're talking about shows. Executed 3rd ... the same as the first execution. And I have my error_reporting to E_ALL. This happens ONLY on this kind of error, any other type of error gets reported every time. Do you have any ideea what this error type is? E_WARNING? Maybe I missed something ... And, shouldn't this be a parse error? Rather than a warning? -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Friday, August 29, 2008 10:56 AM To: Catalin Zamfir Alexandru, DATAGRAM SRL Cc: php-general@lists.php.net Subject: Re: [PHP] Is this a bug? On Fri, 2008-08-29 at 10:40 +0300, Catalin Zamfir Alexandru, DATAGRAM SRL wrote: Echo 'something'; Echo 'another thing'; Echo 'something br /'\; I got the following output in both php5 and php4: Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/rob/bleh.php on line 7 somethinganother thingsomething br / You might want to crank up your error reporting. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- 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] Braindead
Hi guys, maybe I am too stupid, but I can not see a solution for this. Have been cracking up my brain for the last hours, so I finally dare to ask. I have a database table with some columns text1 | text2 | text3 | text4 -- Now, for some stats thingy, I am trying to get the COUNT of distinct entries So, i would like to get the count of entries where text2 is foo OR text3 is foo I have 20.863 entries at the moment, and it takes quite a lot of time reading through that stuff. I have tried SELECT COUNT(*) as mycount FROM mytable WHERE text2 = 'foo' and text3 = 'foo' but I neither get an error nor any output. It just loads and loads without any output... I am out of ideas :o( Help, anybody? :o)) Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Braindead
Chris Haensel wrote: Hi guys, maybe I am too stupid, but I can not see a solution for this. Have been cracking up my brain for the last hours, so I finally dare to ask. I have a database table with some columns text1 | text2 | text3 | text4 -- Now, for some stats thingy, I am trying to get the COUNT of distinct entries So, i would like to get the count of entries where text2 is foo OR text3 is foo I have 20.863 entries at the moment, and it takes quite a lot of time reading through that stuff. I have tried SELECT COUNT(*) as mycount FROM mytable WHERE text2 = 'foo' and text3 = 'foo' but I neither get an error nor any output. It just loads and loads without any output... I am out of ideas :o( Help, anybody? :o)) Chris The amount of records is not that big to slow things down. Did you use indexes on your database? And did you try running the query through commandline or phpMyAdmin? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Braindead
-:- -Original Message- -:- From: Thijs Lensselink [mailto:[EMAIL PROTECTED] -:- Sent: Friday, August 29, 2008 10:31 AM -:- Cc: php-general@lists.php.net -:- Subject: Re: [PHP] Braindead -:- -:- Chris Haensel wrote: -:- Hi guys, -:- -:- maybe I am too stupid, but I can not see a solution for -:- this. Have been -:- cracking up my brain for the last hours, so I finally -:- dare to ask. -:- -:- I have a database table with some columns -:- -:- -:- text1 | text2 | text3 | text4 -:- -- -:- -:- -:- Now, for some stats thingy, I am trying to get the COUNT -:- of distinct entries -:- So, i would like to get the count of entries where text2 -:- is foo OR text3 is -:- foo -:- -:- I have 20.863 entries at the moment, and it takes quite -:- a lot of time -:- reading through that stuff. -:- I have tried -:- -:- SELECT COUNT(*) as mycount FROM mytable WHERE text2 = -:- 'foo' and text3 = -:- 'foo' -:- -:- but I neither get an error nor any output. It just loads -:- and loads without -:- any output... -:- -:- I am out of ideas :o( Help, anybody? :o)) -:- -:- Chris -:- -:- -:- -:- -:- The amount of records is not that big to slow things down. -:- Did you use -:- indexes on your database? And did you try running the query through -:- commandline or phpMyAdmin? -:- -:- -:- -- -:- PHP General Mailing List (http://www.php.net/) -:- To unsubscribe, visit: http://www.php.net/unsub.php -:- -:- Hi Thijs, thanks for the reply. I got mixed up with my tables :o) It's got 178.456 entries :o)) Anyhow, I tried it in a PHP script. $gq = SELECT planned_dep_ap, COUNT(*) as apcount FROM flightdb GROUP BY planned_dep_ap; $gd = mysql_query($gq) or die(mysql_error()); while($ga = mysql_fetch_assoc($gd)) { $icao = $ga['planned_dep_ap']; $apcount= $ga['apcount']; if($apcount = 100) { echo $icao. - .$apcount.br; } } this should get me the count of all entries and output it. It looks like it does it now, as I do get an output. It just takes like 25+ seconds to show me the output :o( Any idea how I can get it faster? Cheers for your help! Chris P.S.: Is there a way to order the output by the apcount value? So I can get highest numbers first? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] _SERVER['DOCUMENT_ROOT'] not set?
Hello group, I am new to php. I have just bought a good book by Welling and Thomson and was following the example codes. In one of the examples, I am supposed to access _SERVER['DOCUMENT_ROOT']. However, when I am seeing its value in the debug stack, I am getting it to be null! Even phpinfo() is showing that this particular variable does not even exist, though there are other _SERVER[''] declarations. I installed everything on my local computer using xampp and I am using Zend IDE. And I have searched through archives as well as google and not found any useful advice. Thanks! Saurabh.
Re: [PHP] ASCII Captcha
CAPTCHA's don't work. Don't depend upon them for any of your projects. Sure they do. My blog comments were getting spammed to death. Now I've put a captcha on I rarely have to deal with spam. I'd say that's working. CAPTCHA's present accessibility problems for people with disabilities. These can be alleviated by, for example, adding a sound option like Recapture has. Not perhaps a 100% solution, but it does help tremendously. CAPTCHA's show the world that you really haven't thought this out. Actually my captchas show the world some funky coloured text... :-) -- Richard Heyes HTML5 Graphing: http://www.phpguru.org/RGraph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
Hello there, Actually my captchas show the world some funky coloured text... :-) I just wondering. What if we show captcha using ASCII ART format. like pre ||| ||| `||| |||`|||`````|||||` ` || ||||| ||` |. |`... | ||` .|| | | .|||||``|.|.```|.|| |. `||||| | |||.. ..`| ||| |||`` |. ```||`||.|` `||.. | ```. . .|`. ```.| |||. S ..... I ... R . I .|||.. K . ||| BUCES BBS|| ||| /pre (I'm not sure it was showed correct) Even coloured one. What is your opinions ? Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] grab the complete commandline used ...
2008/8/28 Jochem Maas [EMAIL PROTECTED]: I have a feeling I'm out of luck - probably security issues that keep you from doing such a thing as well. I did have the idea of grabbing the PID and then grepping the output of ps via exec() ... that would do it, but I reckon it smells. :-) That won't work. Quote the entire command as a string. Pass it to a shell script that sets an environment variable to that string, then executes the string. -- http://www.otton.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
pre ||| ||| `||| |||`|||`````|||||` ` || ||||| ||` |. |`... | ||` .|| | | .|||||``|.|.```|.|| |. `||||| | |||.. ..`| ||| |||`` |. ```||`||.|` `||.. | ```. . .|`. ```.| |||. S ..... I ... R . I .|||.. K . ||| BUCES BBS|| ||| /pre (I'm not sure it was showed correct) It didn't, but pasting it into notepad made everything OK... Even after that though, it wasn't particularly readable. -- Richard Heyes HTML5 Graphing: http://www.phpguru.org/RGraph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] _SERVER['DOCUMENT_ROOT'] not set?
2008/8/29 Saurabh Agrawal [EMAIL PROTECTED]: In one of the examples, I am supposed to access _SERVER['DOCUMENT_ROOT']. However, when I am seeing its value in the debug stack, I am getting it to be null! Even phpinfo() is showing that this particular variable does not even exist, though there are other _SERVER[''] declarations. What's DocumentRoot set to in your Apache config? (httpd.conf) Check any VirtualHost blocks you might have, too. What's the result of print_r($_SERVER); ? -- http://www.otton.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Is this a bug?
Catalin Zamfir Alexandru, DATAGRAM SRL schrieb: Hello guys, I've been stalking on the list for some time. Didn't have anything to report/talk, until now. I have a code like this, maybe you guys can reproduce it, with output buffering started: Echo 'something'; Echo 'another thing'; Echo 'something br /'\; What happens is that ANYTHING that was echo'ed until that \, will not reach the buffer. Although, this should actually be a Parse Error, it isn't, it just echoes what was echoed after the god damned \. It took me two hours to find this typo in the code . Can you guys reproduce the error? I can actually give you a link to the server where this code runs. Hi, yes this is a Bug in your code ;-) -- Unexpected character in input: '\' (ASCII=92) state=1 in ... This is the Error Output you will see. Regards Carlos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
Thats exactly what i am talking about Richard. Ólafur Waage [EMAIL PROTECTED] 2008/8/29 Richard Heyes [EMAIL PROTECTED]: pre ||| ||| `||| |||`|||`````|||||` ` || ||||| ||` |. |`... | ||` .|| | | .|||||``|.|.```|.|| |. `||||| | |||.. ..`| ||| |||`` |. ```||`||.|` `||.. | ```. . .|`. ```.| |||. S ..... I ... R . I .|||.. K . ||| BUCES BBS|| ||| /pre (I'm not sure it was showed correct) It didn't, but pasting it into notepad made everything OK... Even after that though, it wasn't particularly readable. -- Richard Heyes HTML5 Graphing: http://www.phpguru.org/RGraph -- 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] ASCII Captcha
I just realized that i should have said ASCII Art but not just ASCII, it was so clear in my head but i notice now how it could have been misunderstood. Ólafur Waage [EMAIL PROTECTED] 2008/8/29 Ólafur Waage [EMAIL PROTECTED]: Thats exactly what i am talking about Richard. Ólafur Waage [EMAIL PROTECTED] 2008/8/29 Richard Heyes [EMAIL PROTECTED]: pre ||| ||| `||| |||`|||`````|||||` ` || ||||| ||` |. |`... | ||` .|| | | .|||||``|.|.```|.|| |. `||||| | |||.. ..`| ||| |||`` |. ```||`||.|` `||.. | ```. . .|`. ```.| |||. S ..... I ... R . I .|||.. K . ||| BUCES BBS|| ||| /pre (I'm not sure it was showed correct) It didn't, but pasting it into notepad made everything OK... Even after that though, it wasn't particularly readable. -- Richard Heyes HTML5 Graphing: http://www.phpguru.org/RGraph -- 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] _SERVER['DOCUMENT_ROOT'] not set?
In one of the examples, I am supposed to access _SERVER['DOCUMENT_ROOT']. However, when I am seeing its value in the debug stack, I am getting it to be null! Even phpinfo() is showing that this particular variable does not even exist, though there are other _SERVER[''] declarations. What's DocumentRoot set to in your Apache config? (httpd.conf) Check any VirtualHost blocks you might have, too. What's the result of print_r($_SERVER); ? In httpd.conf, DocumentRoot D:/xampp/htdocs No VirtualHost blocks. David, I just found a thing. I had been running this script within the Zend IDE, looking at output in the IDE itself. Now that I see the output in Firefox, I can see the variable in phpinfo(), as well as in the output of print_r($_SERVER). It must be something to do with Zend, then. Is that it? Even the output of print_r contains the line [DOCUMENT_ROOT]=D:/xampp/htdocs in Firefox, but no such line in Zend! Thanks for the help! Saurabh.
Re: [PHP] _SERVER['DOCUMENT_ROOT'] not set?
Does Zend use a separate instance of Apache or some other webserver ? Stijn Saurabh Agrawal wrote: In one of the examples, I am supposed to access _SERVER['DOCUMENT_ROOT']. However, when I am seeing its value in the debug stack, I am getting it to be null! Even phpinfo() is showing that this particular variable does not even exist, though there are other _SERVER[''] declarations. What's DocumentRoot set to in your Apache config? (httpd.conf) Check any VirtualHost blocks you might have, too. What's the result of print_r($_SERVER); ? In httpd.conf, DocumentRoot D:/xampp/htdocs No VirtualHost blocks. David, I just found a thing. I had been running this script within the Zend IDE, looking at output in the IDE itself. Now that I see the output in Firefox, I can see the variable in phpinfo(), as well as in the output of print_r($_SERVER). It must be something to do with Zend, then. Is that it? Even the output of print_r contains the line [DOCUMENT_ROOT]=D:/xampp/htdocs in Firefox, but no such line in Zend! Thanks for the help! Saurabh. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] _SERVER['DOCUMENT_ROOT'] not set?
On Fri, Aug 29, 2008 at 5:06 PM, metastable [EMAIL PROTECTED] wrote: Does Zend use a separate instance of Apache or some other webserver ? Stijn Actually I don't know the answer to this. How can I find that out? AFAIK, while custom installation, it didn't ask for any such option. Thanks! Saurabh.
Re: [PHP] _SERVER['DOCUMENT_ROOT'] not set?
On 29 Aug 2008, at 12:47, Saurabh Agrawal wrote: On Fri, Aug 29, 2008 at 5:06 PM, metastable [EMAIL PROTECTED] wrote: Does Zend use a separate instance of Apache or some other webserver ? Stijn Actually I don't know the answer to this. How can I find that out? AFAIK, while custom installation, it didn't ask for any such option. Zend Studio does not install Apache at all. By default, when you run a file from within the IDE it does so as a CLI script. This means there will be no DOCUMENT_ROOT defined which is what you're seeing. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Braindead
On Fri, Aug 29, 2008 at 4:38 AM, Chris Haensel [EMAIL PROTECTED] wrote: -:- -Original Message- -:- From: Thijs Lensselink [mailto:[EMAIL PROTECTED] -:- Sent: Friday, August 29, 2008 10:31 AM -:- Cc: php-general@lists.php.net -:- Subject: Re: [PHP] Braindead -:- -:- Chris Haensel wrote: -:- Hi guys, -:- -:- maybe I am too stupid, but I can not see a solution for -:- this. Have been -:- cracking up my brain for the last hours, so I finally -:- dare to ask. -:- -:- I have a database table with some columns -:- -:- -:- text1 | text2 | text3 | text4 -:- -- -:- -:- -:- Now, for some stats thingy, I am trying to get the COUNT -:- of distinct entries -:- So, i would like to get the count of entries where text2 -:- is foo OR text3 is -:- foo -:- -:- I have 20.863 entries at the moment, and it takes quite -:- a lot of time -:- reading through that stuff. -:- I have tried -:- -:- SELECT COUNT(*) as mycount FROM mytable WHERE text2 = -:- 'foo' and text3 = -:- 'foo' -:- -:- but I neither get an error nor any output. It just loads -:- and loads without -:- any output... -:- -:- I am out of ideas :o( Help, anybody? :o)) -:- -:- Chris -:- -:- -:- -:- -:- The amount of records is not that big to slow things down. -:- Did you use -:- indexes on your database? And did you try running the query through -:- commandline or phpMyAdmin? -:- -:- -:- -- -:- PHP General Mailing List (http://www.php.net/) -:- To unsubscribe, visit: http://www.php.net/unsub.php -:- -:- Hi Thijs, thanks for the reply. I got mixed up with my tables :o) It's got 178.456 entries :o)) Anyhow, I tried it in a PHP script. $gq = SELECT planned_dep_ap, COUNT(*) as apcount FROM flightdb GROUP BY planned_dep_ap; $gd = mysql_query($gq) or die(mysql_error()); while($ga = mysql_fetch_assoc($gd)) { $icao = $ga['planned_dep_ap']; $apcount= $ga['apcount']; if($apcount = 100) { echo $icao. - .$apcount.br; } } this should get me the count of all entries and output it. It looks like it does it now, as I do get an output. It just takes like 25+ seconds to show me the output :o( Any idea how I can get it faster? This isn't really the same thing you asked in your original post. The original included a WHERE clause and this version does not. (Granted, your original post seemed slightly confused as well, since you first said you wanted results where text2 is foo OR text3 is foo, but then your example said WHERE text2 = 'foo' and text3 = 'foo' , so I'm not sure if you wanted a union (OR) or an intersection (AND) of the two matching sets.) I see in your script that you are only echoing rows where the value of $apcount is = 100. Why not limit your query to that? Then you aren't waiting for a bunch of records to get passed from MySQL to PHP that you aren't even interested in seeing, and PHP doesn't have to waste the cycles to filter them out? Cheers for your help! Chris P.S.: Is there a way to order the output by the apcount value? So I can get highest numbers first? Absolutely. SELECT planned_dep_ap, COUNT(*) as apcount FROM flightdb GROUP BY planned_dep_ap HAVING apcount = 100 ORDER BY apcount DESC That should do it. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [SOLVED]RE: [PHP] restricted file access
-Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: 28 August 2008 21:19 To: php-general@lists.php.net Subject: RE: [PHP] restricted file access At 10:50 AM +0200 8/28/08, Angelo Zanetti wrote: Thanks for your reply. But what happens if the file is situated here: www.site.com/include/documents/file.doc and someone knows that path file somehow or they get a program to crawl the site. Then they would be able to get that file. How do we prevent that? You don't! But file.doc doesn't have to be anything either. Try this: http://sperling.com/file.doc -- you won't find anything there. However, if I wanted something to be there for someone, I could put it there. Understand? // Hi guys I put the documents outside the webroot. And just redirect to it using the Headers and then the readfile() function. Thanks Angelo http://www.elemental.co.za 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
At 9:07 AM +0100 8/29/08, Stut wrote: On 29 Aug 2008, at 03:45, tedd wrote: These are what I've come up with: http://webbytedd.com/aa/assorted-captcha/ Just curious tedd, but what do you mean by CAPTCHA's show the world that you really haven't thought this out. If you have a better alternative I'd love to hear about it. -Stut -Stut : I claim that for most web sites, they don't need a CAPTCHA -- so why use one? CAPTCHA's carry a lot of accessibility baggage. There are many of high profile sites that don't use CAPTCHA (i.e., Eric Meyers, Chris Shiflett). Instead they have developed other methods, such as attending to their sites and monitoring post. I concede that if an evil-doer wants to make things hard on you by automated posting, then it's an uphill battle that can be effectively fought by using a CAPTCHA. But I claim there has to be a better way. While I've been working on the problem (on/off) for several years, I haven't found an acceptable solution. Of course, better minds than mine have tried and failed, but I always think that I might do better -- a flaw in my personality, I just don't know any better. In any event, I've approached on the problem from two sides: 1. To create a CAPTCHA that would be difficult for automated systems to break but easy for the user to navigate -- my Arrow CAPTCHA is the best I could create. However, I'm sure with a little effort from someone like you or Rob, it can be broken. In addition, my arrow CAPTCHA is for the sighted and that leaves out a lot of people. My Audio CAPTCHA works well for the blind, but that too can be broken. 2. To create a server-side method that monitors who's making the post, frequency of the posts, and content of the post before allowing the post. While I'm not finished, this is something that I continue to work on. I think that direction shows the most opportunity for success. So, when I say CAPTCHA's show the world that you really haven't thought this out, that's what I mean. I still haven't thought this out either. But I think there'a better solution and I'll keep working trying to find one. 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] ASCII Captcha
At 10:00 AM +0100 8/29/08, Richard Heyes wrote: CAPTCHA's don't work. Don't depend upon them for any of your projects. Sure they do. My blog comments were getting spammed to death. Now I've put a captcha on I rarely have to deal with spam. I'd say that's working. Yes, it's working for you -- but what about the people who can't navigate your CAPTCHA? They can't even tell you they are having problems. In addition, all CAPTCHA's can be broken. If someone really wants to spam your site, they will. You're not flying below the radar, you're just not a big enough target to waste a missile on. CAPTCHA's present accessibility problems for people with disabilities. These can be alleviated by, for example, adding a sound option like Recapture has. Not perhaps a 100% solution, but it does help tremendously. If you will notice, I do include an audio CAPTCHA in my assorted CAPTCHA's: http://webbytedd.com/aa/assorted-captcha/ But, that doesn't solve the problem of accessibility, it just reduces the problem, and actually increases the possibility of your site getting spammed by providing two doors for entry. CAPTCHA's show the world that you really haven't thought this out. Actually my captchas show the world some funky coloured text... :-) Now you throw possible contrast problems into the mix. Will your colors pass this test: http://webbytedd.com/c/access-color/ No matter how many times you cut this rope, it's still too short. 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] ASCII Captcha
On 29 Aug 2008, at 15:15, tedd wrote: At 9:07 AM +0100 8/29/08, Stut wrote: On 29 Aug 2008, at 03:45, tedd wrote: These are what I've come up with: http://webbytedd.com/aa/assorted-captcha/ Just curious tedd, but what do you mean by CAPTCHA's show the world that you really haven't thought this out. If you have a better alternative I'd love to hear about it. -Stut -Stut : I claim that for most web sites, they don't need a CAPTCHA -- so why use one? CAPTCHA's carry a lot of accessibility baggage. There are many of high profile sites that don't use CAPTCHA (i.e., Eric Meyers, Chris Shiflett). Instead they have developed other methods, such as attending to their sites and monitoring post. I concede that if an evil-doer wants to make things hard on you by automated posting, then it's an uphill battle that can be effectively fought by using a CAPTCHA. But I claim there has to be a better way. While I've been working on the problem (on/off) for several years, I haven't found an acceptable solution. Of course, better minds than mine have tried and failed, but I always think that I might do better -- a flaw in my personality, I just don't know any better. In any event, I've approached on the problem from two sides: 1. To create a CAPTCHA that would be difficult for automated systems to break but easy for the user to navigate -- my Arrow CAPTCHA is the best I could create. However, I'm sure with a little effort from someone like you or Rob, it can be broken. In addition, my arrow CAPTCHA is for the sighted and that leaves out a lot of people. My Audio CAPTCHA works well for the blind, but that too can be broken. 2. To create a server-side method that monitors who's making the post, frequency of the posts, and content of the post before allowing the post. While I'm not finished, this is something that I continue to work on. I think that direction shows the most opportunity for success. So, when I say CAPTCHA's show the world that you really haven't thought this out, that's what I mean. I still haven't thought this out either. But I think there'a better solution and I'll keep working trying to find one. I agree with some of what you're saying here, but only to a certain extent. CAPTCHA's are a tool that can be applied to any number of different situations, so a blanket statement like that cannot possibly apply. For some situations they are absolutely required (example coming up), for others they're certainly not the best answer. The main project I work on at the moment is a classified ad site and it has CAPTCHA's in three places. The first is when you place an ad. If this wasn't there we'd have a much more difficult job dealing with scam and spam ads, something we can't currently afford to throw more effort at. This is an example of making it a little bit harder for automated posting to happen, but we know it's not 100% effective and we have other mechanisms in place to catch stuff that gets past it, but it's a good first step and knocks out the really stupid attempts. The other two places are when a user contacts us for support, and when someone sends a message to another user about one of their ads. Without the CAPTCHA both of these suffer from a huge amount of aimless automated postings. This is the main thing a CAPTCHA does for any site. Out there in the wide wide world there are numerous scripts that simply crawl the web looking for forms to post to on the off-chance it's going to turn out to be unprotected. Depending on the form handler this can result in anything from them posting content on a website with a view to getting SEO juice to being able to use the form as a mail proxy. These scripts don't care if each post works, they just try because it's nearly free to do so. In the above scenarios not having the CAPTCHA there to stop them would result in spam in our support system and even worse than that, spam in users mailboxes. So I agree that CAPTCHA's do not and cannot solve the problem of unwanted form submissions, but they're a damn good start. Whatever we do, the simple fact that we want users to be able to do something means that anyone can do it whether they have good intentions or bad, but we can put up as many obstacles to automation as normal users can live with. CAPTCHA's are only a defence against automation, not bad people and that's a very important thing to understand. As for attending to sites and monitoring posts, that's all very well until you end up dealing with 10k posts a day. Our CAPTCHA's stop over 70% of form submissions on my site and I thank $DEITY they're there because otherwise I'd never sleep (not that I do that much anyway). The reason I asked the question is that your comments on that page imply that only lazy developers use them when this is far from the truth. They are a valuable tool and until something better comes along
Re: [PHP] ASCII Captcha
On Aug 29, 2008, at 10:30 AM, tedd wrote: No matter how many times you cut this rope, it's still too short. So, I'm curious, what do you suggest? As near as I can tell, even with all of the problems (many of which can be mitigated with enough effort) associated with the use of Captcha's, a good implementation is currently the best solution to the problem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Checking for http://
How do I check if http:// is at the beginning of $web_site and if it isn't add it? Ron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Debugging PHP scripts
I am fairly new to PHP. What is the best way of debugging PHP scripts ? I have put in echo statements to tell me what is happening, but perhaps there are better methods. I have a PHP script on a server, which I access from a client side program ( written in C++ ) and the script is not returning the correct data. I am looking for some easy way to determine what is wrong. Thanks ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
At 3:41 PM +0100 8/29/08, Stut wrote: -Stut: I agree with some of what you're saying here, but only to a certain extent. CAPTCHA's are a tool that can be applied to any number of different situations, so a blanket statement like that cannot possibly apply. Of course blanket statements can't apply to everything, but they can generate debate and thus the reason why I wrote it that way -- to generate discussion. --- The main project I work on at the moment is a classified ad site and it has CAPTCHA's in three places. -snip- I understand there are different reasons behind the use of CAPTCHA's, but in the end they still present accessibility problems. And their use is a trade-off that you accept. In essence you are saying I understand the problems and this is my best solution. You are cutting out a segment of the population due to the fact that you cannot create a better solution. Don't get me wrong -- I fully understand the problems involved and there may not be a better solution. But to employ CAPTCHA's, means that there isn't. --- So I agree that CAPTCHA's do not and cannot solve the problem of unwanted form submissions, but they're a damn good start. I agree with most of that, but I think the they're a damn good start is really this works and that's that. It's like the saying Why are the things I'm looking for always in the last place I find them? They are because once you find them, you stop looking. Likewise, the CAPTCHA is a good place to stop. --- Whatever we do, the simple fact that we want users to be able to do something means that anyone can do it whether they have good intentions or bad, but we can put up as many obstacles to automation as normal users can live with. CAPTCHA's are only a defence against automation, not bad people and that's a very important thing to understand. That's a very good point. I often think that people who employ these tactics (spam automation) actually know what they are doing when in fact they may not. They may be ignorant of the harm they cause. --- The reason I asked the question is that your comments on that page imply that only lazy developers use them when this is far from the truth. They are a valuable tool and until something better comes along I'm gonna use them as part of my sites defences, unless you're volunteering to moderate 7k messages for me for free? Didn't think so ;) I didn't mean to imply laziness, but now that you mentioned it -- on one hand we say that CAPTCHA is good enough until something else comes along, but on the other hand, because we are using CAPTCHA, there's no need to develop something else. I realize that this problem is difficult and may be one of those thing that can't be solved with current technology -- I may be Don Quixote looking at windmills differently than others. Thanks for your comments, 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] Checking for http://
On Fri, Aug 29, 2008 at 11:25 AM, Ron Piggott [EMAIL PROTECTED]wrote: How do I check if http:// is at the beginning of $web_site and if it isn't add it? Ron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php You could use substr() (www.php.net/substr) if ( substr( $web_site, 0, 7 ) != http://; ) { $web_site = http://; . $web_site; } -- -Dan Joseph www.canishosting.com - Plans start @ $1.99/month. Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will be warm for the rest of his life.
Re: [PHP] ASCII Captcha
At 10:45 AM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 10:30 AM, tedd wrote: No matter how many times you cut this rope, it's still too short. So, I'm curious, what do you suggest? As near as I can tell, even with all of the problems (many of which can be mitigated with enough effort) associated with the use of Captcha's, a good implementation is currently the best solution to the problem. Read my other replies. 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] Debugging PHP scripts
On Fri, Aug 29, 2008 at 11:33 AM, Edward Diener [EMAIL PROTECTED]wrote: I am fairly new to PHP. What is the best way of debugging PHP scripts ? I have put in echo statements to tell me what is happening, but perhaps there are better methods. I have a PHP script on a server, which I access from a client side program ( written in C++ ) and the script is not returning the correct data. I am looking for some easy way to determine what is wrong. Thanks ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Echo's throughout the code isn't a bad way. You can also utilize print_r() and exit() and other things. Really the idea is to set break points, and return data to you that is useful for killing the bug. Its not something that you can simply so Do it like this, as there is really rules to how you should debug really. Just basic deductive reasoning, and some helpful information along the way. Do you use an IDE at all? You may want to check some out with debuggers built in. That would help you out. -- -Dan Joseph www.canishosting.com - Plans start @ $1.99/month. Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will be warm for the rest of his life.
Re: [PHP] Checking for http://
On Fri, Aug 29, 2008 at 11:33 AM, Dan Joseph [EMAIL PROTECTED] wrote: You could use substr() (www.php.net/substr) if ( substr( $web_site, 0, 7 ) != http://; ) { $web_site = http://; . $web_site; } -- -Dan Joseph Or parse_url() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
On Fri, 2008-08-29 at 10:38 +, Ólafur Waage wrote: I just realized that i should have said ASCII Art but not just ASCII, it was so clear in my head but i notice now how it could have been misunderstood. You do realize that the ascii rendering below is just a bitmap. Most captcha crackers can handle bitmaps. The cracker would just need a little tweaking to first convert to a real bitmap. Cheers, Rob. Ólafur Waage [EMAIL PROTECTED] 2008/8/29 Ólafur Waage [EMAIL PROTECTED]: Thats exactly what i am talking about Richard. Ólafur Waage [EMAIL PROTECTED] 2008/8/29 Richard Heyes [EMAIL PROTECTED]: pre ||| ||| `||| |||`|||`````|||||` ` || ||||| ||` |. |`... | ||` .|| | | .|||||``|.|. ```|.|| |. `||||| | |||.. .. `| ||| |||`` |. ```||`||.|` `||.. | ```. . .|`. ``` .| |||. S ..... I ... R . I .|||.. K . ||| BUCES BBS || ||| /pre (I'm not sure it was showed correct) It didn't, but pasting it into notepad made everything OK... Even after that though, it wasn't particularly readable. -- Richard Heyes HTML5 Graphing: http://www.phpguru.org/RGraph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Debugging PHP scripts
Dan Joseph wrote: On Fri, Aug 29, 2008 at 11:33 AM, Edward Diener [EMAIL PROTECTED]wrote: I am fairly new to PHP. What is the best way of debugging PHP scripts ? I have put in echo statements to tell me what is happening, but perhaps there are better methods. I have a PHP script on a server, which I access from a client side program ( written in C++ ) and the script is not returning the correct data. I am looking for some easy way to determine what is wrong. Thanks ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Echo's throughout the code isn't a bad way. You can also utilize print_r() and exit() and other things. Really the idea is to set break points, and return data to you that is useful for killing the bug. Its not something that you can simply so Do it like this, as there is really rules to how you should debug really. Just basic deductive reasoning, and some helpful information along the way. Understood. Do you use an IDE at all? You may want to check some out with debuggers built in. That would help you out. I am running on the client, and the PHP script is on a server on another machine. Is there a PHP IDE running from the client which can help me in that sort of situation ? It would really be nice if I could debug in an IDE from the client side, but I suspect I would need to be running on the server machine in order to do so. Of course I can try out the script locally on my client machine and then I would probably be fine. I would have to duplicate the server directory setup in order to do so. I have not looked into PHP IDEs at all so far. Any recommendations ? Thanks ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
On 29 Aug 2008, at 16:33, tedd wrote: At 3:41 PM +0100 8/29/08, Stut wrote: The main project I work on at the moment is a classified ad site and it has CAPTCHA's in three places. -snip- I understand there are different reasons behind the use of CAPTCHA's, but in the end they still present accessibility problems. And their use is a trade-off that you accept. In essence you are saying I understand the problems and this is my best solution. You are cutting out a segment of the population due to the fact that you cannot create a better solution. Don't get me wrong -- I fully understand the problems involved and there may not be a better solution. But to employ CAPTCHA's, means that there isn't. That's putting words in other people's mouths. Use of CAPTCHA's isn't the same as stating the Earth is flat and refusing to entertain alternative theories. CAPTCHA's are a first line of defence and as such I'll use them until I ro someone else comes up with something better. I don't see that as defeat, but in the real world I can't say I don't have a 100% effective defence so I'm not going to use the 70% defence I do have. Seem to me to be a very odd position to take. So I agree that CAPTCHA's do not and cannot solve the problem of unwanted form submissions, but they're a damn good start. I agree with most of that, but I think the they're a damn good start is really this works and that's that. It's like the saying Why are the things I'm looking for always in the last place I find them? They are because once you find them, you stop looking. Likewise, the CAPTCHA is a good place to stop. Who ever said we've stopped? Again, it's one tool in a toolbox, but certainly not one that should be ignored. Whatever we do, the simple fact that we want users to be able to do something means that anyone can do it whether they have good intentions or bad, but we can put up as many obstacles to automation as normal users can live with. CAPTCHA's are only a defence against automation, not bad people and that's a very important thing to understand. That's a very good point. I often think that people who employ these tactics (spam automation) actually know what they are doing when in fact they may not. They may be ignorant of the harm they cause. I highly doubt that. There may be a few who use off-the-shelf scripts without really knowing what they're doing, but I would bet the majority fully understand what they're doing and most of them don't care. I *know* some of them thing they're adding value. The reason I asked the question is that your comments on that page imply that only lazy developers use them when this is far from the truth. They are a valuable tool and until something better comes along I'm gonna use them as part of my sites defences, unless you're volunteering to moderate 7k messages for me for free? Didn't think so ;) I didn't mean to imply laziness, but now that you mentioned it -- on one hand we say that CAPTCHA is good enough until something else comes along, but on the other hand, because we are using CAPTCHA, there's no need to develop something else. I think this is very naive and coming from you tedd it surprises me. Very few developers have time to put everything on hold because the tools they have are not 100% effective - I certainly don't. I really wish I did, but this is the real world where the almighty pound is king. I'd love to see the faces at the next board meeting when I say no progress this month because we've been trying to come up with something better than CAPTCHA's. The community as a whole is trying to come up with something better but these things take time, money and a good dose of unpredictable inspiration. Something better will arrive, until then I'm using the tools I have to do the best job I can. I realize that this problem is difficult and may be one of those thing that can't be solved with current technology -- I may be Don Quixote looking at windmills differently than others. Most of the problems CAPTCHA's are intended to protect against are social rather than technological. This is also important to understand. As I mentioned earlier, if you want your normal users to be able to do something, the evil ones will also be able to do it. The best defence against dodgy inputs I've seen so far has been having a good community on the site who pro-actively look for and take action against it. Best example I can think of this late in the day is Wikipedia. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Debugging PHP scripts
On Fri, Aug 29, 2008 at 11:51 AM, Edward Diener [EMAIL PROTECTED]wrote: Dan Joseph wrote: On Fri, Aug 29, 2008 at 11:33 AM, Edward Diener [EMAIL PROTECTED] wrote: I have not looked into PHP IDEs at all so far. Any recommendations ? Thanks ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I'm a little bias towards PhpED (www.nusphere.com),b ut that's because I use it. There is also PHP Eclipse, and Zend among others. Do a google search for php dbg. Its the same debugger that PhpED uses, that might get you started before you start into IDEs. -- -Dan Joseph www.canishosting.com - Plans start @ $1.99/month. Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will be warm for the rest of his life.
Re: [PHP] ASCII Captcha
On Aug 29, 2008, at 11:33 AM, tedd wrote: I understand there are different reasons behind the use of CAPTCHA's, but in the end they still present accessibility problems. And their use is a trade-off that you accept. Nonsense. There is no reason why the usage of Captcha's would need to present accessibility problems. I didn't mean to imply laziness, but now that you mentioned it -- on one hand we say that CAPTCHA is good enough until something else comes along, but on the other hand, because we are using CAPTCHA, there's no need to develop something else. Nonsense. There are people constantly working on better systems to fight spam, etc. Need proof? Just lift your head up and look around a little. At a minimum, a better system that everyone uses could mean billions to the inventor that patent's the system...that is reason enough to keep working to the next best thing. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Debugging PHP scripts
On Aug 29, 2008, at 851AM, Edward Diener wrote: I have not looked into PHP IDEs at all so far. Any recommendations ? Thanks ! Please don't start this up again. Check the PHP IDE Needed thread that has been active for the past several days or search the list archives. http://marc.info/?l=php-general Brady -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: concatenating with . or ,
-Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Thursday, August 28, 2008 3:15 PM To: php-general@lists.php.net Subject: RE: [PHP] Re: concatenating with . or , At 5:44 PM +0100 8/28/08, Ford, Mike wrote: Santa Monica, CA. I moved from Missouri to California when I was 12 just after the Feds paid my father a visit and my father took-off for parts unknown -- apparently they frown on embezzling. I didn't see my father again until I turned 30. I lived in the San Fernando Valley until after graduating from CSUN in 1975. Then I went to Michigan where I met my wife and received my MSc from MSU. Michigan is like big minnow trap -- once you swim in, you're caught. But, I don't miss California -- nice weather, but too much crime and too many people. At least Michigan is green and if you stay away from Detroit, there's not much crime either. I hail from Missouri, myself. Glad to see another native in the list (even if you deserted us for greener pastures). ;) Todd Boyd Web Programmer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
On Fri, 2008-08-29 at 11:33 -0400, tedd wrote: I understand there are different reasons behind the use of CAPTCHA's, but in the end they still present accessibility problems. And their use is a trade-off that you accept. Not using CAPTCHAs and allowing the amount of spam posted to a site to exist presents an accessibility problem for all. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
At 1:15 PM -0400 8/29/08, Robert Cummings wrote: On Fri, 2008-08-29 at 11:33 -0400, tedd wrote: I understand there are different reasons behind the use of CAPTCHA's, but in the end they still present accessibility problems. And their use is a trade-off that you accept. Not using CAPTCHAs and allowing the amount of spam posted to a site to exist presents an accessibility problem for all. Cheers, Rob. That's another side of the coin -- the problem is complex. 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] ASCII Captcha
At 12:17 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 11:33 AM, tedd wrote: I understand there are different reasons behind the use of CAPTCHA's, but in the end they still present accessibility problems. And their use is a trade-off that you accept. Nonsense. There is no reason why the usage of Captcha's would need to present accessibility problems. No offense, but please look into it. 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] Serving pages based on user input
O/H Jochem Maas έγραψε: Robert Cummings schreef: On Sun, 2008-08-24 at 13:35 +0100, Ashley Sheridan wrote: On Sat, 2008-08-23 at 22:17 -0400, Robert Cummings wrote: On Sun, 2008-08-24 at 01:32 +0200, Jochem Maas wrote: Ólafur Waage schreef: You can read about the header function. http://is2.php.net/manual/en/function.header.php hi Ólafur, his situation doesn't require a redirect (he only thinks it does), and redirects suck when used unecessarily. (plenty of info on the web about why this is so ... hunt for a 'rant' by the formidable Richard Lynch in the archives of this list for instance) Oh dear, not this BS again. If the content is different then perform a redirect. Do you really want your login page to be indexed as your homepage? Lynch's arguments on this were weak. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP I thought the arguments were very valid, but can be take to the point of extreme. Keep similar pages grouped into one PHP file. After all, this is what PHP is for. Don't try to replicate your HTML pages as PHP pages, thats a silly idea and takes more time to manage. You're confusing using a front page loader with redirection. The distinction being that I would suggest that you redirect to the URL that your front loader would use to load a given page rather than just presenting said page within another page's context to save a redirect. you wouldn't have to frakkin' redirect if the links used by said front controller were generated correctly to start with ... it's the whole using a select box to choose a page (unless it's to set window.location to the value of the selected option in the select box) ... that sucks. Late reply but I kind of enjoy when Battlestar Gallactica dirty speech is making it's presence to this list (frak). Perhaps I could make a table in mysql with all the known phrases for me to search when I am in a lame mood. I believe that I have run into a list somewhere in the web. there is no need to use redirection in this case, it's just f'ing lazy. (to be clear ... I'm lazy now and again ;-) but at least I know it) redirection should be used sparingly, and fudging SE friendly urls back into your own application IS NOT such as case. no idea wtf you meant with the login page reference - way too obtuse an argument for me to follow. Cheers, Rob. yeah mine an ice cold one thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
At 5:06 PM +0100 8/29/08, Stut wrote: On 29 Aug 2008, at 16:33, tedd wrote: I didn't mean to imply laziness, but now that you mentioned it -- on one hand we say that CAPTCHA is good enough until something else comes along, but on the other hand, because we are using CAPTCHA, there's no need to develop something else. I think this is very naive and coming from you tedd it surprises me. From my perspective, I think it naive to look at this in any other way. For example, how much time have you invested in finding a better way? I'm not pointing a finger at you and saying You need to drop everything and come up with a solution before moving on. But I am saying that you are using a CAPTCHA until someone else comes up with a better way. Is that not true? So, in essence my statement above is not naive but rather factual. Factual is not naive. Very few developers have time to put everything on hold because the tools they have are not 100% effective - I certainly don't. I really wish I did, but this is the real world where the almighty pound is king. I'd love to see the faces at the next board meeting when I say no progress this month because we've been trying to come up with something better than CAPTCHA's. You are missing the point. I'm not telling you to stop anything. I am saying -- however -- that we continue (myself included) to use technology that hurts others. That does not justify our actions -- it only provides an excuse. The best defence against dodgy inputs I've seen so far has been having a good community on the site who pro-actively look for and take action against it. Best example I can think of this late in the day is Wikipedia. As I see it, I could be wrong, but that's just an example of developers who are not taking the easy way out, but rather trying to solve the problem by using something other than CAPTCHA, like the ones I posted earlier. Look, we are not in disagreement -- I understand that you have deadlines and projects that can't be put on hold and all the other excuses you cite -- actually, so do I. But in the end, we are doing this at the cost of accessibility for others. We shouldn't lose sight of 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
Re: [PHP] ASCII Captcha
I understand there are different reasons behind the use of CAPTCHA's, but in the end they still present accessibility problems. And their use is a trade-off that you accept. Nonsense. There is no reason why the usage of Captcha's would need to present accessibility problems. CAPTCHAs are intentionally not the easiest thing to read. If they were, there wouldn't be a great deal of point having them. -- Richard Heyes HTML5 Graphing: http://www.phpguru.org/RGraph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] grab the complete commandline used ...
Robert Cummings schreef: On Fri, 2008-08-29 at 04:48 +0200, Jochem Maas wrote: Micah Gersten schreef: I suggest creating a shell wrapper for PHP that will write the command to a file for you and then call PHP with the appropriate arguments. PHP won't even see most of the command that you originally posted. which wouldn't catch the pipe to grep now would it. nevermind, I don't think you ge what I was looking for, not worry I can hack together a 'solution' using exec() ... by grepping the output of ps. I doubt it. The ps command sees what the script sees. If I do mplayer *.avi, ps shows me the expanded file list that was given to mplayer. output after shell expansion is fine, I'm interested in knowing what arguments we're given to the php interpreter, for example (other than the scriptname and *it's* args which are readily available via $argv) and where ever the output is being piped or redirected to. Remember, shell gets first dibs before anything happens. BTW your subject line does not imply that you wanted the EXACT command line used :) lol Cheers, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] grab the complete commandline used ...
David Otton schreef: 2008/8/28 Jochem Maas [EMAIL PROTECTED]: I have a feeling I'm out of luck - probably security issues that keep you from doing such a thing as well. I did have the idea of grabbing the PID and then grepping the output of ps via exec() ... that would do it, but I reckon it smells. :-) That won't work. in what sense won't it work? the complete line is in the output of ps somewhere albeit after wildcard/shell expansion. Quote the entire command as a string. Pass it to a shell script that sets an environment variable to that string, then executes the string. if life were that simple. it's user X running the php script from the commandline ... I wanna know exactly what he is doing (which is not necessarily the same as what he should be doing). I only really control the php script in question not the context it is run in. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
On Aug 29, 2008, at 2:42 PM, Richard Heyes wrote: I understand there are different reasons behind the use of CAPTCHA's, but in the end they still present accessibility problems. And their use is a trade-off that you accept. Nonsense. There is no reason why the usage of Captcha's would need to present accessibility problems. CAPTCHAs are intentionally not the easiest thing to read. If they were, there wouldn't be a great deal of point having them. There are many forms of captcha's. The concept can easily be extended beyond the need to read something. You may want to read: http://en.wikipedia.org/wiki/Captcha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] grab the complete commandline used ...
On 29 Aug 2008, at 19:46, Jochem Maas wrote: David Otton schreef: 2008/8/28 Jochem Maas [EMAIL PROTECTED]: I have a feeling I'm out of luck - probably security issues that keep you from doing such a thing as well. I did have the idea of grabbing the PID and then grepping the output of ps via exec() ... that would do it, but I reckon it smells. :-) That won't work. in what sense won't it work? the complete line is in the output of ps somewhere albeit after wildcard/shell expansion. Quote the entire command as a string. Pass it to a shell script that sets an environment variable to that string, then executes the string. if life were that simple. it's user X running the php script from the commandline ... I wanna know exactly what he is doing (which is not necessarily the same as what he should be doing). I only really control the php script in question not the context it is run in. I think the only way to do what you want is to parse the output from ps with appropriate arguments. You'll probably need to find the parent process of your PHP script. Don't think you're going to find a portable way to do it. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Testing for Current pointer position in array during iteration
Hi All, Go figure... I sat down today to get some more work on my current project; I got to a certain point where I need to step through an array with a foreach loop. I found that I need to test for the current pointer position of the array, but I haven't a clue as to how this might be accomplished. I've been all over google and php.net, but I'm not finding anything that will help me do this. Basically all I want to do is something like this: if( current_arrayPointer_postition == n ){ ... do this }else{ ...do this } Anyone know of a built-in PHP function that can assist with this, or can you point me to a resource that could help me code a solution? thanks, -- Mark It was good to be the fire... Better by far than to crawl and mew and suck and $h1t and die! 'Arthur C. Clarke' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
On Aug 29, 2008, at 1:56 PM, tedd wrote: At 12:17 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 11:33 AM, tedd wrote: I understand there are different reasons behind the use of CAPTCHA's, but in the end they still present accessibility problems. And their use is a trade-off that you accept. Nonsense. There is no reason why the usage of Captcha's would need to present accessibility problems. No offense, but please look into it. You are welcome to explain, rather then just assert, what is inherent about the concept of a Captcha that would force accessibility problems upon a website. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Testing for Current pointer position in array during iteration
Mark Weaver schreef: Hi All, Go figure... I sat down today to get some more work on my current project; I got to a certain point where I need to step through an array with a foreach loop. I found that I need to test for the current pointer position of the array, but I haven't a clue as to how this might be accomplished. I've been all over google and php.net, but I'm not finding anything that will help me do this. Basically all I want to do is something like this: if( current_arrayPointer_postition == n ){ ... do this }else{ ...do this } foreach isn't really like that. it uses (IIRC) an internal pointer of it's own leaving the userland pointer where ever it is. but: $n = 5; // make a new array with numeric keys starting at 0 $array = array_values(array); // loop it foreach ($array as $key = $val) { if ($key == $n) { echo I got five on it; } else { echo usual suspect; } } Anyone know of a built-in PHP function that can assist with this, or can you point me to a resource that could help me code a solution? thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
At 2:48 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 2:42 PM, Richard Heyes wrote: I understand there are different reasons behind the use of CAPTCHA's, but in the end they still present accessibility problems. And their use is a trade-off that you accept. Nonsense. There is no reason why the usage of Captcha's would need to present accessibility problems. CAPTCHAs are intentionally not the easiest thing to read. If they were, there wouldn't be a great deal of point having them. There are many forms of captcha's. The concept can easily be extended beyond the need to read something. You may want to read: http://en.wikipedia.org/wiki/Captcha While you're at it, why don't you read it yourself. The reference clearly says why your statement -- Nonsense. There is no reason why the usage of Captcha's would need to present accessibility problems. -- is nonsense. 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] grab the complete commandline used ...
Stut schreef: On 29 Aug 2008, at 19:46, Jochem Maas wrote: David Otton schreef: 2008/8/28 Jochem Maas [EMAIL PROTECTED]: I have a feeling I'm out of luck - probably security issues that keep you from doing such a thing as well. I did have the idea of grabbing the PID and then grepping the output of ps via exec() ... that would do it, but I reckon it smells. :-) That won't work. in what sense won't it work? the complete line is in the output of ps somewhere albeit after wildcard/shell expansion. Quote the entire command as a string. Pass it to a shell script that sets an environment variable to that string, then executes the string. if life were that simple. it's user X running the php script from the commandline ... I wanna know exactly what he is doing (which is not necessarily the same as what he should be doing). I only really control the php script in question not the context it is run in. I think the only way to do what you want is to parse the output from ps with appropriate arguments. You'll probably need to find the parent process of your PHP script. yeah, the 'grab the PID' explaination was too simplistic, actually I should be able to grep on the scriptname - it will only run if no other instances are already running (race conditions aside ;-)) Don't think you're going to find a portable way to do it. portability not needed beyond linux and MacOS. thank goodness :-) at least it's doable ... and the smell will be running on someone else's hardware :-P -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
At 2:51 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 1:56 PM, tedd wrote: At 12:17 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 11:33 AM, tedd wrote: I understand there are different reasons behind the use of CAPTCHA's, but in the end they still present accessibility problems. And their use is a trade-off that you accept. Nonsense. There is no reason why the usage of Captcha's would need to present accessibility problems. No offense, but please look into it. You are welcome to explain, rather then just assert, what is inherent about the concept of a Captcha that would force accessibility problems upon a website. Read your own reference: http://en.wikipedia.org/wiki/Captcha That says: Accessibility See also: Web accessibility Because CAPTCHAs rely on visual perception, users unable to view a CAPTCHA (for example, due to a disability or because it is difficult to read) will be unable to perform the task protected by a CAPTCHA. As such, sites implementing CAPTCHAs may provide an audio version of the CAPTCHA in addition to the visual method. The official CAPTCHA site recommends providing an audio CAPTCHA for accessibility reasons. Why should I have to explain something that is widely known and easy to find? Please do the reading before telling people such things are nonsense. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com
Re: [PHP] Testing for Current pointer position in array during iteration
On Fri, Aug 29, 2008 at 2:40 PM, Mark Weaver [EMAIL PROTECTED] wrote: Hi All, Go figure... I sat down today to get some more work on my current project; I got to a certain point where I need to step through an array with a foreach loop. I found that I need to test for the current pointer position of the array, but I haven't a clue as to how this might be accomplished. I've been all over google and php.net, but I'm not finding anything that will help me do this. Basically all I want to do is something like this: if( current_arrayPointer_postition == n ){ ... do this }else{ ...do this } Anyone know of a built-in PHP function that can assist with this, or can you point me to a resource that could help me code a solution? thanks, -- Mark It was good to be the fire... Better by far than to crawl and mew and suck and $h1t and die! 'Arthur C. Clarke' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This may also help as well as Jochem's suggestion: http://us2.php.net/key -- -Dan Joseph www.canishosting.com - Plans start @ $1.99/month. Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will be warm for the rest of his life.
Re: [PHP] ASCII Captcha
On Aug 29, 2008, at 3:11 PM, tedd wrote: At 2:48 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 2:42 PM, Richard Heyes wrote: I understand there are different reasons behind the use of CAPTCHA's, but in the end they still present accessibility problems. And their use is a trade-off that you accept. Nonsense. There is no reason why the usage of Captcha's would need to present accessibility problems. CAPTCHAs are intentionally not the easiest thing to read. If they were, there wouldn't be a great deal of point having them. There are many forms of captcha's. The concept can easily be extended beyond the need to read something. You may want to read: http://en.wikipedia.org/wiki/Captcha While you're at it, why don't you read it yourself. The reference clearly says why your statement -- Nonsense. There is no reason why the usage of Captcha's would need to present accessibility problems. -- is nonsense. Where? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] grab the complete commandline used ...
2008/8/29 Jochem Maas [EMAIL PROTECTED]: in what sense won't it work? the complete line is in the output of ps somewhere albeit after wildcard/shell expansion. With the pipe? I'd really like to see an example, beacuse I couldn't coax it out of ps, and it might be handy someday. if life were that simple. it's user X running the php script from the commandline ... I wanna know exactly what he is doing (which is not necessarily the same as what he should be doing). I only really control the php script in question not the context it is run in. You should have said... you are the admin of the machine, right? Patch bash to log user input. Google variations on bash, patch and syslog. -- http://www.otton.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Testing for Current pointer position in array during iteration
At 2:40 PM -0400 8/29/08, Mark Weaver wrote: Hi All, Go figure... I sat down today to get some more work on my current project; I got to a certain point where I need to step through an array with a foreach loop. I found that I need to test for the current pointer position of the array, but I haven't a clue as to how this might be accomplished. I've been all over google and php.net, but I'm not finding anything that will help me do this. Basically all I want to do is something like this: if( current_arrayPointer_postition == n ){ ... do this }else{ ...do this } Anyone know of a built-in PHP function that can assist with this, or can you point me to a resource that could help me code a solution? Try looking at current http://www.php.net/current Maybe that will help. 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] ASCII Captcha
On Aug 29, 2008, at 3:15 PM, tedd wrote: At 2:51 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 1:56 PM, tedd wrote: At 12:17 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 11:33 AM, tedd wrote: I understand there are different reasons behind the use of CAPTCHA's, but in the end they still present accessibility problems. And their use is a trade-off that you accept. Nonsense. There is no reason why the usage of Captcha's would need to present accessibility problems. No offense, but please look into it. You are welcome to explain, rather then just assert, what is inherent about the concept of a Captcha that would force accessibility problems upon a website. Read your own reference: http://en.wikipedia.org/wiki/Captcha That says: Accessibility See also: Web accessibility Because CAPTCHAs rely on visual perception, users unable to view a CAPTCHA (for example, due to a disability or because it is difficult to read) will be unable to perform the task protected by a CAPTCHA. As such, sites implementing CAPTCHAs may provide an audio version of the CAPTCHA in addition to the visual method. The official CAPTCHA site recommends providing an audio CAPTCHA for accessibility reasons. Why should I have to explain something that is widely known and easy to find? So, I'm curious, what prevents a website from providing a good implementation of both an audio and visual captcha to prevent accessibility problems which you claim are impossible to avoid with every use of a captcha? Personally, my favorite implementation to date is: http://recaptcha.net/learnmore.html and not only is it well designed, but all that brain power which goes into solving captcha's goes into helping out with a very worthwhile project. Remember, the concept of a captcha is this: A test to prove one is human in order perform some action. There is no reason why a blind or deaf person absolutely cannot be presented with such a test. Now, if you wish to continue to argue to the contrary, you are more then welcome to do so. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Testing for Current pointer position in array during iteration
Dan Joseph schreef: On Fri, Aug 29, 2008 at 2:40 PM, Mark Weaver [EMAIL PROTECTED] wrote: ... This may also help as well as Jochem's suggestion: http://us2.php.net/key not unless you wan't a headache (re-read the bit about foreach's internal pointer): php -r '$r = array(a,b,c); next($r); $K = key($r); foreach ($r as $k = $v) { echo $K , key($r), $k\n; }' outputs: 1 1 0 1 1 1 1 1 2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
At 3:17 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 3:11 PM, tedd wrote: http://en.wikipedia.org/wiki/Captcha While you're at it, why don't you read it yourself. The reference clearly says why your statement -- Nonsense. There is no reason why the usage of Captcha's would need to present accessibility problems. -- is nonsense. Where? Is this a joke? Are we doing one of those Who's on first skits? Read this: http://en.wikipedia.org/wiki/Captcha and look for what it says about accessibility. And while you're at it, try reading this: http://en.wikipedia.org/wiki/Web_accessibility Maybe then you'll start understanding the problems people with certain disabilities have in navigating and using web sites. Instead of calling all this nonsense, try to understand what's being discussed. This ain't rocket science. It's not all that hard to understand. 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: Debugging PHP scripts
Edward Diener wrote: I am fairly new to PHP. What is the best way of debugging PHP scripts ? I have put in echo statements to tell me what is happening, but perhaps there are better methods. I have a PHP script on a server, which I access from a client side program ( written in C++ ) and the script is not returning the correct data. I am looking for some easy way to determine what is wrong. Thanks ! debug_backtrace() is pretty handy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] grab the complete commandline used ...
You can rename the php executable and replace it with a shell script that logs what is run. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Jochem Maas wrote: David Otton schreef: Quote the entire command as a string. Pass it to a shell script that sets an environment variable to that string, then executes the string. if life were that simple. it's user X running the php script from the commandline ... I wanna know exactly what he is doing (which is not necessarily the same as what he should be doing). I only really control the php script in question not the context it is run in. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] grab the complete commandline used ...
On Fri, 2008-08-29 at 20:42 +0200, Jochem Maas wrote: Robert Cummings schreef: On Fri, 2008-08-29 at 04:48 +0200, Jochem Maas wrote: Micah Gersten schreef: I suggest creating a shell wrapper for PHP that will write the command to a file for you and then call PHP with the appropriate arguments. PHP won't even see most of the command that you originally posted. which wouldn't catch the pipe to grep now would it. nevermind, I don't think you ge what I was looking for, not worry I can hack together a 'solution' using exec() ... by grepping the output of ps. I doubt it. The ps command sees what the script sees. If I do mplayer *.avi, ps shows me the expanded file list that was given to mplayer. output after shell expansion is fine, I'm interested in knowing what arguments we're given to the php interpreter, for example (other than the scriptname and *it's* args which are readily available via $argv) and where ever the output is being piped or redirected to. You won't get redirection or piping from the following but it will give you the command line info you wanted: ?php $info = implode( '', file( '/proc/'.posix_getpid().'/cmdline' ) ); $info = explode( \x0, $info ); print_r( $info ); ? Probably doesn't run on windows, and I don't care enough to even think about checking :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Testing for Current pointer position in array during iteration
Jochem Maas wrote: Mark Weaver schreef: Hi All, Go figure... I sat down today to get some more work on my current project; I got to a certain point where I need to step through an array with a foreach loop. I found that I need to test for the current pointer position of the array, but I haven't a clue as to how this might be accomplished. I've been all over google and php.net, but I'm not finding anything that will help me do this. Basically all I want to do is something like this: if( current_arrayPointer_postition == n ){ ... do this }else{ ...do this } foreach isn't really like that. it uses (IIRC) an internal pointer of it's own leaving the userland pointer where ever it is. but: $n = 5; // make a new array with numeric keys starting at 0 $array = array_values(array); // loop it foreach ($array as $key = $val) { if ($key == $n) { echo I got five on it; } else { echo usual suspect; } } very nice... Thank you Jochem. That did the trick. -- Mark It was good to be the fire... Better by far than to crawl and mew and suck and shit and die! 'Arthur C. Clarke' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] grab the complete commandline used ...
On Fri, 2008-08-29 at 15:36 -0400, Robert Cummings wrote: On Fri, 2008-08-29 at 20:42 +0200, Jochem Maas wrote: Robert Cummings schreef: On Fri, 2008-08-29 at 04:48 +0200, Jochem Maas wrote: Micah Gersten schreef: I suggest creating a shell wrapper for PHP that will write the command to a file for you and then call PHP with the appropriate arguments. PHP won't even see most of the command that you originally posted. which wouldn't catch the pipe to grep now would it. nevermind, I don't think you ge what I was looking for, not worry I can hack together a 'solution' using exec() ... by grepping the output of ps. I doubt it. The ps command sees what the script sees. If I do mplayer *.avi, ps shows me the expanded file list that was given to mplayer. output after shell expansion is fine, I'm interested in knowing what arguments we're given to the php interpreter, for example (other than the scriptname and *it's* args which are readily available via $argv) and where ever the output is being piped or redirected to. You won't get redirection or piping from the following but it will give you the command line info you wanted: ?php $info = implode( '', file( '/proc/'.posix_getpid().'/cmdline' ) ); $info = explode( \x0, $info ); print_r( $info ); ? Probably doesn't run on windows, and I don't care enough to even think about checking :) BTW, you can also look into hacking the bash binary. Several years ago I wanted to log the command-line to a database table and I hacked the bash binary to trap history and send to database log. Isn't open source a beautiful thing :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
On 29 Aug 2008, at 19:03, tedd wrote: At 5:06 PM +0100 8/29/08, Stut wrote: On 29 Aug 2008, at 16:33, tedd wrote: I didn't mean to imply laziness, but now that you mentioned it -- on one hand we say that CAPTCHA is good enough until something else comes along, but on the other hand, because we are using CAPTCHA, there's no need to develop something else. I think this is very naive and coming from you tedd it surprises me. From my perspective, I think it naive to look at this in any other way. For example, how much time have you invested in finding a better way? I'm not pointing a finger at you and saying You need to drop everything and come up with a solution before moving on. But I am saying that you are using a CAPTCHA until someone else comes up with a better way. Is that not true? So, in essence my statement above is not naive but rather factual. Factual is not naive. Not at all. I spend a fair amount of time thinking about ways to make my work more secure. I would hope that goes for most developers, especially if they realise that a CAPTCHA is not 100% effective. However, this is the way research works. Most people (i.e. the work-a- day folk) spend most of their time making stuff. The few people who are lucky enough to either work for a company that gives them time to do research or actually does it for a living are the ones more likely to hit upon a new solution. I don't think this makes us lazy, or wrong, for continuing to use the current tool - it makes us practical. If I have a eureka moment at any point rest assured I will put some personal time aside to look into it (as I have in other areas) and if something comes of it I'd publish it on my blog. So, in essence your statement is assumptive, judgemental and sweeping. That's not factual. Very few developers have time to put everything on hold because the tools they have are not 100% effective - I certainly don't. I really wish I did, but this is the real world where the almighty pound is king. I'd love to see the faces at the next board meeting when I say no progress this month because we've been trying to come up with something better than CAPTCHA's. You are missing the point. I'm not telling you to stop anything. I am saying -- however -- that we continue (myself included) to use technology that hurts others. That does not justify our actions -- it only provides an excuse. When you say it hurts others I assume you mean excludes users who, for whatever reason, cannot pass the CAPTCHA test. I completely agree, but as far as I know it's only (and I use that word carefully) people with both visual and audio impairments that you cannot cater for. If you could you'd render all CAPTCHA implementations I'm aware of pointless. I completely agree that this is less than ideal, and I really don't like preventing legitimate potential users from using my sites, but I'd rather have a usable and clean (yes, most automated posts are dirty in some way) site than one that nobody wants to use. This is a choice we have to make otherwise there's no point creating the site at all. Holding my hand up now as a lazy developer, the CAPTCHA I have on my sites is not accessible what with it being simply an image with no audio alternative. We have plans to switch it to using recaptcha or implement our own but in terms of priorities it's pretty low for my 2- man team (myself included). The best defence against dodgy inputs I've seen so far has been having a good community on the site who pro-actively look for and take action against it. Best example I can think of this late in the day is Wikipedia. As I see it, I could be wrong, but that's just an example of developers who are not taking the easy way out, but rather trying to solve the problem by using something other than CAPTCHA, like the ones I posted earlier. Yes and no. Wikipedia has its share of problems with spammers, but they have such a large community of users who are willing and able to put time into keeping the site clean it works. The same site with a different type of user profile may not be able to work this way. As far as it being down to the developer I think you're giving credit where little is due. It's the user response to the completely open nature of the original product that prevented them from having to implement CAPTCHA's to prevent automated posting. Had the community of users not been so proactive I don't doubt they would have ended up using them. Look, we are not in disagreement -- I understand that you have deadlines and projects that can't be put on hold and all the other excuses you cite -- actually, so do I. But in the end, we are doing this at the cost of accessibility for others. We shouldn't lose sight of that. I think we do disagree on a fundamental level. You think we've all given up because we have CAPTCHA's, I believe in the
Re: [PHP] ASCII Captcha
On Aug 29, 2008, at 3:41 PM, Stut wrote: I completely agree, but as far as I know it's only (and I use that word carefully) people with both visual and audio impairments that you cannot cater for. I cannot see any reason why a person with both visual and audio impairments could not be presented with a test to prove they are human. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
On Fri, 2008-08-29 at 15:52 -0400, Eric Gorr wrote: On Aug 29, 2008, at 3:41 PM, Stut wrote: I completely agree, but as far as I know it's only (and I use that word carefully) people with both visual and audio impairments that you cannot cater for. I cannot see any reason why a person with both visual and audio impairments could not be presented with a test to prove they are human. Go on, I'm all eyes and ears... describe such a test. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
At 8:41 PM +0100 8/29/08, Stut wrote: So, in essence your statement is assumptive, judgemental and sweeping. I certainly did not mean it to be taken assumptive or judgmental. --- Holding my hand up now as a lazy developer, the CAPTCHA I have on my sites is not accessible what with it being simply an image with no audio alternative. We have plans to switch it to using recaptcha or implement our own but in terms of priorities it's pretty low for my 2-man team (myself included). If you ever want to add an audio CAPTCHA, I will provide mine. I have done significant blind testing to get it approved by blind testers. But, I say this from one developer to another and not to the general public. When dealing with another developer, it's much less problematic to share code because we speak a common language. You see, I provide free things on my site, such as my drop-down menu, and I have people daily failing to implement those correctly because they cannot follow simple directions. I don't want to complicate my life further without good reason. --- As I see it, I could be wrong, but that's just an example of developers who are not taking the easy way out, but rather trying to solve the problem by using something other than CAPTCHA, like the ones I posted earlier. Yes and no. Wikipedia has its share of problems with spammers, but they have such a large community of users who are willing and able to put time into keeping the site clean it works. The same site with a different type of user profile may not be able to work this way. As far as it being down to the developer I think you're giving credit where little is due. That's the reason why I quoted developer -- the developer in this case IS the user. --- I think we do disagree on a fundamental level. You think we've all given up because we haveCAPTCHA's, I believe in the innovative potential of most developers. We're using CAPTCHA's a lot, and we're doing it because none of us have come up with anything better yet, but that certainly doesn't mean we've given up trying. If your site is free to use I would modify your statement to say... CAPTCHA's show the world that you care about the quality of the content on your site without needing to charge for its use, but remember that we haven't given up trying to find a better way Not quite as catchy as yours, but more accurate. If people need to pay to use your site then the need for CAPTCHA's is reduced but I'd argue that in some cases they're still needed. You bring up good points and I'm not so head-strong that I can't listen and learn. Is this better? http://webbytedd.com/aa/assorted-captcha/ 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] PHP Namespace issues
Please bear with me if this is not the correct forum to post this issue. I am experiencing xml namespace errors while trying to use zillow.api with Apache 2.2.8 (Fedora), PHP 5.2.5. Dreamweaver 8 with MM-XSLTransform.class version 0.6.3 is acting as the intermediary to process the zillow.php and zillow.xsl files located at www.bancroftandassociates/xml/. I have a support request open with Adobe, but so far, they are NO help! I figured someone here might have some insight as to just where the problem lies! Bob Novak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
On Aug 29, 2008, at 4:09 PM, Robert Cummings wrote: On Fri, 2008-08-29 at 15:52 -0400, Eric Gorr wrote: On Aug 29, 2008, at 3:41 PM, Stut wrote: I completely agree, but as far as I know it's only (and I use that word carefully) people with both visual and audio impairments that you cannot cater for. I cannot see any reason why a person with both visual and audio impairments could not be presented with a test to prove they are human. Go on, I'm all eyes and ears... describe such a test. http://en.wikipedia.org/wiki/Captcha#Attempts_at_more_accessible_CAPTCHAs discusses this. And, I look forward to see what those doing research in this area come up with in the future. It does seem obvious that since they are human, that a good test can be designed which does not rely on security through obscurity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
At 3:27 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 3:15 PM, tedd wrote: Why should I have to explain something that is widely known and easy to find? So, I'm curious, what prevents a website from providing a good implementation of both an audio and visual captcha to prevent accessibility problems which you claim are impossible to avoid with every use of a captcha? If you are curious, then please research it. There is plenty of documentation. Personally, my favorite implementation to date is: http://recaptcha.net/learnmore.html Arrggg. I can't even pass it. and not only is it well designed, It's designed well enough to keep me out and I'm neither deaf, blind, nor whatever. Remember, the concept of a captcha is this: A test to prove one is human in order perform some action. My memory is just fine, thank you. At some point, you should do some reading on the subject. 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] ASCII Captcha
On 29 Aug 2008, at 20:52, Eric Gorr wrote: On Aug 29, 2008, at 3:41 PM, Stut wrote: I completely agree, but as far as I know it's only (and I use that word carefully) people with both visual and audio impairments that you cannot cater for. I cannot see any reason why a person with both visual and audio impairments could not be presented with a test to prove they are human. Show me a test that you can read with a braille reader, that doesn't assume more than minimal intelligence on the part of the user and that cannot be easily parsed and answered programatically. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Testing for Current pointer position in array during iteration
tedd wrote: At 2:40 PM -0400 8/29/08, Mark Weaver wrote: Hi All, Go figure... I sat down today to get some more work on my current project; I got to a certain point where I need to step through an array with a foreach loop. I found that I need to test for the current pointer position of the array, but I haven't a clue as to how this might be accomplished. I've been all over google and php.net, but I'm not finding anything that will help me do this. Basically all I want to do is something like this: if( current_arrayPointer_postition == n ){ ... do this }else{ ...do this } Anyone know of a built-in PHP function that can assist with this, or can you point me to a resource that could help me code a solution? Try looking at current http://www.php.net/current Maybe that will help. Cheers, tedd Thanks all for the helpful suggestions. Actually Jochem's suggestion was just what I needed. I was stuck at just how to test where the pointer was and couldn't see a way out. I knew there had to be a simple, elegant solution, but apparently was over-thinking it. Jochem put things back into perspective for me. -- Mark It was good to be the fire... Better by far than to crawl and mew and suck and shit and die! 'Arthur C. Clarke' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
At 4:21 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 4:09 PM, Robert Cummings wrote: I cannot see any reason why a person with both visual and audio impairments could not be presented with a test to prove they are human. Go on, I'm all eyes and ears... describe such a test. http://en.wikipedia.org/wiki/Captcha#Attempts_at_more_accessible_CAPTCHAs discusses this. And, I look forward to see what those doing research in this area come up with in the future. It does seem obvious that since they are human, that a good test can be designed which does not rely on security through obscurity. Maybe a blood test? Nope, that could be faked. Back to thinking (ponder, ponder, ponder...) 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] ASCII Captcha
On 29 Aug 2008, at 21:21, Eric Gorr wrote: On Aug 29, 2008, at 4:09 PM, Robert Cummings wrote: On Fri, 2008-08-29 at 15:52 -0400, Eric Gorr wrote: On Aug 29, 2008, at 3:41 PM, Stut wrote: I completely agree, but as far as I know it's only (and I use that word carefully) people with both visual and audio impairments that you cannot cater for. I cannot see any reason why a person with both visual and audio impairments could not be presented with a test to prove they are human. Go on, I'm all eyes and ears... describe such a test. http://en.wikipedia.org/wiki/Captcha#Attempts_at_more_accessible_CAPTCHAs discusses this. And, I look forward to see what those doing research in this area come up with in the future. It does seem obvious that since they are human, that a good test can be designed which does not rely on security through obscurity. CAPTCHA's are *not* a security mechanism, no matter what Wikipedia says. They do nothing more than protect from automated form submissions. That's it. Anyway, as that article states... Often, email or telephone support is used to manually provide access to users who are unable to solve a CAPTCHA That's ultimate accessibility, assuming it supports all types of telephone, but it's also a major expense needing 24/7 coverage. Not something my company of 5 people could hope to support on a free-to- use site. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
On Aug 29, 2008, at 4:21 PM, tedd wrote: At 3:27 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 3:15 PM, tedd wrote: Why should I have to explain something that is widely known and easy to find? So, I'm curious, what prevents a website from providing a good implementation of both an audio and visual captcha to prevent accessibility problems which you claim are impossible to avoid with every use of a captcha? If you are curious, then please research it. There is plenty of documentation. I am curious as to what your answer would be as I cannot find what does not exist. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
On Fri, 2008-08-29 at 16:21 -0400, Eric Gorr wrote: On Aug 29, 2008, at 4:09 PM, Robert Cummings wrote: On Fri, 2008-08-29 at 15:52 -0400, Eric Gorr wrote: On Aug 29, 2008, at 3:41 PM, Stut wrote: I completely agree, but as far as I know it's only (and I use that word carefully) people with both visual and audio impairments that you cannot cater for. I cannot see any reason why a person with both visual and audio impairments could not be presented with a test to prove they are human. Go on, I'm all eyes and ears... describe such a test. http://en.wikipedia.org/wiki/Captcha#Attempts_at_more_accessible_CAPTCHAs discusses this. And, I look forward to see what those doing research in this area come up with in the future. It does seem obvious that since they are human, that a good test can be designed which does not rely on security through obscurity. I said describe such a test... I didn't say describe current thoughts about such a test that have no practical implementation. Pay special attention to the word practical used above before shooting something back off the top of your head. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] grab the complete commandline used ...
Robert Cummings schreef: On Fri, 2008-08-29 at 15:36 -0400, Robert Cummings wrote: On Fri, 2008-08-29 at 20:42 +0200, Jochem Maas wrote: Robert Cummings schreef: On Fri, 2008-08-29 at 04:48 +0200, Jochem Maas wrote: Micah Gersten schreef: I suggest creating a shell wrapper for PHP that will write the command to a file for you and then call PHP with the appropriate arguments. PHP won't even see most of the command that you originally posted. which wouldn't catch the pipe to grep now would it. nevermind, I don't think you ge what I was looking for, not worry I can hack together a 'solution' using exec() ... by grepping the output of ps. I doubt it. The ps command sees what the script sees. If I do mplayer *.avi, ps shows me the expanded file list that was given to mplayer. output after shell expansion is fine, I'm interested in knowing what arguments we're given to the php interpreter, for example (other than the scriptname and *it's* args which are readily available via $argv) and where ever the output is being piped or redirected to. You won't get redirection or piping from the following but it will give you the command line info you wanted: ?php $info = implode( '', file( '/proc/'.posix_getpid().'/cmdline' ) ); $info = explode( \x0, $info ); print_r( $info ); ? Probably doesn't run on windows, and I don't care enough to even think about checking :) BTW, you can also look into hacking the bash binary. Several years ago I wanted to log the command-line to a database table and I hacked the bash binary to trap history and send to database log. didn't know about that bit of /proc, thanks :-) Isn't open source a beautiful thing :) rather like frankenastein's bride :-P Cheers, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] grab the complete commandline used ...
David Otton schreef: 2008/8/29 Jochem Maas [EMAIL PROTECTED]: in what sense won't it work? the complete line is in the output of ps somewhere albeit after wildcard/shell expansion. With the pipe? I'd really like to see an example, beacuse I couldn't coax it out of ps, and it might be handy someday. ah okay, wasn't sure about the pipe, figured it might not show up in ps. if life were that simple. it's user X running the php script from the commandline ... I wanna know exactly what he is doing (which is not necessarily the same as what he should be doing). I only really control the php script in question not the context it is run in. You should have said... you are the admin of the machine, right? Patch bash to log user input. Google variations on bash, patch and syslog. I'll take a gander, although I doubt I'll get permission to actually patch something like that ... client is pretty adament about having a std box. anyway, Im much the wiser, thanks for the info everyone. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] grab the complete commandline used ...
Micah Gersten schreef: You can rename the php executable and replace it with a shell script that logs what is run. true, but that still wouldn't get me the pipe, besides which one day someone will figure out that it's not the actual executable and either: 1. recompile and install php (shell script overwritten) 2. start using the actual binary instead in both cases they'd probably think they're doing something smart :-) which is why it would be nice to do it from with in my own script without tweaking/hacking anything on the system. it's then self contained and because I deliver the script I control it's functionality of course the script could be edited, but if a 3rd party or the client does *that* then I'm no longer responsible ... currently I'm not responsible for the system/server itself (although I have full access) and I'd like to keep it that way ... sysadmin is a special kind of beast, I'm of another genus :) Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Jochem Maas wrote: David Otton schreef: Quote the entire command as a string. Pass it to a shell script that sets an environment variable to that string, then executes the string. if life were that simple. it's user X running the php script from the commandline ... I wanna know exactly what he is doing (which is not necessarily the same as what he should be doing). I only really control the php script in question not the context it is run in. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
At 9:32 PM +0100 8/29/08, Stut wrote: That's ultimate accessibility, assuming it supports all types of telephone, but it's also a major expense needing 24/7 coverage. Not something my company of 5 people could hope to support on a free-to-use site. -Stut -Stut: I hesitated before writing this because I don't want to get into another debate with you, but accessibility means that all people (disabled or not) can access the data they want in a similar fashion. Accessibility does NOT mean If you have a problem with our web site, please call This is no different than any other accessibility issue. People in wheelchairs should not have to call someone to get them over an unaccessible curb or to be able to make their way to a product or service, or anything else that could be made accessible to them by some accommodating manner. Do you not agree? 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] Testing for Current pointer position in array during iteration
Mark Weaver schreef: tedd wrote: ... Try looking at current http://www.php.net/current Maybe that will help. not in the context of foreach() (I'll repeat the oneliner here because tedd's old and has a crap email client ;-): php -r '$r = array(a,b,c); next($r); $K = key($r); foreach ($r as $k = $v) { echo $K , key($r), $k\n; }' current() is akin to key() in that they both work on where the array pointer currently is. not that current() returns a key ;-) Jochem put things back into perspective for me. I'm having that printed on a T-Shirt :-P -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
At 4:37 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 4:21 PM, tedd wrote: At 3:27 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 3:15 PM, tedd wrote: Why should I have to explain something that is widely known and easy to find? So, I'm curious, what prevents a website from providing a good implementation of both an audio and visual captcha to prevent accessibility problems which you claim are impossible to avoid with every use of a captcha? If you are curious, then please research it. There is plenty of documentation. I am curious as to what your answer would be as I cannot find what does not exist. There is more than enough documentation regarding accessibility issue for you to find your answer. All you need to do is read. Just because you had a run-in with me off-list where I apologized for my comment does not mean that I won't repeat it publicly for everyone to decide if what I said was appropriate or not -- your call. As I see it, you're just being argumentative and playing word games and I'm not going to play. So either read-up on the subject and ask a honest question or I'll stop answering your questions all together. 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] Testing for Current pointer position in array during iteration
At 11:10 PM +0200 8/29/08, Jochem Maas wrote: Mark Weaver schreef: Jochem put things back into perspective for me. I'm having that printed on a T-Shirt :-P Damn! You get more T-Shirts than me. :-) 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] Is this a bug?
T Lensselink schreef: Catalin Zamfir Alexandru, DATAGRAM SRL wrote: Hello guys, I've been stalking on the list for some time. Didn't have anything to report/talk, until now. I have a code like this, maybe you guys can reproduce it, with output buffering started: Echo 'something'; Echo 'another thing'; Echo 'something br /'\; What happens is that ANYTHING that was echo'ed until that \, will not reach the buffer. Although, this should actually be a Parse Error, it isn't, it just echoes what was echoed after the god damned \. It took me two hours to find this typo in the code . ouch. don't forget you can do: $ php - l yourscript.php to test for syntax errors (the warning does show up with this). additionally a good syntax highlighting editor can help you to spot stuff like this ... anything to stop the eyes from bleeding :/ Can you guys reproduce the error? I can actually give you a link to the server where this code runs. The script doesn't cause a parse error Instead it throws a warning. 'PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in' Don't think it's a bug. And the reason there's no syntax error is because the \ is a PHP escape character. is this character ever valid as an escape character outside of a string? if it is that's news to me and if it isn't then really it is a bug ... it should be a straight up parse error ... chances are that it's down to limitations in the lexer? the output buffer handler that seems to be swallowing the warning every second request now that is weird. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
On Aug 29, 2008, at 5:19 PM, tedd wrote: At 4:37 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 4:21 PM, tedd wrote: At 3:27 PM -0400 8/29/08, Eric Gorr wrote: On Aug 29, 2008, at 3:15 PM, tedd wrote: Why should I have to explain something that is widely known and easy to find? So, I'm curious, what prevents a website from providing a good implementation of both an audio and visual captcha to prevent accessibility problems which you claim are impossible to avoid with every use of a captcha? If you are curious, then please research it. There is plenty of documentation. I am curious as to what your answer would be as I cannot find what does not exist. There is more than enough documentation regarding accessibility issue for you to find your answer. All you need to do is read. There is no documentation anywhere which claims, as you do, that it is impossible to design a captcha which deals with accessibility issues. It has been done and the research into doing it better continues - even with those who are both blind and deaf. So, again, remember, the concept of a captcha is this: A test to prove one is human in order perform some action. There is no reason why a blind or deaf person absolutely cannot be presented with such a test. Now, if you wish to continue to argue to the contrary, you are more then welcome to do so. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
tedd schreef: At 9:32 PM +0100 8/29/08, Stut wrote: That's ultimate accessibility, assuming it supports all types of telephone, but it's also a major expense needing 24/7 coverage. Not something my company of 5 people could hope to support on a free-to-use site. -Stut -Stut: I hesitated before writing this because I don't want to get into another debate with you, but accessibility means that all people (disabled or not) can access the data they want in a similar fashion. Accessibility does NOT mean If you have a problem with our web site, please call This is no different than any other accessibility issue. People in wheelchairs should not have to call someone to get them over an unaccessible curb or to be able to make their way to a product or service, or anything else that could be made accessible to them by some accommodating manner. Do you not agree? yes and no. in the wild a lion with hip atrophy will be forced to crawl away and die ... no more eating gazelles for him, more to the point there are millions (billions?) of people without the right to free speech , or say clean water let alone have the money for a PC or an internet connection. my point being we have a long long long way to go before we can say much positive about accessibility for everyone. I think both tedd and Stut make good points, I guess we'll all be hacking away at such issues for a long time to come. in the mean time, here's wishing more clean water and internet access for everyone (and less bombs). Cheers, tedd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
Eric Gorr schreef: On Aug 29, 2008, at 5:19 PM, tedd wrote: ... There is no documentation anywhere which claims, as you do, that it is impossible to design a captcha which deals with accessibility issues. a lack of evidence proving the impossible ... there is a logic flaw there somewhere. It has been done and the research into doing it better continues - even with those who are both blind and deaf. So, again, remember, the concept of a captcha is this: A test to prove one is human in order perform some action. so orthogonal to the turing test ... I'd wager that research in turing test passing technology is moving faster that captcha tech. so in the long run captcha is plain dead in the water. really the basic concept of captcha is this: A test to prove that the interacting agent is legitimate, whether it be Bot, Cat, Human or otherwise. oh, and nobody's yet mentioned that anyone can bust any captcha on an automated scale without any programming intelligence, it takes nothing more than a setting up a pr0n affliate site with a redirector form that sneakily grabs captcha images from whatever the target of the day is ... and in such a case you'd be quite happy if someone's bot came along a repeated cracked your captcha There is no reason why a blind or deaf person absolutely cannot be presented with such a test. Now, if you wish to continue to argue to the contrary, you are more then welcome to do so. on behalf of the list, please accept our Crayon of the Week award. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with HTML special characters
Michelle Konzack schreef: * Do not Cc: me, because I READ THIS LIST, if I write here * *Keine Cc: am mich, ich LESE DIESE LISTE wenn ich hier schreibe* LIKE I CARE. hack your mail server / mail client / whatever if it bother's you so much. BTW it's the list that's being CC'ed Hello *, On my Website I have a NEWS section which I can edit On-Line over my Web-Interface but I have a problem with umlauts. I can enter the ü as uulm; and it is saved as such and it works properly but, if I now want to re-edit the NEWS, it is schown as ü in the input field of the TEXTAREA. grmpf Is there a command/function which can convert a whole text that it is shown correctly with all ...; sequences? your going about it all wrong. you should enter ü, ü should be in the database and if your output encoding requires it ü should be entized (including in the textarea) to uulm; when you output the content. you can hack your way roung it by double entitizing so that uulm; becomes amp;uulm; in the source (between textarea and /textarea when the editor page is output. you'll probably have to use a nasty little regexp for that in order to avoid double entizing amp; into amp;amp; (hint: negative lookahead assertion) Thanks, Greetings and nice Day/Evening Michelle Konzack Systemadministrator 24V Electronic Engineer Tamay Dogan Network Debian GNU/Linux Consultant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASCII Captcha
Eric Gorr schreef: On Aug 29, 2008, at 5:51 PM, Jochem Maas wrote: Eric Gorr schreef: On Aug 29, 2008, at 5:19 PM, tedd wrote: ... There is no documentation anywhere which claims, as you do, that it is impossible to design a captcha which deals with accessibility issues. a lack of evidence proving the impossible ... there is a logic flaw there somewhere. Considering that it has been done, why do you assert anyone would claim (such as tedd), who wants to remain credible, that it hasn't? Do you wish to make such a claim? ... huh? I really can't even be bothered to try and grok this nonsense of yours. real trolls use less pronouns. PS. I a lot less kind than tedd, I bounce everything straight back to the list if you try to tackle me offlist ... If I wanna pick a fight I'll do it in public, I have no shame ... I'm dutch. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php