[PHP] Blocking URL hacking attemps

2012-04-22 Thread sono-io
I'm using a script called BlackHole that uses PHP and a hidden directory to catch bad bots and block them by their IP address from the site [http://perishablepress.com/blackhole-bad-bots/]. It's working very well, but I'd like to expand on the idea. When looking at our access

Re: [PHP] learning resources for PHP

2012-04-18 Thread sono-io
On Apr 18, 2012, at 1:30 PM, Henry Martinez wrote: I've been having a lot of fun with Beginning PHP 5.3 by Matt Doyle. Covers basics nicely... Also, the code samples and explanations are top notch, and you come to really understand what it is you're doing.. +1 Marc -- PHP

Re: [PHP] $POST and $_SESSION

2012-03-17 Thread sono-io
On Mar 15, 2012, at 11:52 AM, Stuart Dallas wrote: Change your php.ini settings to log to a file and set display_errors to off. Sometimes when you ask a stupid question you end up getting a brilliant answer. I had no idea about any of this until I received your response, which got me

Re: [PHP] $POST and $_SESSION

2012-03-15 Thread sono-io
On Mar 15, 2012, at 11:35 AM, Daniel Brown wrote: On Thu, Mar 15, 2012 at 14:31, Stuart Dallas stu...@3ft9.com wrote: The @ prefix is banned from all code I go anywhere near - it's evil! For the most part, I agree with you, Hmm... I use it on my web pages (unless I'm testing)

Re: [PHP] A Review Request

2011-05-18 Thread sono-io
On May 18, 2011, at 3:06 PM, tedd wrote: You know, if you sat down with me and saw how my IDE handles braces, I think you might see the reason why I code like I do. Tedd, I like the demo. Thanks for posting it. From another post of yours, I take it that you're a Mac guy.

Re: [PHP] the best 1 book for php

2011-04-07 Thread sono-io
On Apr 7, 2011, at 7:19 AM, Marc Guay wrote: session_start(); // Genesis // do stuff session_destroy(); // Revelation Now THAT'S clever! =:) I'm half way though Beginning PHP 5.3 by Matt Doyle and I like it a lot. Very readable, and up-to-date. Marc -- PHP General

Re: [PHP] Last Name extraction in query

2011-04-04 Thread sono-io
Jim, Actually - I can't seem to find a mysql newsgroup anywhere. The ones that come up in google search are all dead and buried. I found a mailing list that might work for you: To subscribe to the list, send an empty message to mysql-subscr...@lists.mysql.com Marc -- PHP

Re: [PHP] Bar Charts in PDFs

2011-02-11 Thread sono-io
On Feb 11, 2011, at 2:08 AM, Mattias Geniar wrote: Have a look at the library called 'pChart': http://pchart.sourceforge.net/ While it's a bit old... Actually, it's been updated to v2.1 now. It looks pretty nice. http://www.pchart.net/ Marc

[PHP] Array Symbol Suggestion

2011-01-12 Thread sono-io
I'd like to make a suggestion for a change, or possibly an addition, to the PHP language. I'm learning PHP and have been very excited with what it can do in relation to HTML. But when I got to the part about arrays, I was disappointed to see that they are designated with a $ the same as other

Re: [PHP] Newbie Question

2011-01-05 Thread sono-io
On Jan 4, 2011, at 5:27 AM, Steve Staples wrote: I now use Komodo (the free version) on my ubuntu workstation, and I love it... I dont know how I managed before. I use Komodo Edit on OS X and I love it as well, except for the compare files feature. It's the worst one I've ever used.

Re: [PHP] RIGHT Function?

2009-11-14 Thread sono-io
On Nov 13, 2009, at 6:34 PM, Jim Lucas wrote: You basic problem with the PHP_EOL is that when echo'ed out, it represents a \n character. The value you are working with might be \n\r or just \r I read the links you sent, plus some others. It took me awhile, but I get it now. If the

Re: [PHP] RIGHT Function?

2009-11-13 Thread sono-io
I think I've solved a problem that I had posted back in September. Here's a recap: == I need to grab a dollar amount from a text field in a MySQL db that can contain more information than just the price. Here are 4 examples of what could be in that field: 48,(min)

Re: [PHP] RIGHT Function?

2009-11-13 Thread sono-io
Hi Jim, $parts = explode(PHP_EOL, $item['unitprice']); $price = '$'.(( count($parts) 1 ) ? $parts[0] : $parts[(count($parts)-1)]); Thanks for the code! After reading up on PHP_EOL and explode, I now understand what you've done. However, can you tell me why you like this better? Is

Re: [PHP] RIGHT Function?

2009-11-13 Thread sono-io
Jim, $parts = explode(PHP_EOL, $item['unitprice']); $price = '$'.(( count($parts) 1 ) ? $parts[0] : $parts[(count($parts)-1)]); For some reason, I couldn't get explode to work with PHP_EOL. $parts[0] would return the entire field, so apparently it wasn't exploding. So I tried

[PHP] RIGHT Function?

2009-09-24 Thread sono-io
Hi all, I could use some help. I've scoured both the MySQL and PHP sites that I know of and can't find an answer to this. I have a price field that sometimes contains entries like this: 250,(min) 5.32 How can I pull just the price ($5.32 in this example) from this field to

Re: [PHP] RIGHT Function?

2009-09-24 Thread sono-io
On Sep 24, 2009, at 12:15 PM, Jay Blanchard wrote: substr will work from right to left. If your data is in a variable do this; Thanks, Jay. That does the job. Frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Include Files in HTML

2009-09-04 Thread sono-io
In my readings, I've run across examples showing include files being called from within the head/head tags, and other examples showing them called within body/body. I've always put them in the header section myself, but I was wondering if one is better than the other, or is it just

Re: [PHP] Include Files in HTML

2009-09-04 Thread sono-io
On Sep 4, 2009, at 1:05 PM, Bob McConnell wrote: Depends on what you are including. The only tags that can be inside the head are base, link, meta, script, style, and title. Everything else is either body or prologue. I meant PHP includes like this one: ?php

Re: [PHP] Searching on AlphaNumeric Content Only

2009-09-03 Thread sono-io
Thanks to everyone who has responded. After reading everyone's response, I think I have a very simple way to solve my problem. Using my original example, if someone wants to find item # 4D-2448-7PS, no matter what they type in, I'll take the input, strip out all non-alphanumeric

[PHP] Searching on AlphaNumeric Content Only

2009-09-02 Thread sono-io
Is there is a way to search only for the alphanumeric content of field in a db? I have an itemID field that contains item #'s that include dashes, forward slashes, etc, and I want people to be able to search for an item # even if they don't enter the punctuation exactly. Here's an

Re: [PHP] Re: unset() something that doesn't exist

2009-08-26 Thread sono-io
On Aug 26, 2009, at 9:28 AM, Paul M Foster wrote: and having a great marriage to a woman I can spend hours talking about nothing to. I'm jealous. Does she have a sister who's not spoken for? =;) Frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] PHP Shopping Cart Recommendation

2009-08-24 Thread sono-io
The only e-commerce site I've worked on was based on OSCommerce. It's pretty good, easy to integrate new functionality into, and not too much trouble to style up to look the way you want with CSS. Thanks, Ash. I downloaded CRE Loaded, which is an off-shoot of osCommerce, and the latest

Re: [PHP] PHP and CGI

2009-08-20 Thread sono-io
Hi Tedd, In your .htacess file add this: # handler for phpsuexec. -- makes following prefixes considered for php FilesMatch \.(htm|html|pl)$ SetHandler application/x-httpd-php /FilesMatch Thanks for the code. I placed it in the .htaccess file for the output templates, but

[PHP] Displaying 2 digit minutes/seconds

2009-08-20 Thread sono-io
Hi all, I'm using this code to display the current time for our location on our website: ?php date_default_timezone_set('America/Los_Angeles'); $theTimeIs = getdate(time()); $theHour = $theTimeIs['hours']; $theMinute = $theTimeIs['minutes']; // make

Re: [PHP] Displaying 2 digit minutes/seconds

2009-08-20 Thread sono-io
On Aug 20, 2009, at 2:38 PM, Ashley Sheridan wrote: What's wrong with using the date() function? You can have it output any sort of format you wish. So, getting a 2 digit time in hours:minutes:seconds you would put: date(H:i:s); Thanks, Ash. I had tried that before but I couldn't find a

Re: [PHP] Displaying 2 digit minutes/seconds

2009-08-20 Thread sono-io
On Aug 20, 2009, at 2:34 PM, Jonathan Tapicer wrote: You can use sprintf or str_pad to fill in with zeros, with sprintf you can do this: echo sprintf('%02d', 5); Thanks, Jonathan! I learned two new functions today! Both work great but I think I like sprintf for this application

[PHP] PHP and CGI

2009-08-18 Thread sono-io
I've searched high and low for an answer to this. Hopefully someone here might know. Can PHP be used under a CGI? I tried to put the following code on one of my perl shopping cart pages but it doesn't work: ?php echo select name=\Year\; for ($year = date(Y) ; $year = date(Y) + 8 ;

Re: [PHP] Re: PHP and CGI

2009-08-18 Thread sono-io
On Aug 18, 2009, at 7:13 PM, Shawn McKenzie wrote: I assumed that the problem was that he knew PHP and he had downloaded a Perl cart and didn't know Perl. That's exactly the case. I have been running my business on a Perl cart for the last 5+ years, and I can't switch to a PHP cart just

Re: [PHP] Embedding foreach loops

2009-08-11 Thread sono-io
On Aug 11, 2009, at 12:13 AM, hessi...@hessiess.com wrote: Do *NOT* get into the habit of outputting your HTML using echo or print statements, it becomes unmaintainable very quickly, use a templating language, ether with a framework(recomended) or standalone. This sounds interesting.

[PHP] PHP 6 and MySQL 5 for Dynamic Web Sites Book

2009-08-05 Thread sono-io
Has anyone read this book by Larry Ullman yet? If so, what do you think about it? I'm looking for a well-rounded book that covers PHP for e-commerce websites and from what little I've been able to find online, it looks pretty good. Or would you recommend another book? I know that no

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread sono-io
Is what I'm looking to do not possible in PHP? I've come close with a JavaScript version, but I'd rather not rely on everyone having JS turned on. Or am I stuck having to use JS? Thanks again, Frank I'd like to revisit this one last time. Below is the revised code I'm using, but I

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread sono-io
On Aug 4, 2009, at 9:43 AM, Jerry Wilborn wrote: Keep in mind that you can use name=var[] value=value1, name=var[] value=value2 and php will create an array as $_REQUEST['var'] with each of your values. The keys are numbered and don't count on what order they'll come through. Thanks

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread sono-io
Sorry... I'm using GET. I have used the code you supplied below, but as I mentioned, it gets sent for every itemid in the table. I needs to be sent only once, and right after the action. That's where I'm stumped. Frank On Aug 4, 2009, at 11:56 AM, Jerry Wilborn wrote: If the form

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread sono-io
On Aug 4, 2009, at 12:33 PM, Ben Dunlap wrote: I don't follow what you mean by it gets sent for every itemid -- can you post an example of the query string that's being generated? Well, do I feel stupid. I thought I had moved it to the correct spot but I hadn't. When input type=hidden

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread sono-io
I've run up against something else here that I can't find an answer for. This line of the script: $cats = array('01100-01200-01300-06403' = 'Starter Units', '01100-02201-01300-06403' = 'Add-On Units', '01100-99222-11341-18451' = 'Extra Shelves'); is supposed to pull all items from each

Re: [PHP] Multiple MySQL Queries

2009-08-04 Thread sono-io
Well, it took me all evening to figure it out, but I did. The SQL statement needed to be changed to WHERE categories LIKE '%$cat%' and now it works. I had found an old book on my shelf called MySQL and Perl for the Web and found an example in there that pointed me in the right direction.

Re: [PHP] Can a range be passed to a query?

2009-08-03 Thread sono-io
On Aug 3, 2009, at 7:19 AM, Miller, Terion wrote: Not sure why none of these are working for me since you have them tested against your tableI get this error... Hopefully I'm not speaking out of turn here, but did you by any chance copy and paste that code from an e-mail? If so,

Re: [PHP] Multiple MySQL Queries

2009-08-03 Thread sono-io
I'd like to revisit this one last time. Below is the revised code I'm using, but I don't like having individual 'Add To Cart' buttons for each item. I've tried to find a way to have only one that resides outside the nested tables for all items, but without luck. It would need to send

[PHP] Better Formatting Options?

2009-07-30 Thread sono-io
Is there a more efficient way to write the following? ?php $result = mysql_query(SELECT priceList FROM catalog WHERE itemid='ABC1',$db); printf(iList: s%s/s/ibr /\n, money_format('$%i', mysql_result($result,0,priceList))); ? I have many products per page and this code pulls the

[PHP] Multiple MySQL Queries

2009-07-28 Thread sono-io
This may be more of a MySQL question than PHP, but I'm hoping someone can point me in the right direction. I have working code (below) that pulls data from a particular category in our db. I'd like to be able to pull data from multiple categories in the same db and place them on the

Re: [PHP] Multiple MySQL Queries

2009-07-28 Thread sono-io
On Jul 28, 2009, at 12:48 PM, Jim Lucas wrote: ?php $item_list = ; $cats = array('01100-01200-01300-06403', '01100-02201-01300-06403'); echo 'table border=1'; echo 'tr'; foreach ( $cats AS $cat ) { echo 'th'.htmlspecialchars($cat).'/th'; } echo '/trtr'; foreach ( $cats AS $cat ) {

Re: [PHP] Multiple MySQL Queries

2009-07-28 Thread sono-io
On Jul 28, 2009, at 12:48 PM, Jim Lucas wrote: ?php $item_list = ; $cats = array('01100-01200-01300-06403', '01100-02201-01300-06403'); echo 'table border=1'; echo 'tr'; foreach ( $cats AS $cat ) { echo 'th'.htmlspecialchars($cat).'/th'; } echo '/trtr'; foreach ( $cats AS $cat ) {

Re: [PHP] Multiple MySQL Queries

2009-07-28 Thread sono-io
On Jul 28, 2009, at 4:38 PM, Jim Lucas wrote: I saw your other email before sending. The problem with the way you show you want it there is that each result set would have to be the same size. I'm going to assume that they won't be... Well, they SHOULD be but you never know. Thanks

Re: [PHP] Possible Server Infection?

2009-04-07 Thread sono-io
On Apr 4, 2009, at 6:51 PM, TG wrote: Anyway, just some thoughts. Good luck! Thanks to TG, Bastien, and Marc. I appreciate the input. Regards, Frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Possible Server Infection?

2009-04-04 Thread sono-io
Hi all, I was wondering if someone might know about a problem I'm having on my server. It appears that I've been infected by a rogue PHP script(?). Something has gone through my server and placed .htaccess files in every directory that didn't have one with contents that look like

[PHP] Stopping bad entries in PHP form

2009-03-19 Thread sono-io
I have a PHP form that allows end users to request a sample of the products we sell. Unfortunately, a person/people have found it and are sending in bad requests. We sell only within the US, and so I've set up the form so that they must choose one of the 50 States. But we keep getting