Re: [PHP] webform spam prevention
On Wed, Apr 3, 2013 at 7:33 PM, tamouse mailing lists < tamouse.li...@gmail.com> wrote: > These folks might have direction for you: http://textcaptcha.com/really > > (And my apologies for top posting. It seems Google has forced their > new mail compose widget upon me. I can no longer use my own editor to > smoothly and easily edit message, and Google forces the top post.) > Actually, it doesn't, as I show below. > > On Tue, Apr 2, 2013 at 2:13 PM, Jen Rasmussen > wrote: > > Can someone recommend a best practice for blocking spam on web forms > (aside > > from captcha) ? > > > > > > > > I've been for the most part utilizing a honeypot method and then > > individually blocking IPs and am looking for a more efficient method that > > won't require daily maintenance. > > > > > > > > I've come across this module: http://spam-ip.com/phpnuke-spam-module.php > > > > > > > > Has anyone used this method or have any other better suggestions? > > > > > > > > Thanks in advance! > > > > > > > > Jen Rasmussen > > > > Web Development Manager | Cetacea Sound Corp. > > > > 763-225-8465 | www.cetaceasound.com > > > > > > P Before printing this message, make sure that it's necessary. The > > environment is in your hands > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Actually, it doesn't. All you have to do is scroll to the bottom and add your material.
Re: [PHP] Re: limit access to php page
On Wed, May 29, 2013 at 9:20 PM, Glob Design Info wrote: > On 5/29/13 6:14 PM, Jim Giner wrote: > >> On 5/29/2013 7:11 PM, Tim Dunphy wrote: >> >>> Hello list, >>> >>> I've created an authentication page (index.php) that logs into an LDAP >>> server, then points you to a second page that some folks are intended to >>> use to request apache redirects from the sysadmin group (redirect.php). >>> >>> Everything works great so far, except if you pop the full URL of >>> redirect.php into your browser you can hit the page regardless of the >>> login >>> process on index.php. >>> >>> How can I limit redirect.php so that it can only be reached once you >>> login >>> via the index page? >>> >>> Thank you! >>> Tim >>> >>> I would simply place my redirect.php script outside of the >> web-accessible tree. The user can never type that uri into his browser >> and have it work. >> > > I always see this answer a lot but never any sample code of how to include > that file using require_once() or include_once(). > > It would be nice to know the exact syntax of inclusion of such files. > > Say, for example if I put the login/redirect .php file 3-4 levels up from > my webroot. > > require_once('../../../redirect.php');
Re: [PHP] newbie PDO query display question
On Sun, Jun 16, 2013 at 6:29 PM, dealTek wrote: > Hi all, > > newbie PDO question... > > I think (hard to tell - buried in a wrapper class) I am doing a select > query using - PDO::FETCH_ASSOC like... > > wrapper -- return $pdostmt->fetchAll(PDO::FETCH_ASSOC); > > --- > > so my query is like... > > $results = $db->select("mytable", "id = 201"); //just 1 exact record) > > then I can loop like.. > foreach ($results as $result) { > > ?> > > > > > > > > > This all works fine. > > ---> But since I only have 1 exact record - I don't need to LOOP anything > - so... > > Q: How do I display the columns without a loop > > > these fail - so what will work > > echo $results["First"]; > echo $results["First"][0]; ??? > echo $results["First"][1]; ??? > > > PDO::fetchAll returns its data as an array, even if only one record is returned. In this case, echo $results[0]["First"]; echo $results[0]["Last]; echo $results[0]["id"]; will do what you want.
Re: [PHP] From 24/7/2013 to 2013-07-24
On Fri, Jul 26, 2013 at 5:18 AM, Karl-Arne Gjersøyen wrote: > Below is something I try that ofcourse not work because of rsosort. > Here is my code: > --- > $lagret_dato = $_POST['lagret_dato']; > foreach($lagret_dato as $dag){ > > $dag = explode("/", $dag); >rsort($dag); > $dag = implode("-", $dag); > var_dump($dag); > > What I want is a way to rewrite contents of a variable like this: > > From 24/7/2013 to 2013-07-24 > > Is there a way in PHP to do this? > > Thank you very much. > > Karl > $conv_date = str_replace('/', '-','24/7/2013'); echo date('Y-m-d', strtotime($conv_date)); Result: 2013-07-24
Re: [PHP] From 24/7/2013 to 2013-07-24
On Fri, Jul 26, 2013 at 1:08 PM, Robert Cummings wrote: > On 13-07-26 11:42 AM, jomali wrote: > >> On Fri, Jul 26, 2013 at 5:18 AM, Karl-Arne Gjersøyen > >wrote: >> >> Below is something I try that ofcourse not work because of rsosort. >>> Here is my code: >>> --- >>> $lagret_dato = $_POST['lagret_dato']; >>> foreach($lagret_dato as $dag){ >>> >>> $dag = explode("/", $dag); >>> rsort($dag); >>> $dag = implode("-", $dag); >>> var_dump($dag); >>> >>> What I want is a way to rewrite contents of a variable like this: >>> >>> From 24/7/2013 to 2013-07-24 >>> >>> Is there a way in PHP to do this? >>> >>> Thank you very much. >>> >>> Karl >>> >>> >> $conv_date = str_replace('/', '-','24/7/2013'); >> echo date('Y-m-d', strtotime($conv_date)); >> Result: 2013-07-24 >> > > It would be better if you reformatted first since this is ambiguous when > you have the following date: > > 6/7/2013 > > Here's a completely unambiguous solution: > > > $old = '24/7/2013'; > > $paddy = function( $bit ){ return str_pad( $bit, 2, '0', STR_PAD_LEFT > ); }; > $new = implode( '-', array_map( $paddy, array_reverse( explode( '/', > $old ) ) ) ); > > echo $new."\n"; > > ?> > > Cheers, > Rob. > -- > E-Mail Disclaimer: Information contained in this message and any > attached documents is considered confidential and legally protected. > This message is intended solely for the addressee(s). Disclosure, > copying, and distribution are prohibited unless authorized. > The original question was about reformatting a European (Day/Month/Year) date. Your solution does not address this problem. Mine assumes the European date format explicitly.
Re: [PHP] Re: SELECT data base on a upper level SELECT
On Thu, Aug 1, 2013 at 6:33 PM, iccsi wrote: > Thanks for the information and help, > The query can solve server side, but client side, user might select any > one dropdown, for example, user might select manager from drop down without > choose Department dropdown. > > For this case, application needs inject data for supervisor and lower > level, > No, simply prevent client from submitting form until all required fields are filled in. (A blindingly simple procedure). > > Thanks again for helping, > > Regards, > > Iccsi, > > "Jim Giner" wrote in message news:8C.41.29774.C0E5AF15@pb1.**pair.com... > > On 7/31/2013 9:37 PM, iccsi wrote: > >> I have 5 SELECT for Department, Manager, supervisor, Group Leader and >> Employees >> I want to every SELECT list narrow down for an upper SELECT. >> For example, once user select Department then all Manager, Supervisor, >> Group Leader and Employee list will be narrow down by department and >> same for manager and supervisor and so on. >> >> I can use iframe or jQuery to do every level, but it needs to call >> iframe or jQuery to 5 levels. >> I would like to know are there any better way to handle this situation, >> >> Your help and information is great appreciated, >> >> Regards, >> >> >> Iccsi, >> >> How about using just one select and add variables to the where clause? > Set the variable(s) to the values that you want to filter on. > > For ex.: > > your query is > $sel = 1; > $q = "select Department, Manager, supervisor, Group Leader,Employees > where $sel"; > > Then when the user selects a department $d: > > $sel = "Department = '$d'"; > > OR if you have selected a department $d and a manager $m: > > $sel = "Department ='$d' and Manager='$m'"; > > One query. A variable 'where' clause. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] webserviceX.net?
I tested it with my current address, and it did not know my current area code, which has been what it is for at least ten years. jomali On Sat, Apr 23, 2011 at 2:36 PM, Brian Dunning wrote: > I'm looking for some geographic data, like ZIP codes, area codes, but it > has to be current and correct. Has anyone ever used the free web services at > webserviceX.net? Do you know anything about the data? How current/correct is > it? Seems to be an awful lot they're giving away for free. > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >