Re: [PHP] Syntax Snag need extra eyes

2009-07-16 Thread Andrew Ballard
On Thu, Jul 16, 2009 at 12:35 PM, Jim Lucas wrote: > > Andrew Ballard wrote: > > On Thu, Jul 16, 2009 at 12:25 PM, Jim Lucas wrote: [snip] > >> Also, this is the wrong way to use printf().  Please go read the manual > >> page for this function. > >> > &

Re: [PHP] Search Query on two tables not working

2009-07-21 Thread Andrew Ballard
$sql .= " AND restaurants.name LIKE '%". mysql_real_escape_string($namePart) ."%' "; } } } if ($searchAddress) { // ADDED SPACE HERE $sql .= " AND restaurants.address LIKE '%". mysql_real_escape_string($address) ."%'

Re: [PHP] Search Query on two tables not working

2009-07-21 Thread Andrew Ballard
IKE statements. It is the concatenation, like I said the last time. There is no white space between "inspection.ID" and "AND". You may indeed have problems with some of those repeated conditions on restaurants.name, but if so they will be performance issues resulting fr

Re: [PHP] Converting SQL Dialects

2009-07-21 Thread Andrew Ballard
pefully small number of saved > queries that are flagged for manual upgrading. (And not be so painful > in development that it still nets us saved time) > > Matt You might even be able to convert EMPTY(X) to COALESCE(X, '') = ''. MySQL seems to be pretty forgiving with its implicit type-casting. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] newbie - Is there a calendar module for date entry?

2009-07-22 Thread Andrew Ballard
Ash > www.ashleysheridan.co.uk > Um what's the difference? I've used both the YUI and Tigra's free calendar. In both, you click on a button and a small calander widget pops up allowing the user to select a date for a field on a web form. Neither is a PHP feature; both rely on JavaScript. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] newbie - Is there a calendar module for date entry?

2009-07-22 Thread Andrew Ballard
On Wed, Jul 22, 2009 at 9:02 AM, Ashley Sheridan wrote: > Sorry, my bad, I misread the URL. Having a lot of stress here at the > moment getting my laptop fixed :-/ > Isn't that called withdrawal? ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/uns

Re: [PHP] Doubt regarding session_destroy() in PHP 5

2009-07-22 Thread Andrew Ballard
les that use stored procedures. Most just use regular INSERT/SELECT/UPDATE/DELETE statements, which means that the PHP user has full access to the entire table. In that case, it's no more trivial to scan the session table than it is to scan the session save path looking for interesting stuff.

Re: [PHP] Doubt regarding session_destroy() in PHP 5

2009-07-22 Thread Andrew Ballard
d store the key in $_COOKIE or even a use a combination of (or hash derived from) session_id() and another value stored in $_COOKIE as the key. It seems to me that anything you can do to make file-based sessions secure could also be layered into a database approach, making the database sessions e

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Andrew Ballard
urly braces around the > middle argument (to avoid PHP getting confused) and it didn't recognise > the matches by the numbered $1, $3, etc. I know I'm not the op who asked > the original question, but it might help him/her? > > Thanks > Ash > www.ashleysheridan.co.

Re: [PHP] How to build an FF extension

2009-07-23 Thread Andrew Ballard
TH > if you wrote Fx. > > Cheers, > Rob. You beat me to it. :-) I've never seen Fx in reference to Firefox. I've only ever seen FF. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Converting SQL Dialects

2009-07-23 Thread Andrew Ballard
nteger would result in the value 0 while casting to a date would produce the date value equivalent to the integer 0. The benefit of COALESCE is that it should be standard SQL. I know it works on MySQL and SQL Server, and I think it works on Oracle and others as well. You may take a performance hit for using COALESCE in conditions like that since it usually means the condition can't use an index, but considering you're moving from using similar logic in FoxPro that may not matter for you. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Question on code profiling

2009-07-23 Thread Andrew Ballard
the total processing time is around 416ms. I thought it might be calls to require_once/include/include_once. While they are significant (around 46%), it says they only account for 193ms. What could account for that much difference between what xdebug calculates versus the total elapsed time? Andre

Re: [PHP] Question on code profiling

2009-07-23 Thread Andrew Ballard
On Thu, Jul 23, 2009 at 4:51 PM, Robert Cummings wrote: > Andrew Ballard wrote: >> >> I'm trying to profile a site on our development server to see why it >> takes around 4 seconds to generate a pretty basic page. I installed >> xdebug to use for the profiling, a

Re: [PHP] Re: Question on code profiling

2009-07-23 Thread Andrew Ballard
: 3.990795135498 seconds xdebug(WinCacheGrind): 402ms (0.402 seconds) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Question on code profiling

2009-07-23 Thread Andrew Ballard
eGrind. From what I can tell, the numbers I see in WinCacheGrind look like they are off by about a factor of 10 pretty uniformly. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Question on code profiling

2009-07-24 Thread Andrew Ballard
On Fri, Jul 24, 2009 at 2:27 AM, Lupus Michaelis wrote: > Andrew Ballard a écrit : >> >> I'm trying to profile a site on our development server to see why it >> takes around 4 seconds to generate a pretty basic page. > >  Last time I seen this is when I did vali

Re: [PHP] Question on code profiling

2009-07-24 Thread Andrew Ballard
On Thu, Jul 23, 2009 at 11:31 PM, Andrew Ballard wrote: > From what I can tell, the numbers I see in WinCacheGrind > look like they are off by about a factor of 10 pretty > uniformly. > > Andrew > Apparently the difference is indeed WinCacheGrind, as a number of other people hav

Re: [PHP] Question on code profiling

2009-07-27 Thread Andrew Ballard
On Sat, Jul 25, 2009 at 1:31 AM, Daniel Kolbo wrote: > Andrew Ballard wrote: >> On Thu, Jul 23, 2009 at 11:31 PM, Andrew Ballard wrote: >>> From what I can tell, the numbers I see in WinCacheGrind >>> look like they are off by about a factor of 10 pretty &g

Re: [PHP] How to pull window to the foreground - Window Focus

2009-07-27 Thread Andrew Ballard
s: 1) Since they aren't real windows, they do not interfere with other tabs or windows you have open in your browser. 2) Since they are actually part of the page itself, they will always either stay on top of the other page elements or else they will automatically close (whichever effect is desi

Re: [PHP] More on "JS alert that links to file"

2009-07-27 Thread Andrew Ballard
On Mon, Jul 27, 2009 at 10:34 AM, Jim Lucas wrote: > Ashley's answer is correct.  But the one thing she ... He. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to pull window to the foreground - Window Focus

2009-07-27 Thread Andrew Ballard
n others. Like any other software, you just have to take some time to try out different versions and find the one that has the features that you want for the price you're willing to pay, or else try your hand at writing your own. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscri

[PHP] Namespace resolution performance implications

2009-07-31 Thread Andrew Mason
performance implications of the different stages of name resolution are. For example for the code in the framework it's self would it be preferable to use a \Foo\Bar style fully qualified class names in order for the resolution to be done at compile time? Thanks in advance Andrew 1. Calls to

Re: [PHP] ForEach Range Problems

2009-07-31 Thread Andrew Ballard
shorter because it takes advantage of string collation. Any string that begins with the character '0' will be greater than (or equal if the string is exactly '0') than '0'.) Also, if your table is set up correctly, you do not need the DISTINCT keyword in your query. Each restaurant should appear exactly once in the `restaurants` table. And just for fun... do you have any restaurants in your list whose name begins with a punctuation mark or some other non-alphanumeric character? :-) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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

2009-07-31 Thread Andrew Ballard
because the engine has to examine every row in the table and calculate left(name, 1) before it can compare that value to the range. The other versions I posted can simply scan/seek the index within a range. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] clean url problem .htaccess

2009-07-31 Thread Andrew Ballard
> ForceType application/x-httpd-php > > on php code parsing string from $_SERVER['PHP_SELF'] to get id out. > > this one works if i use article.php (http://mysite/article.php/3/ works) > but i want to use /article without php extention. is there a way around? > Look u

Re: [PHP] isset not functioning

2009-08-03 Thread Andrew Ballard
, but this doesn't seem > to be a pre-set function, and it still does not make it work. I am guessing > the user neglected to define $RESULT in his snippet, or I overlooked it. > > Can anyone see any problems with the code? > You are switching from $_REQUEST to $RESULT. Trying to use $_RESULT won't make it any better. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Need quick got written up yesterday!! OUCH

2009-08-04 Thread Andrew Ballard
et the multi-byte strings. The whole section of code is one jumbled mess with the usual improper line breaks with the addition of characters such as '<', '$', and ',' that have been replaced by sequences like '+ADw-', '+ACq-', and '+ADo

Re: [PHP] Need quick got written up yesterday!! OUCH

2009-08-04 Thread Andrew Ballard
has its issues, but I don't think this is one of them. The message looks the same when I look at it here: http://marc.info/?l=php-general&m=124939545127492&w=2 Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Warning: OutsourcingRoom.com

2009-08-06 Thread Andrew Ballard
gt; Greetings from Nigeria. > I believe the term you are looking for is "fraud victim." I also believe Ash was being quite facetious. :-) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Displaying user data and picture

2009-08-06 Thread Andrew Ballard
d on a server that is almost totally isolated from the public-facing web servers that use the same information. In this case, network policy prohibits us from mapping a common location that both machines could access. Since the network policy is unlikely to change, and since both systems have acc

Re: [PHP] reason for a "Notice:.." on one site but not another? (Same code.)

2009-08-10 Thread Andrew Ballard
short-circuit" logic, not all languages do. In that regard, I appreciate what John meant by saying it makes it look "more intelligent." Some languages evaluate each of the conditions to their respective boolean results before evaluating the logical operators. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Determining Calling Script Information

2009-08-13 Thread Andrew Ballard
go through to each line > that calls it and add the __LINE__ and __FILE__ parameters.  Guess I'm > looking for a simple solution.  Anyway, if there is a way just point me in > the right direction and I'll take it from there. > > Thanks, > Matt > You can use debug_b

Re: [PHP] How to output a NULL field?

2009-08-26 Thread Andrew Ballard
has that I really miss in SQL Server (the LIMIT clause), I miss enforcement of CHECK constraints in MySQL. (I suppose I could implement them via triggers, but that just seems messy to me.) I'm all for flexibility, though. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: How to output a NULL field?

2009-08-26 Thread Andrew Ballard
ata access library used to interface with it that NULL usually comes back as either the PHP NULL value or an empty string. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to output a NULL field?

2009-08-26 Thread Andrew Ballard
On Wed, Aug 26, 2009 at 9:51 AM, David Stoltz wrote: > Sorry - I don't know what you mean by DB class? > > I'm using Microsoft SQL 2000with this code: > > //create an instance of the  ADO connection object > $conn = new COM ("ADODB.Connection") >  or die("Cannot start ADO"); > //define connect

Re: [PHP] How to output a NULL field?

2009-08-26 Thread Andrew Ballard
On Wed, Aug 26, 2009 at 12:13 PM, Andrew Ballard wrote: > On Wed, Aug 26, 2009 at 9:51 AM, David Stoltz wrote: >> Sorry - I don't know what you mean by DB class? >> >> I'm using Microsoft SQL 2000with this code: >> >> > //create an instance of

Re: [PHP] How to output a NULL field?

2009-08-26 Thread Andrew Ballard
On Wed, Aug 26, 2009 at 12:06 PM, hack988 hack988 wrote: > Mysql,mssql has its own feature,you can't say Mysql is better than > Mssql or Mssql it better than Mysql,Is'nt is? > My the Way ,Mssql support Top n,m form mssql 2005 :) > Perhaps, but the OP said he's usi

Re: [PHP] Variance Function

2007-01-11 Thread Andrew Brampton
example within 72 hours of each other, which is a max acceptable time for a email to be bounced around). I hope this helps in some way. If not it was fun quickly coding up a clustering algorithm :) On reflexation it might be a lot easier to not use clustering and instead just look at toda

Re: [PHP] Scope of include

2007-01-17 Thread Andrew Kreps
On 1/17/07, jekillen <[EMAIL PROTECTED]> wrote: Hello php list: If I include a php script inside a php function definition and then call the function in another script. What is the scope of variables in the included script? Are they local to the function that calls include with the file name? Tha

Re: [PHP] Scope of include

2007-01-17 Thread Andrew Kreps
On 1/17/07, Andrew Kreps <[EMAIL PROTECTED]> wrote: On 1/17/07, jekillen <[EMAIL PROTECTED]> wrote: > Hello php list: > If I include a php script inside a php function definition and then > call the > function in another script. What is the scope of variables in the >

Re: [PHP] Daylight Savings Time in PHP4

2007-01-18 Thread Andrew Kreps
On 1/18/07, mike caplin <[EMAIL PROTECTED]> wrote: Does anyone know if the change in Daylight Savings Time (March this year) affects PHP v4.x? I looked around www.php.net and all I could find was a reference to v5 (http://bugs.php.net/bug.php?id=35296). Is there a v4 release which is compatible

[PHP] Re: PHP 4.4.6 Released!

2007-03-01 Thread Andrew Hutchings
se release fixes a crash that wasn't introduced until this release. That's clever ;) Regards Andrew -- Andrew Hutchings - Linux Jedi - http://www.linuxjedi.co.uk/ A-Wing Internet Services - http://www.a-wing.co.uk/ Windows is the path to the darkside...Windows leads to Blue Screen. B

Re: [PHP] File Open Prompt?

2009-08-28 Thread Andrew Ballard
e download prompt for $new_file? > > Thanks, > Dan > You need to send the content-disposition header in addition to the content-type: header("Content-Disposition: attachment; filename={$clean_file_name};", true); The filename shouldn't contain spaces or other special

Re: [PHP] Date +30 comparison

2009-09-01 Thread Andrew Ballard
econds in a day is not 86400. > OR > > $next_date  = strtotime('+30 days', strtotime($today_date)); > > Then take the seconds back to a date, like so: > > $the_date = date('m/d/Y', $next_date); Yes. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP inserting carriage returns into POST values?

2009-09-04 Thread Andrew Ballard
ter inside both double and single quotes unlike PHP that only interpolates inside double quotes. If the client browser is running under Windows, it may even be possible that the \n is recognized by the browser as a line terminator and converted to the Windows line terminator sequence (\r\n) ei

Re: [PHP] Re: Class variable value lost

2009-09-09 Thread Andrew Ballard
o that. Storing your object in a $_SESSION variable is one of those ways. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP configuration values

2009-09-11 Thread Andrew Ballard
lder and configure it as needed. Of course, if you do that you should also configure Apache to not serve that file if requested. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Reading files in PHP 5.3.0

2009-09-11 Thread Andrew Ballard
ommy post. >> >> Cheers, >> >> tedd > > No, but his post inside of yours is looking messed up a bit. Maybe he's > not sending the posts as plain text or maybe it's something peculiar > between Gmail and Yahoo? > > Thanks, > Ash > http://ww

Re: [PHP] PHP configuration values

2009-09-11 Thread Andrew Ballard
nces? For some reason, I was thinking that even values overriden in .htaccess would be reported as "master" and that only values set in ini_set() would be "local", but don't hold me to that. At any rate, if for some reason register_globals was disabled during script execu

Re: [PHP] PHP Header issue

2009-09-18 Thread Andrew Ballard
> with no success. > > Ready need your help. > > > > Thanks, > > Ernie Kemp > > Phone: 416 577 5565 > > Email:   ek...@digitalbiz4u.com It's all that HTML above and before You can't send ANY content to the client before sending headers. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Problem with Filesystem Functions

2009-10-03 Thread Andrew Burgess
I hope this isn't too basic of a question . . . I'm having a problem with the Filesystem Functions, I think. Specifically, I'm recursing through a directory, and have this code: $size = filesize($file); $type = filetype($file); $date = filemtime($file); I'm getting these warnings: Warning: file

Re: [PHP] Problem with Filesystem Functions

2009-10-03 Thread Andrew Burgess
On Sat, Oct 3, 2009 at 9:29 AM, Ashley Sheridan wrote: > > On Sat, 2009-10-03 at 09:07 -0400, Andrew Burgess wrote: > > I hope this isn't too basic of a question . . . > > I'm having a problem with the Filesystem Functions, I think. > Specifically, I'm recursin

Re: [PHP] Spry, XML, PHP and XSLT Hell

2009-10-05 Thread Andrew Mason
On Tue, Oct 6, 2009 at 4:37 AM, Nathan Nobbe wrote: > On Mon, Oct 5, 2009 at 10:10 AM, Matthew Croud wrote: > >> Hello, >> >> Is there anyone here who uses Spry with XML and PHP and understands XSLT, >> At the moment i'm in development hell and have a rather bloated question to >> ask someone who

Re: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-07 Thread Andrew Ballard
hing. I would have expected the first to print 1-10, > while the second to print 2-10, but they both print 1-10. > > Cheers, > > tedd > > Not wacky at all. Think of them both this way: Andrew

Re: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-07 Thread Andrew Ballard
On Wed, Oct 7, 2009 at 3:58 PM, Andrew Ballard wrote: > On Wed, Oct 7, 2009 at 3:42 PM, tedd wrote: > >> However, what I find wacky about all of this is: >> >> for($i=1; $i<=10; $i++) >>{ >>echo($i); >>} >> >>

Re: [PHP] utf8_decode() and mixed character sets

2009-10-10 Thread Andrew Ballard
a fairly common form of input. > > Thanks! > > James > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > Have you tried iconv or mb_string? Is it a option to update the database to use UTF-8? Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] how call a variable in a text

2009-10-21 Thread Andrew Ballard
s a text $variable trial. "; or $message = << There is a text $variable trial. MESSAGE; Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How is this possible?

2009-10-28 Thread Andrew Ballard
see how that works. > > Furthermore, something got changed and the entire script no longer works. So > I'm in a quandary to figure this out -- any ideas, suggestions, references? > > Thanks, > > tedd > That's exactly what register_globals does. It's analogo

Re: [PHP] Textarea to road a text file

2009-10-28 Thread Andrew Ballard
d(rendered) in browser > without TextArea! > > > > It sounds like you are not escaping the value that appears inside the textarea tags. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How do I get reliable COMPUTERNAME?

2009-11-05 Thread Andrew Ballard
On Thu, Nov 5, 2009 at 2:03 PM, Jim Lucas wrote: > Andrew Ballard wrote: >> I want to store the name of the computer that is executing a script in >> some log tables. (Our servers are load balanced, and I'd like to be >> able to determine which physical machine is servi

Re: [PHP] sessions and email

2009-11-12 Thread Andrew Ballard
iling a page, aside from making the > site completely Ajax based and pulling in every scrap of content via > Ajax. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > And even then, it has become part of the DOM and will be saved with the rest of the page. The presence of Javascript in the page *might* remove it/hide it/obscure it/etc., but it will still be there in the saved document. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] tracking forwarded emails using PHP

2009-11-18 Thread Andrew Ballard
tracked like this, and if they find you are doing it they will simply remove themselves from your mailing list and/or direct the messages to the trash. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] tracking forwarded emails using PHP

2009-11-18 Thread Andrew Ballard
ation-To". This approach allow the user to have total control over whether they wish to notify you. Keep in mind that 1) not all clients recognize these headers, and 2) many people again will choose to say "No". Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Disabling button onclick in IE

2009-12-01 Thread Andrew Ballard
appreciated. > It looks like IE has an issue with your button being named "submit", and is replacing the submit() method of the form with the element named "submit". Try changing the name of the button. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP 5.3 Code Documentor

2009-12-09 Thread Andrew Mason
Hi all, Is anyone aware of a code documentation generator like phpdoc or doxygen that supports the PHP 5.3 namespaces ? I tried adding support to doxygen myself but didn't have a whole lot of luck and didn't have huge amounts of time to spend on learning flex/yacc. Andrew -- P

Re: [PHP] Server-side encryption to prevent form hacking: new idea?

2009-12-11 Thread Andrew Ballard
for expected length, data type, >> and escape the data before saving it. >> >> Cheers, >> >> Mattias > you don't necessarily need encryption, you could use digests instead > and issue a use-once ticket as well. > Why is any of this necessary? Most of the time I build select lists from arrays, so it is easy to test the value submitted by the client to make sure it exists in the array without any encryption or hashing. Am I missing something? Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Learning PHP

2009-12-12 Thread Andrew Brookins
tures available in the version of PHP that you need to use. In general, the best publishers I've found are O'Reilly, The Pragmatic Programmers, Apress and Packt. Best, -- Andrew Brookins a.m.brook...@gmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Parsing JSON; back-slash problem

2009-12-15 Thread Andrew Burgess
This seems like a pretty basic question, but it has me stumped. Here's my scenario: I'm using Douglas Crockford's JSON2.js to parse an object in JavaScript, which I then pass to a PHP script to store in a file. I use JSON.stringify() on the object, which logs to the console as this: {"employees":

Re: [PHP] strip tags but preserve title attributes

2009-12-15 Thread Andrew Ballard
you can't use DOM? It has a function specifically for parsing HTML that "does not have to be well-formed to load." http://www.php.net/manual/en/domdocument.loadhtml.php If that doesn't work, you might look at Zend_Filter_StripTags in ZF. I don't know if it will do exactl

Re: [PHP] Parsing JSON; back-slash problem

2009-12-15 Thread Andrew Burgess
Thanks guys; I've got it working now! On Tue, Dec 15, 2009 at 9:54 AM, Wouter van Vliet / Interpotential wrote: >> >> If you don't have access to do this, look at stripslashes() > > And if you absolutely want to be on the safe side - check* if the > magic_quotes option is enabled - if so; do stri

Re: [PHP] PHP + ODBC

2009-12-16 Thread Andrew Ballard
Driver for PHP. It connects via ODBC, but it is the best library I've found for working with SQL Server in PHP. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: splitting a string

2010-01-05 Thread Andrew Ballard
nsion is .tar.gz and the filename is some.archive. I guess it > must compare the full filename to a list of knowns, and then try it's > best after that. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > While relying on a file's extension to determine the type

Re: [PHP] Open source project management tool - PHP

2010-01-06 Thread Andrew Williams
What could be a php potential problem with contact forms that are only protected against SQL injections and have an admin side view for the enquiry?

Re: [PHP] Re: PHP programming strategy; lots of little include files, or a few big ones?

2010-01-08 Thread Andrew Ballard
On Thu, Jan 7, 2010 at 10:48 PM, Robert Cummings wrote: > ... > They almost always make your shit run faster. You know they make medicine for that? ;-) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] header("Location:...") fails

2010-01-13 Thread Andrew Ballard
, it will continue to execute. You probably want to send a message right after the header call anyway, just in case someone is using a browser that does not handle redirection. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] If the first four characters are "0000", then do {}

2010-01-25 Thread Andrew Ballard
    do_stuff(); >> } > > Ah. Clever use of the "== 0" (tripple equals not necessary). > The OP needs to know if it's the first 4 or not and so position 0 would be > the start. Very nice. > The triple equals IS necessary. If '' is not found at al

Re: [PHP] DOM TextArea (and dom chart please)

2010-02-02 Thread Andrew Ballard
his one: > http://www.hscripts.com/tutorials/javascript/dom/textarea-events.php > > > and that chart does not help much.  Does anyone have a PHP DOM chart or a > resource that i can use to get started using this? > > Thanks in advance! > Ryan > I think what you are looking for is $input2->textContent in PHP. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Manual problems

2010-02-10 Thread Andrew Ballard
semantic web. I shall strive to > use it correctly, as I'm sure the original author intended. > > >    I think I need a snack... all this abuse of English is making >    me hungry :B > > > Cheers, > Rob. > -- > http://www.interjinn.com > Application and Te

Re: [PHP] PHP Manual problems

2010-02-12 Thread Andrew Ballard
nized interface they created for 2007.) Particularly there are differences between Excel and Calc that really annoy me. I would like to like OpenOffice.org, but I spend too much of the time I use it being frustrated by it. (Wow, has this thread digressed!) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Dumb Question - Casting

2010-02-18 Thread Andrew Ballard
t; > It works as expected if you take out the int() parts in each line. I'm > not sure why, but the use of int() seems to be screwing around with the > results. That's why the first line outputs a 0. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > Another fine example of floating point math. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Export/Write rows from DBF to CSV

2010-02-19 Thread Andrew Ballard
values (as long as the key is still present in the array) and I've found it to be much faster at writing larger data sets than trying to concatenate the CSV in code. http://www.php.net/manual/en/function.fputcsv.php Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Using base64 encode and decode to store user data in database

2010-02-19 Thread Andrew Ballard
, but when multiplied over all the values stored in your table it makes a difference. Also, don't forget to validate/filter non-character data, which you can't do with base64. Something like this is still vulnerable to SQL injection even though it 'sanitizes' the expected cha

Re: [PHP] Excel Spreadsheets and PHP

2010-02-19 Thread Andrew Ballard
control over formatting, formulas, etc., there is an XML format that Microsoft supports. http://msdn.microsoft.com/en-us/library/aa140066%28office.10%29.aspx Then you can use DOM in PHP to build what you need. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Andrew Ballard
fferent db vendors) is just a method to escape sequences that have special meaning in a SQL query. It is the LAST step you should perform when processing input to be saved in a MySQL database (when parameterized queries are not available), after you have done everything you can to ensure that A

Re: [PHP] PHP / mySQL Project... Real men use 'cat'

2010-02-24 Thread Andrew Ballard
're in /bin, surely at some point you'll want to execute > these poor pets? Haven't they been through enough already?! > > Thanks, > Ash > http://www.ashleysheridan.co.uk > If you have a cat, dog, rabbit and rat together in a bin, you probably won't have to ex

Re: [PHP] Excel Spreadsheets and PHP

2010-03-01 Thread Andrew Ballard
ure whether you can create an Excel file from scratch that way, but if not it would be trivial to have an empty Excel file that you can use as a template. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Is there a way to get PHP to release this file?

2010-03-01 Thread Andrew Ballard
g to pass a one-time URL to the browser where it will end up in the history. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Execution order of PHP

2010-03-10 Thread Andrew Ballard
ystem. After all, __set() might not be defined. I agree with Rob here. If order is really crucial, then call the statements in the correct order: system; /** * You should add some handling here to make sure that * $system is really an object that implements your * multiCall() method, and not something else (like null). */ $system->multiCall( $client->methodOne(), $client->methodTwo() ); ?> Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Object Oriented Programming question

2010-03-12 Thread Andrew Brookins
n Python, Ruby, or some other scripting language. I have found that in general, the quality of publicly available work is higher in those two languages than in PHP. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Doing dynamic routing for an office

2010-03-15 Thread Andrew Ballard
e graph, so you are looking for the best (often, but not necessarily the shortest) route between two nodes. http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Andrew Ballard
where leading zeros are significant) but are interpreted as numbers. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Andrew Ballard
On Fri, Mar 19, 2010 at 6:01 PM, Jason Pruim wrote: > > On Mar 18, 2010, at 1:26 PM, Andrew Ballard wrote: > >> On Thu, Mar 18, 2010 at 1:00 PM, Ashley Sheridan >> wrote: >> [snip] >>> >>> And I believe that when MS Office saves a CSV out with a char

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Andrew Ballard
On Fri, Mar 19, 2010 at 6:13 PM, Ashley Sheridan wrote: > > On Fri, 2010-03-19 at 18:01 -0400, Jason Pruim wrote: > > On Mar 18, 2010, at 1:26 PM, Andrew Ballard wrote: > > > On Thu, Mar 18, 2010 at 1:00 PM, Ashley Sheridan > > wrote: > > [snip] > >> And

Re: [PHP] Global Var Disappearing After Function

2010-03-22 Thread Andrew Ballard
led. > > What is causing this? And how can I fix it? > > Thanks! > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > I believe line 8 detaches the variable $Session that exists inside the function from the globa

Re: [PHP] MySQL query not working!

2010-03-31 Thread Andrew Ballard
uery) or die(mysql_error()); >> > header('location:http://www.qwitter-client.net/' . $_GET['file']); >> > } >> > else //it's the first time we're adding this file to the DB. >> > { >> > $query = "insert into " . $t

Re: [PHP] MySQL query not working!

2010-03-31 Thread Andrew Ballard
On Wed, Mar 31, 2010 at 9:08 AM, Andrew Ballard wrote: > Nope. All it does is suppress the error message. Just try it: > > > @mysql_connect('localhost', 'baduser', 'badpassword') or die('Could > not connect'); > > ?> > >

Re: [PHP] Sort two coupled arrays

2010-04-07 Thread Andrew Ballard
dless of whether they are numeric or strings. '75', 2 => '31', 3 => '31', 4 => '31', 5 => '40', ); $b = array ( 1 => 'Personal Email', 2 => 'Personal Phone', 3 => 'Web site', 4 =

Re: [PHP] Sort two coupled arrays {my solution]

2010-04-08 Thread Andrew Ballard
; [snip] > > rsort(array_combine(array2, array1)); > > you should expect array( > 'Personal Email' => 75, > 'USPS mail' => 40, > 'Personal Phone' => 31, > 'Web site' => 31, > 'Text Message' => 31 > ) > > logically, the items are your key but not the count of votes > That's the ticket. The solution is pretty simple now that we understand the nature of the problem. :-) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Sort two coupled arrays {my solution]

2010-04-08 Thread Andrew Ballard
On Thu, Apr 8, 2010 at 9:55 AM, tedd wrote: > At 8:28 AM -0400 4/8/10, Andrew Ballard wrote: >> >> On Wed, Apr 7, 2010 at 6:46 PM, Ryan Sun wrote: >> >>  > >>> >>>  rsort(array_combine(array2, array1)); >>> >>>  you should

Re: [PHP] 404 redirects "stolen" by provider

2010-04-09 Thread Andrew Ballard
y to add a message to your not-found page for those people recommending a different provider that doesn't hijack requests for missing content to another site. :-) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

<    5   6   7   8   9   10   11   12   13   14   >