Re: [PHP] php/mysql - getting ID of query

2007-08-21 Thread mike
mysql_insert_id() mysqli_insert_id() http://us.php.net/mysql is your friend :) http://us.php.net/mysqli too! On 8/21/07, John Pillion <[EMAIL PROTECTED]> wrote: > This is as much a mysql question as it is php. > > > > What is the most reliable way to retrieve an auto_increment key/id for a > qu

Re: [PHP] Re: Announcement: Releasing CORE GRASP for PHP. An open source, dynamic web application protection system.

2007-08-22 Thread mike
es should be put in whenever possible, perhaps during an RCx before a gold build or something. Any loss of functionality due to them should be a configuration option to turn on/off but otherwise everyone would benefit from security, memory leak, and other patches... - mike -- PHP General Mailing List

Re: [PHP] Re: Announcement: Releasing CORE GRASP for PHP. An open source, dynamic web application protection system.

2007-08-22 Thread mike
On 8/22/07, M. Sokolewicz <[EMAIL PROTECTED]> wrote: > because such options slow down the execution of every PHP script, even > though "disabled". compile time options wouldn't be much of a slowdown. and in my mind, with CPU power being quite cheap, i could see it being more valuable to have more

Re: [PHP] Re: Announcement: Releasing CORE GRASP for PHP. An open source, dynamic web application protection system.

2007-08-22 Thread mike
On 8/22/07, Chris <[EMAIL PROTECTED]> wrote: > That's a completely wrong assumption. PhpBB has had a lot of > vulnerabilities in the past, as has php-nuke and other popular packages. > > They've been around for years and not written by newbie's as far as I > know - but I don't have any link to eith

Re: [PHP] Re: Announcement: Releasing CORE GRASP for PHP. An open source, dynamic web application protection system.

2007-08-22 Thread mike
On 8/22/07, Chris <[EMAIL PROTECTED]> wrote: > I'm agreeing with the ideas behind Grasp & Suhosin - I'm just > disagreeing with Daevid's comment about them only being for 'newbie' > installations. oh, most definately. i consider myself a very tight coder - but i'd prefer to have them in my PHP ins

Re: [PHP] Passing variables to a PHP script on clicking a hyperlink

2007-08-24 Thread mike
On 8/23/07, Suamya Srivastava <[EMAIL PROTECTED]> wrote: > Hello, > > How can I pass variables on clicking a hyperlink to a PHP script? I have 5 > hyperlinks, all pointing to the same PHP script. However, on clicking each > hyperlink a different value of the variable needs to be passed to the PHP >

[PHP] Re: [PHP-DB] Re: [PHP] Passing variables to a PHP script on clicking a hyperlink

2007-08-24 Thread mike
t an in-browser method of collecting data and sending the key/value pairs in POST or GET... IMHO the HTML portion should already be known before someone steps into the realm of PHP and server-side programming) - mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: [PHP-DB] Re: [PHP] Passing variables to a PHP script on clicking a hyperlink

2007-08-24 Thread mike
On 8/24/07, Suamya Srivastava <[EMAIL PROTECTED]> wrote: > Hi.. > > in the settings, session.use_cookies is turned ON but session.trans_sid is > turned OFF. do i need to enable this as well? > by doing this can i disable the register_globals? > - suamya You need to make sure session_start() is ca

Re: [PHP] help with session

2007-08-26 Thread mike
On 8/26/07, Jason Cartledge <[EMAIL PROTECTED]> wrote: I would replace $_REQUEST with $_GET or $_POST (as appropriate) > if ( !empty($_REQUEST['gender']) ) > { >$registrationGender=$_REQUEST['gender']; > } > else { Personally I would use if(isset($_SESSIO

Re: [PHP] Re: [PHP-DB] Re: [PHP] Passing variables to a PHP script on clicking a hyperlink

2007-08-26 Thread mike
On 8/26/07, Richard Lynch <[EMAIL PROTECTED]> wrote: > This is *SO* not correct at all! > > $_REQUEST[] is merely array_merge($_GET, $_POST, $_COOKIE); Yes and it mimics being lazy - allowing overriding values from $_POST vs. $_GET vs. $_COOKIE depending on what the programmer wants to "trust" I

Re: [PHP] Re: [PHP-DB] Re: [PHP] Passing variables to a PHP script on clicking a hyperlink

2007-08-26 Thread mike
> I'll say it again: > > regsiter_globals has *NOTHING* to do with $_REQUEST. > > Zero. > Zilch. > Nada. > Zip. To me it allows for the same [lazy] behavior. Period. I've had other people agree. Say what you want about it. > No, it only relies on one "Designer" who wants their request to look > l

Re: [PHP] A simple PHP script to generate a Pie Chart based on SQL query

2007-08-27 Thread mike
> > Hello All, > > > > I am looking for a simple PHP script that can generate Pie Chart based > > on SQL query resultset. > > > > I don't want a reporting system, as we are already using Crystal > > Reports for that. > > > > Any suggestions? one word is all you need: jpgraph -- PHP General Mail

Re: [PHP] why?

2007-08-27 Thread mike
On 8/27/07, Jay Blanchard <[EMAIL PROTECTED]> wrote: > Are you trying to do single sign-on? This would be one of the holy > grails of the PHP on Linux, Windows clients operations. This is > available with .Net and with legacy ASP/Jscript apps but not with > PHPeven on windows there's an apache

Re: [PHP] why?

2007-08-28 Thread mike
On 8/28/07, Jay Blanchard <[EMAIL PROTECTED]> wrote: > Since PHP cannot read registry settings (neither can JavaScript) on the > client that is out. Windows is aware of the logged in user, but exactly > where that 'session' information is kept is a mystery to most of us. So > PHP cannot be aware of

Re: [PHP] why?

2007-08-28 Thread mike
On 8/28/07, Stut <[EMAIL PROTECTED]> wrote: > In addition the OP is running IIS so this is all kinda less than helpful > to him. yeah, i didn't say this would, but it should be able to be ported to a PHP module by someone i would think. i mean if someone can do it in Perl or C (especially C) why c

Re: [PHP] How to show proper time to users from around the world

2007-08-29 Thread mike
On 8/29/07, Hemanth <[EMAIL PROTECTED]> wrote: > Hi friends, > > Is there a solution to showing the proper time and date at user > browsers > and also recording proper USER times in the database operations in > mysql if you have the opportunity to have them input the time, you can then use putenv

Re: [PHP] Preventing Access to Private Files

2007-09-06 Thread mike
On 9/6/07, Stephen <[EMAIL PROTECTED]> wrote: > I understand how to use PHP with MySQL to have a > members table to validate passwords. And to limit the > generation of "member" pages to members only. > > But what about photographs? If someone knows the > complete URL they could view it directly, u

Re: [PHP] Converting PHP code to C#?

2007-09-07 Thread mike
On 9/7/07, Symbian <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm not sure if this is the right place to post this, I have some decryption > routines that use mcrypt that I need to decrypt in .NET, does anyone know > how why I cant get this to work? I've done it in reverse - something encrypted in .N

Re: [PHP] Converting PHP code to C#?

2007-09-07 Thread mike
On 9/7/07, Symbian <[EMAIL PROTECTED]> wrote: > > I'm unable to workout how to get the same IV as the one generated by the PHP > script is random. The thing is that we cant change the PHP script as its > readily being used now. Maybe I should look at the encryption routine and > reverse that first?

Re: [PHP] Converting PHP code to C#?

2007-09-08 Thread mike
i'm pretty sure the IV mattered in our stuff. and remember i used CBC i think not EBC, and it worked fine. not sure if you want to try that and make it work for you or not without any warnings :) On 9/8/07, Symbian <[EMAIL PROTECTED]> wrote: > > > > mike-22 wrote: > &

Re: [PHP] Buxa Coding Guidelines

2007-09-08 Thread mike
On 9/8/07, Greg Donald <[EMAIL PROTECTED]> wrote: > I don't put PHP in my HTML. I use PHP to build my HTML, using heredoc > syntax while doing so. My scripts usually only have a single opening tag and never require any closing ?> tags. > > Code that contains short open tags or instances of opi

Re: [PHP] Using a variable for include statement

2007-09-11 Thread mike
you can definately use variables for filenames. i do it all the time. it's not like XSLT or other languages where it has to be included at the start or you're screwed. On 9/11/07, Jeff Benetti <[EMAIL PROTECTED]> wrote: > Sorry if this is a noob question, I have used PERL, TCL and VB but I am just

Re: [PHP] SEARCHING for an answer...

2007-09-11 Thread mike
On 9/11/07, Jason Pruim <[EMAIL PROTECTED]> wrote: > echo $qstring; produces: SELECT * FROM current WHERE FName like '%%' > or LName like '%%' or Add1 like '%%' or Add2 like '%%' or City like '% > %' or State like '%%' or Zip like '%%' or XCode like '%%' Which is > correct except for it being empt

Re: [PHP] SEARCHING for an answer...

2007-09-11 Thread mike
On 9/11/07, brian <[EMAIL PROTECTED]> wrote: > e: (my personal opinion) Using echo() to spit out HTML will lead to > *much* heartache and gnashing of teeth. Put a closing PHP tag ("?>") in > there and let the parser spit out the markup without echo(). i think this is quite opposite. i prefer echo'

Re: [PHP] html to xml?

2007-09-12 Thread mike
On 9/12/07, Slith <[EMAIL PROTECTED]> wrote: > i need to parse an html page for tabular data which i can then import > into mysql so i thought converting the html to xml might be a feasible > thing to do, however, other than using tidy from the command line i > can't find a way to do this from php.

Re: [PHP] my paging task with PHP does not work. It uses cookie.

2007-09-12 Thread mike
On 9/12/07, Patrik Hasibuan <[EMAIL PROTECTED]> wrote: > Dear my friends... > > I am trying to display the content of a table. Each page must content only 5 > records maximum. Each page has "Previous" and "Next" buttons (made from > anchor). > > I dump the primary of the working table and keep it

Re: [PHP] How to clean up extended charset or ASCII characters on form input?

2007-09-12 Thread mike
On 9/12/07, Eric Wood <[EMAIL PROTECTED]> wrote: > I've searched of 21000 messages in this list and I don't quite understand how > to best protect user input. > > Let's say you have a form that posts to itself just do see how messed up data > can get: http://php.net/filter has great easy to use

Re: [PHP] PHP 5.2.3 - Segmentation fault (core dumped)

2007-09-12 Thread mike
can i ask why you have anything to do with mod_php3 there? and if you don't plan on trying to use php4 and php5, then remove any looking for php4 too. > > > > > > > > DirectoryIndex index.php index.php3 index.html > > > > > > DirectoryIndex

Re: [PHP] Getting line count of a text file

2007-09-12 Thread mike
On 9/12/07, Frank J. Schima <[EMAIL PROTECTED]> wrote: > In PHP 5, I'm counting the number of lines in a text file using the > following code: > $myfile = file ( '/path/to/myfile.txt'); > $count = count ($myfile); > > However, sometimes it fails with the following error: >

Re: [PHP] Getting line count of a text file

2007-09-12 Thread mike
personally i try to use as little shell commands as possible, especially stacked on top of each other in exec(). i'd just use explode, str_split, substr/strpos, etc. after i got it back. On 9/12/07, Wolf <[EMAIL PROTECTED]> wrote: > Novel approach... But mine's less typing. :) > > never thought

Re: [PHP] Getting line count of a text file

2007-09-12 Thread mike
On 9/12/07, Greg Donald <[EMAIL PROTECTED]> wrote: > Why? Shell commands are a lot less likely to change than the > current PHP function names. > > I'm aware the PHP function naming algorithm currently remains a > secret, but without a doubt, someday someone _will_ crack it. I > personally hope t

Re: [PHP] Getting line count of a text file

2007-09-12 Thread mike
On 9/12/07, Chris <[EMAIL PROTECTED]> wrote: > bruce wrote: > > greg... actually, i was the one that said this. > Sure they can - enable safe-mode and it causes all sorts of weirdness > with running exec or system calls. not to mention shell commands expect to be in PATH, and if you hardcode in

Re: [PHP] my paging task with PHP does not work. It uses cookie.

2007-09-13 Thread mike
if($numlist > $numpages) { $numlist = $numpages; } for($x=$start; $x<=$numlist; $x++) { if($x == $thispage) { $html .= sprintf(" %02d", $x); } else { $html .= sprintf(" %02d", $optio

Re: [PHP] my paging task with PHP does not work. It uses cookie.

2007-09-14 Thread mike
except i think innodb does not have a full row count stored. anyway the design was meant for a simple one function call. it's worked great for small and data loads. On 9/14/07, Arvids Godjuks <[EMAIL PROTECTED]> wrote: > Don't use SQL_CALC_FOUND ROWS on simple queries, when you have to run a > si

Re: [PHP] Configure mail to use Gmail smtp

2007-09-16 Thread mike
i'm quite sure you can't with php's built-in mail() function. however more advanced modules should support it. look in PEAR, google for phpmailer, etc. i'm sure there's got to be some. worst case i think you have all the tools in PHP to make your own anyway. On 9/16/07, debussy007 <[EMAIL PROTECT

Re: [PHP] Regex æøå email validation?

2007-09-24 Thread mike
On 9/24/07, Per Jessen <[EMAIL PROTECTED]> wrote: > > Hi guys > > > > Im helping a friend with hes internet site, and I have found this > > regex email validation regex on the internet: > > > > var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a- > > z]{2,6}(?:\.[a-z]{2})?)$/i; > >

Re: [PHP] SOAP in PHP on very restricted host?

2007-09-25 Thread mike
On 9/25/07, David Zentgraf <[EMAIL PROTECTED]> wrote: > Hi, > > We need to work with a credit card checking company for an online > store. The one we're looking at only offers an API implementation via > PHP modules, or via SOAP protocol. Unfortunately our host is > extremely restrictive right now

Re: [PHP] SOAP in PHP on very restricted host?

2007-09-26 Thread mike
On 9/25/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > i try to stay away from it if i can. i think the same of SOAP. in my opinion a shower is the only place for soap. simple XML, REST, JSON, lighter weight things are what i prefer. even XML-RPC i can live without. my $0.02 -- PHP General Mail

Re: [PHP] Re: languages and PHP

2007-09-27 Thread mike
On 9/27/07, Edward Vermillion <[EMAIL PROTECTED]> wrote: > But what happens if you get data that's *not* UTF-8? Just because > your html/form is set to UTF-8 doesn't mean that all your incoming > data will be UTF-8. just my experience, but as long as it has the meta tag w/ utf-8 in it, the browse

Re: [PHP] How can i only fetch a (rss/atom) feed when it's changed?

2007-10-02 Thread mike
On 10/2/07, Mark <[EMAIL PROTECTED]> wrote: > I'm currently fetching feeds about every hour (automatically in php) > but sometimes there are no new updates in a feed for 2 hours. so no i > wonder if it's possible to check the feed somehow to see if it changed > since i last fetched it and if it's t

Re: [PHP] How can i only fetch a (rss/atom) feed when it's changed?

2007-10-03 Thread mike
On 10/3/07, Greg Donald <[EMAIL PROTECTED]> wrote: > > cat fsockopen.php > #!/usr/bin/env php > > $fp = fsockopen( 'destiney.com', 80, $errno, $errstr, 30 ); > > if( !$fp ) > { >echo "$errstr ($errno)\n"; > } > else > { >$out = "GET /rss HTTP/1.1\r\n"; >$out .= "Host: destiney.com\r\n"

Re: [PHP] Alternate Colors in Rows

2007-10-03 Thread mike
On 10/3/07, Steve Marquez <[EMAIL PROTECTED]> wrote: > Greetings, > > I am attempting to alternate the colors of the container DIV. Anyone know > how to do this? you could always use javascript we've used something like this with success: http://www.sitepoint.com/article/background-colors-javascr

Re: [PHP] Mime Magic functions - how standard are they?

2007-10-03 Thread mike
On 10/3/07, Dave M G <[EMAIL PROTECTED]> wrote: > So, ultimately, what I'm wondering is, what should I be using in order > to determine file MIME types that will be the most commonly installed on > servers with PHP? I wrote something that does system("file -iNr $file") which gives you the applicat

Re: [PHP] Disabling the built-in POST handler

2007-10-05 Thread mike
On 10/5/07, Stefanos Stamatis <[EMAIL PROTECTED]> wrote: > > Hello, > > I need to handle very large file uploads and push the data into a socket. > Having php to write everything to a temporary file, then reading it > again inside the script and pushing it into the socket is very inefficient > and

Re: [PHP] Empty Array?

2007-10-05 Thread mike
> At 7:43 AM -0400 10/5/07, Dan Shirah wrote: > >Ah, what a lovely case of the Friday morning brain farts! > > > >I have a query that selects some data from a table based on the current ID > >selected. > > > >If the query does not return any results, I want it to continue to another > >query that w

Re: [PHP] Connect PHP to Remote SQL Server?

2007-10-05 Thread mike
On 10/5/07, Jason Paschal <[EMAIL PROTECTED]> wrote: > Apache and PHP 4.3.9 are on a *nix server and we don't have root access, > HOWEVER we can have the tech support perform pretty much any action except > re-compile PHP (for which they charge), but I'm hoping i could dynamically > load extensions

Re: [PHP] mySQL Results To XML

2007-10-06 Thread mike
On 10/6/07, CK <[EMAIL PROTECTED]> wrote: > Hi, > > > Here's the mission, creating a movie DB, I need the results returned > from mySQL in an XML format for use with the FLASH Professional > DataGrid. Any tips on formating mySQL results would be grand. Here's > the structure of the DB, if needed.

Re: [PHP] mySQL Results To XML -- my xmltag() functions

2007-10-06 Thread mike
On 10/6/07, Daevid Vincent <[EMAIL PROTECTED]> wrote: > Here's the 'functions_xml.inc.php' file I use, it has served me well and > handles I believe all tag cases, personally I'm a big fan of using the > attributes as they're most easily parsed out in the PHP DOM functions: I made this at one poi

Re: [PHP] count vs mysql_num_rows

2007-10-08 Thread mike
On 10/8/07, Kevin Murphy <[EMAIL PROTECTED]> wrote: > I've got a little function that just checks to see if something is in > a mysql db. There are several ways to do this and was curious as to > the best way. The following are 2 (simplified) versions that work > just fine. If these are the best wa

Re: [PHP] MySQL and SESSIONs

2007-10-08 Thread mike
On 10/8/07, Philip Thompson <[EMAIL PROTECTED]> wrote: > Hi. This may not be best practice, but I think it's great to use - > especially since I can use multiple functions with the same database > connection w/o having to send the db link/resource. Store the connection in > the GLOBALS variable - t

Re: [PHP] Two MySQL instances in one server

2007-10-15 Thread mike
On 10/15/07, Matt Arnilo S. Baluyos (Mailing Lists) <[EMAIL PROTECTED]> wrote: > I have tried this once but PHP can only connect to one MySQL server > because it can only read one socket file at a time. are you sure? I am using multiple datasources (not socket ones) but I see absolutely no reason

Re: [PHP] p-s-e-x-e-c

2007-10-18 Thread mike
On 10/18/07, Instruct ICC <[EMAIL PROTECTED]> wrote: > > > When I run the command on the server itself, it > > works just fine. When I run the same command via a webpage, the text file > > does not generate. > > > I also have a similar problem but reversed. It works in a webpage but not on > the

Re: [PHP] Looking for a framework

2007-10-23 Thread mike
On 10/23/07, Larry Garfield <[EMAIL PROTECTED]> wrote: > I don't think any really integrate with PHP better or worse than others, since > all of them can only speak HTTP. I will say that in my professional PHP work > I've standardized on jQuery because jQuery itself rocks, and doesn't try to > tur

Re: [PHP] How can I load this XML file into an array? (and. . . how do I reference the values?)

2007-10-26 Thread mike
On 10/26/07, John A DAVIS <[EMAIL PROTECTED]> wrote: > > > I've found simple examples on the web that work a simple XML file (song, > title, etc) but I need one that will parse an XML file into elements of an > array. And then, I need to reference these elements to validate against a > database. Th

Re: [PHP] How can I load this XML file into an array? (and. . . how do I reference the values?)

2007-10-26 Thread mike
On 10/26/07, John A DAVIS <[EMAIL PROTECTED]> wrote: > > > this works: > $xml_data = file('xml_edwr2.xml'); > var_dump($xml_data); > > I can get the var_dump to work for 1 sample, but I guess there are a many > samples in one xml file which turns into something like this(so, there is no > way for m

Re: [PHP] How can I load this XML file into an array? (and. . . how do I reference the values?)

2007-10-26 Thread mike
On 10/26/07, John A DAVIS <[EMAIL PROTECTED]> wrote: > > > simplexml won't work for our version of PHP. planning on upgrading once we > get the new server then i guess if you need it now, it's probably easiest to look for a PEAR module. however... gophp5.org! :) -- PHP General Mailing List (htt

Re: [PHP] Perl style chomp()

2007-11-01 Thread mike
im(), rtrim() and ltrim() ? seems unnecessary to reinvent the wheel. if you want an array one, just make it recurse like you did. - mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP advice: Tips webpage valid?

2007-11-13 Thread mike
On 11/13/07, Dotan Cohen <[EMAIL PROTECTED]> wrote: > I came across this page today: > http://reinholdweber.com/?p=3 > > It covers a lot of flammable material (echo vs. print) but I wonder > how valid some of the advice is. Can anyone elaborate? Thanks. funny you should post this, I've recently be

Re: [PHP] Quick questions -- how do I place the cursor (i.e., set focus) to a field on page load?

2007-11-13 Thread mike
you want javascript. i'd recommend using jquery (jquery.com) put an id="username" on the username box. then do $(document).ready(function() { $("#username").focus(); }); voila On 11/13/07, Jon Westcot <[EMAIL PROTECTED]> wrote: > Hi all: > >This may or may not be a PHP-related questi

Re: [PHP] Quick questions -- how do I place the cursor (i.e., set focus) to a field on page load?

2007-11-13 Thread mike
]> wrote: > Hi Mike: > > > you want javascript. > > > > i'd recommend using jquery (jquery.com) > >I'll look into this. Thanks. > > > put an id="username" on the username box. > > > > then do > > > > > >

Re: [PHP] Quick questions -- how do I place the cursor (i.e., set focus) to a field on page load?

2007-11-13 Thread mike
yeah, but adding in jquery will open up his entire world :) the example below will work without jquery. personally though i try to stick with jquery since i usually need it for more throughout my site. On 11/13/07, Chris <[EMAIL PROTECTED]> wrote: > It only works if you have included the jquery

Re: [PHP] Quick questions -- how do I place the cursor (i.e., set focus) to a field on page load?

2007-11-13 Thread mike
in my experience it never stops at a single focus event on a login box... but yes, i should have replied with the simpler solution first. On 11/13/07, tedd <[EMAIL PROTECTED]> wrote: > At 5:49 PM -0800 11/13/07, mike wrote: > >yeah, but adding in jquery will open up his entire

Re: [PHP] Open Source BTS??

2007-11-15 Thread mike
On 11/15/07, Randy Patterson <[EMAIL PROTECTED]> wrote: > Hey, > > I am needing to install a bug tracking system on a web server and looking for > a good PHP open source solution. Looking for a pretty mature system that > still has active development. Thanks for any suggestions. http://www.mantisb

Re: [PHP] How to ask "if private IP"?

2007-11-25 Thread mike
i did this once $ip = sprintf("%u",intval(ip2long($_SERVER['REMOTE_ADDR']))); and then did checks to see if it was between the ranges for 10.0.0.0, 192.168 etc... apparently i lost that code. but it was pretty simple. http://www.faqs.org/rfcs/rfc1918.html 10.0.0.0- 10.255.255.255

Re: [PHP] parsing text for special characters

2007-11-29 Thread mike
On 11/29/07, Adam Williams <[EMAIL PROTECTED]> wrote: > I've got an html form, and I have PHP parse the message variables for > special characters so when I concatenate all off the message variables > together, if a person has put in a ' " or other special character, it > won't break it when it use

Re: [PHP] zip codes and lat/longs

2007-12-05 Thread mike
Here's code I had, but it recently stopped working It takes the zip code for the user and the user you're viewing, looks them up from the data table (z_data_zips) and does the calculation. The formula is in a handful of places - I converted mine from a MySQL example (I think, or vice versa) You c

Re: [PHP] zip codes and lat/longs

2007-12-06 Thread mike
After reading this I decided to figure out what the issue was. It was the MySQL result set. Somehow the columns changed and messed up the float values. So I just whipped this up quick to reload the data (and possibly update it too) Here's the quick-and-dirty: 1) download ZCTA (the text version)

Re: [PHP] zip codes and lat/longs

2007-12-06 Thread mike
($ziplist,0,strlen($ziplist)-1); $query .= " user_zips IN($ziplist)"; } } db_free($uchk); On 12/6/07, Daniel Brown <[EMAIL PROTECTED]> wrote: > On Dec 6, 2007 11:02 AM, mike <[EMAIL PROTECTED]> wrote: &g

Re: [PHP] How to look for unused methods/functions and variables/constants.

2007-12-14 Thread mike
Well you can use get_defined_vars() to find all the variables defined inside of each scope (for instance global scope) that don't really need to be defined... http://php.net/get_defined_vars They can help you unset() or find variables you otherwise don't need to use. But that's the best I think y

Re: [PHP] utf-8 in $_POST

2008-01-07 Thread mike
> > > My experience is that this does not affect only the displayed > characters, but the way the form fields are transported. > > But perhaps I am wrong, > Iv This works for me as well. Put in utf-8 and you should be good to go. You don't -technically- need to even change your database fields

Re: [PHP] iphone.facebook.com PHP inquiry

2008-01-07 Thread mike
It's probably using IUI (the iPhone UI CSS/JS that Joe Hewitt created, now being maintained at http://code.google.com/p/iui/) which allows you to request the page to be loaded via AJAX based on how you setup the link. this will load via AJAX this will load like a normal page link This is how I *

Re: [PHP] iphone.facebook.com PHP inquiry

2008-01-07 Thread mike
. On 1/7/08, Steve Finkelstein <[EMAIL PROTECTED]> wrote: > Thanks for the reply Mike. > > I suppose ultimately I'd need to dig into the JavaScript (hopefully it's not > compressed) to figure out the PHP routing. I believe re-writing my > application with the framework

Re: [PHP] utf-8 in $_POST

2008-01-07 Thread mike
maybe look at iconv functions but the content-type is the only thing i set, and it works 100% fine. all javascripts, forms, etc. inherit it from the looks of it properly. On 1/7/08, Olav Mørkrid <[EMAIL PROTECTED]> wrote: > i specify iso-8859-1 in both header and body: > > > > > if two differe

Re: [PHP] Get Parameters in Includes?

2008-01-09 Thread mike
that is a horrible method. it works in zeus and apache, but not lighttpd, from my experience. it's just not a good idea. technically that should only be file paths, and i would expect it to load a file named "x.cgi?want=ssilinks" although fopen wrappers can confuse that further... in my opinion

Re: [PHP] Get Parameters in Includes?

2008-01-09 Thread mike
On 1/9/08, Liam <[EMAIL PROTECTED]> wrote: > mike wrote: > > that is a horrible method. > Thanks for the nice positive, refreshing and most helpful response. read the sentence below it. > > in my opinion i would say "redesign it properly." > Well what the he

Re: [PHP] Get Parameters in Includes?

2008-01-09 Thread mike
On 1/9/08, Liam <[EMAIL PROTECTED]> wrote: > The cgi script IS perl. Oh, RE: the sentence below it: I'm running > apache, and it DOESN'T work. The reason I am trying to call it in php > is to include it on a webpage. So, tell me, how am I supposed to > pre-generate the contents in a flatfile (w

Re: [PHP] Re: Scratch that

2008-01-09 Thread mike
On 1/9/08, Liam <[EMAIL PROTECTED]> wrote: > Liam wrote: > 1: It mustn't count as a http hit, it's going to > and 2: I need to only get what is between the tags. now you're just asking the list to code something for you... my suggestions again: look into rewriting it to be more reusable loo

Re: [PHP] Re: Scratch that

2008-01-09 Thread mike
> sanity when checking the site statistics!) > and > 3) I also need to know how to run a expression-ish thing so that when I > 'parse' the text, it returns all text between x and y, but parse it > BEFORE it gets 'included'. > > Note: fOpen is NOT enabled, an

Re: [PHP] Re: Scratch that

2008-01-10 Thread mike
you're still issuing an HTTP request to get it, or executing perl on the command line... if it's a true non-profit 503(c)(3), you could offer someone the chance to write off their services... non-profits may not have a lot of money to spare but they do typically have money to fund things in the or

Re: [PHP] Get Parameters in Includes [SOLVED!!!]

2008-01-10 Thread mike
yeah - well you said you can't issue an http request although it depends - if your reporting is javascript/browser-executable, or if it's a server-side increment. if it's javascript, no worries, the curl request won't execute it. On 1/10/08, Liam <[EMAIL PROTECTE

Re: [PHP] SMTP vs mail()

2008-01-11 Thread mike
On 1/11/08, Richard Heyes <[EMAIL PROTECTED]> wrote: > > Assuming you're talking delivery to a local MTA (which will subsequently > > do the remote delivery), is speed really important? > > For the amount of email I'm looking at (1000s, growing), yes. one word: phpmailer (http://phpmailer.codeworx

Re: [PHP] SMTP vs mail()

2008-01-15 Thread mike
i can vouch. postfix rocks. i send it non-stop 30,000+ emails at a time (a loop from a database that does a popen("/usr/sbin/sendmail") on the local machine (also postfix) which then relays it to my actual public smtp server (running postfix) - and it just throws it all into the queue and chews on

Re: [PHP] Encryption failing

2008-01-15 Thread mike
me too - it was a space. i changed it to "+" and it worked fine. $cookie = str_replace(' ', '+', $_COOKIE['foo']); On 1/15/08, Bastien Koert <[EMAIL PROTECTED]> wrote: > > are you base64 encoding the resultant encryption string? I have found that > there are problems with certain characters th

Re: [PHP] Re: [QUESTION] MAIL: Send a NOOP instead of DATA

2008-01-15 Thread mike
Why not look at phpmailer? Probably more robust than some random classes. http://phpmailer.codeworxtech.com/ Not to bash on Manuel, but I find phpclasses to be littered with lots of crappy code and is too ad-laden and hard to use for me to bother. On 1/15/08, Wang Chen <[EMAIL PROTECTED]> wrote:

Re: [PHP] Encryption failing

2008-01-15 Thread mike
> > if ($EorD == "D") { >$text_out = mdecrypt_generic($cypher,$text); >$text = base64_decode($text); shouldn't this be base64_decode($text_out) ? :) > } else { >$text= base64_encode($text); >$text_out = mcrypt_generic($cypher,$t

Re: [PHP] Re: [QUESTION] MAIL: Send a NOOP instead of DATA

2008-01-15 Thread mike
This list is democratic as well. Personal experience has led me there from many Google queries, and none of the code has been usable. I give you props for creating a site and classes on it and such, but this list is for people to ask and share opinions. I said it was not to badmouth you but my per

Re: [PHP] Re: [QUESTION] MAIL: Send a NOOP instead of DATA

2008-01-15 Thread mike
On 1/15/08, Manuel Lemos <[EMAIL PROTECTED]> wrote: > You are missing my point. One thing is disliking somebody's work for > whatever reasons, another this is acting disrespectfully and call it > crappy in a public forum. If you don't know how to act respectfully with > other PHP developers, I have

Re: [PHP] Encryption failing

2008-01-15 Thread mike
On 1/15/08, Andrés Robinet <[EMAIL PROTECTED]> wrote: > 1 - Mike is right about first encrypting and then doing a base64_encode (then > saving results to DB, cookies, etc). I don't know why replacing " " to "+" > for decrypting, though. we have an appli

Re: [PHP] utf-8 in $_POST

2008-01-16 Thread mike
you don't have to have your files in utf-8 for it to work, just the browser header. although any utf-8 characters in your files will look funky. it just depends where the content comes from... you could always use ® for the (r) registered symbol for example. i'd be more apt to figuring out how to

Re: [PHP] Encryption failing

2008-01-16 Thread mike
On 1/16/08, Ken Kixmoeller -- reply to [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > On Jan 16, 2008, at 1:28 AM, Andrés Robinet wrote: > > His other post explains that php didn't seem to like spaces. No > spaces in the test strings -- I'll check for those when/if I can get > the core en/decrypt

Re: [PHP] Foreach

2008-01-17 Thread mike
On 1/17/08, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > > $name = $_POST['name']; > > if ($name) { > > foreach ($name as $t) { > > > >echo "$t"; > >} > >$order = $_POST['order']; > >if ($order) { > >foreach ($order as $i) { > > there are a few different issues here; firs

Re: [PHP] Foreach

2008-01-18 Thread mike
On 1/18/08, Eric Butera <[EMAIL PROTECTED]> wrote: > Nonetheless as I keep re-iterating, people will copy and paste this > stuff as is because they don't know better. It is the responsibility > of people writing the answers to make sure their code is validated and > as "secure" as possible unless

Re: [PHP] Foreach

2008-01-18 Thread mike
On 1/18/08, Andrés Robinet <[EMAIL PROTECTED]> wrote: > Please, don't get me wrong, I'm just curious, how does the server know when > the browser is closed? Do you use javascript (AJAX) or something to notify > the server? it's a browser thing, not a server thing. the browser will "forget" the ses

Re: [PHP] $_POST Array and Cleaning

2008-01-22 Thread mike
> On Jan 21, 2008 3:22 AM, nihilism machine <[EMAIL PROTECTED]> wrote: > > I'm trying to create a function that will first take an array of > > $_POSTs and give them key/value pairs like variables. For instance, if > > i had $_POST['whatever'] = "whatever", that would be made into > > $whatever = "

Re: [PHP] Using mysql_real_escape_string without connecting to mysql

2008-01-23 Thread mike
> > It would be Real Nifty (tm) if the MySQL API had a function that let > > you specify the charset without a connection and did the escaping. > > > > Presumably you don't NEED a connection if you already know what > > charset thingie you are aiming at... I concur - it would be nice to have the c

Re: [PHP] Using mysql_real_escape_string without connecting to mysql

2008-01-23 Thread mike
On 1/23/08, Chris <[EMAIL PROTECTED]> wrote: > If you need to escape something you're going to do a query aren't you? > Or am I missing something here? true. but i typically have everything in wrapper functions, and i don't keep the actual resource variable exposed to use it (since it needs a res

Re: [PHP] PEAR website and MSIE 6

2008-01-31 Thread mike
Go to windowsupdate. There was an update for IE6 for websites randomly crashing. I know, because I was affected. Some update broke IE6 and then you had to update a second time. Make sure you're all up to date (and restart, sigh) - and it should be good. On 1/31/08, Richard Heyes <[EMAIL PROTECTED

Re: [PHP] PEAR website and MSIE 6 (M$ forcing IE7)

2008-02-01 Thread mike
On 2/1/08, Daevid Vincent <[EMAIL PROTECTED]> wrote: > Feb 12th is D-day. > > http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls=GGLG,GGLG:2005- > 28,GGLG:en&q=microsoft+forcing+ie7 Actually... http://blog.wired.com/monkeybites/2008/01/microsofts-ie-7.html "The short story is that you w

Re: [PHP] Session and Multi Server Architecture

2008-02-11 Thread mike
On 2/11/08, Per Jessen <[EMAIL PROTECTED]> wrote: > Because you've chosen another option - memcached presumably - which is > more expensive over all. (IMHO). mysql (stated above), and i already have a connection open each page... > On the next request, LVS will know not to try that server, and t

Re: [PHP] Session and Multi Server Architecture

2008-02-11 Thread mike
On 2/11/08, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > when i was in dc at the conference last year, there were several speakers > from facebook. they claimed they have (had) 400 servers w/ 4TB of memory > at on the memcache tier. actually, it's ~ 400 according to this (200 active / 200 hot spare

<    1   2   3   4   5   6   7   8   9   10   >