Re: [PHP] COM - Assigning to method.

2013-07-15 Thread Andrew Ballard
On Mon, Jul 15, 2013 at 4:21 AM, Adam Nicholls wrote: > Hi Andrew > > Thanks for this. > > But I'm still getting errors. I think I need to explain a bit more. > > Unfortunately there isn't a PHP API for this application I'm trying to > interact with, my goal

Re: [PHP] COM - Assigning to method.

2013-07-14 Thread Andrew Ballard
On Sun, Jul 14, 2013 at 3:18 PM, Adam Nicholls wrote: > > Richard - I've tried that I get an error about it not being defined as > property of the object. > > Andrew - do you mean try using the method Richard has shown? > > Cheers > Adam. > > On 13 July

Re: [PHP] COM - Assigning to method.

2013-07-12 Thread Andrew Ballard
he $Record object. > $_R = &$Record->Fields('BANK_fld_ACCOUNT_NAME'); > $_R = 'Test Account'; > > > Any ideas? Is it possible? > > > Many Thanks > Adam Nicholls > That example isn't assigning values to method return value. Fields is a collection of ADO Field objects. The default property of a Field object is its Value property, so the shorthand is simply assigning the values of the variables to the value of each field in a record within a Recordset. Andrew

Re: [PHP] Webpage Persistence Load balancing

2013-05-29 Thread Andrew Ballard
P ignore_user_abort(true); etc. > > Is there anything I can do to fix this or is it a server issue that you must fix? > > Thanks, Al. > Are you using sessions for persistence? If so, is your session storage in a location that is shared between servers behind the load balancer? (Shared network path, database, etc.) Andrew

Re: [PHP] Saving session to database

2013-05-17 Thread Andrew Ballard
I've found database session storage requires extra diligence in error handling. When I see that error at 0 it is usually because something blew up either before the session handler was ready or after it was torn down. Andrew On May 17, 2013 2:42 PM, "Matijn Woudt" wrote: > On

Re: [PHP] array_map() with multiple callback functions

2013-05-08 Thread Andrew Ballard
));}, > $passedData); I'd go with this general approach, whether you use a named function or an anonymous function for the callback. I don't know how large the array is, but option #1 iterates the input array twice and option #2 iterates the array three times. If you eventually need to a

Re: [PHP] Load testing an app

2013-04-24 Thread Andrew Ballard
On Apr 24, 2013 9:46 PM, "tamouse mailing lists" wrote: > > On Tue, Apr 23, 2013 at 8:04 AM, Andrew Ballard wrote: > > On Tue, Apr 23, 2013 at 2:29 AM, Adam Richardson wrote: > >> On Mon, Apr 22, 2013 at 10:41 PM, Andrew Ballard wrote: > >>> The ot

Re: [PHP] Load testing an app

2013-04-23 Thread Andrew Ballard
On Tue, Apr 23, 2013 at 2:29 AM, Adam Richardson wrote: > > On Mon, Apr 22, 2013 at 10:41 PM, Andrew Ballard wrote: >> >> The other developer in our office spent some time profiling the site with >> xdebug and found that an exec() call to netsh used on a couple pages seem

[PHP] Load testing an app

2013-04-22 Thread Andrew Ballard
dows server, and the database is SQL Server 2008 (previously 2000). So, any ideas we can try? Andrew

Re: [PHP] Looking for complete entered URL

2013-04-21 Thread Andrew Ballard
Correct. Just to expand on that, a browser will not send the hash fragment part of a URL with the request. If you ever receive that part at the web server, that's a pretty good sign the request came from a robot. Andrew On Apr 21, 2013 3:29 AM, "Ashley Sheridan" wrote: > &

Re: [PHP] variable type - conversion/checking

2013-03-16 Thread Andrew Ballard
On Sat, Mar 16, 2013 at 12:21 PM, Ashley Sheridan wrote: > > On Sat, 2013-03-16 at 11:46 -0400, Andrew Ballard wrote: > > On Mar 16, 2013 6:14 AM, "Ashley Sheridan" wrote: > > > > On Fri, 2013-03-15 at 22:32 -0400, Andrew Ballard wrote: > >> > >

Re: [PHP] variable type - conversion/checking

2013-03-16 Thread Andrew Ballard
On Mar 16, 2013 6:14 AM, "Ashley Sheridan" wrote: > > On Fri, 2013-03-15 at 22:32 -0400, Andrew Ballard wrote: >> >> > Guess regex are the only useful solution here. When you consider to use >> > built-in functions, just remember, that for example '0x

Re: [PHP] variable type - conversion/checking

2013-03-15 Thread Andrew Ballard
sting to int. (Again, not in front of a computer where I can test it right now. ) Regexes have problems with more than 9 digits for 32-bit ints. I guess to some degree it depends on how likely you are to experience values that large. Andrew

Re: [PHP] variable type - conversion/checking

2013-03-15 Thread Andrew Ballard
On Mar 15, 2013 9:54 PM, "Sebastian Krebs" wrote: > > 2013/3/16 Andrew Ballard >> >> I suppose one could try something like this: >> >> if (is_string($val) && $val === (string)(int)$val) >> >> If $val is an integer masquerading a

Re: [PHP] variable type - conversion/checking

2013-03-15 Thread Andrew Ballard
I suppose one could try something like this: if (is_string($val) && $val === (string)(int)$val) If $val is an integer masquerading as a string, it should be identical to the original string when cast back to a string, shouldn't it? (I can't try it right now.) Andrew

Re: [PHP] Re: Switch - Case Statement Questions

2012-11-19 Thread Andrew Ballard
On Sat, Nov 17, 2012 at 4:13 PM, Sebastian Krebs wrote: > 2012/11/17 Andrew Ballard > >> On Nov 16, 2012 10:24 PM, "tamouse mailing lists" >> wrote: >> > >> > On Fri, Nov 16, 2012 at 12:41 PM, Sebastian Krebs >> wrote: >> > &g

Re: [PHP] Re: Switch - Case Statement Questions

2012-11-17 Thread Andrew Ballard
in the future that doesn't fit the clever solution? Without knowing the intent of the code, it could be a headache to maintain. Just my 2 cents. Andrew

Re: [PHP] Session data lost in Firefox

2012-10-26 Thread Andrew Ballard
the simplest solution that's not even related > directly to the programming. Thanks, Andrew for the prompting! > However if this happened on a punter's computer the same would happen - so > is there a way of coding the removal of third party cookies to avoid this > problem? >

Re: [PHP] Session data lost in Firefox

2012-10-26 Thread Andrew Ballard
webpage3 > > -- > Johniboy > Just a thought - does this depend on using third party cookies between your site and PayPal? If so, do you have them disabled in Firefox? Andrew

RE: [PHP] MS SQL server connection problem.

2012-09-05 Thread Andrew Ballard
led and use the SQL for PHP driver that matches your PHP installation. (Threaded, non-threaded, etc.) Andrew

Re: [PHP] Help with MSSQL and Stored Procs

2012-08-29 Thread Andrew Ballard
ng out to find something that had php_mssql installed on it, but once I got everything set up it everything worked fine for me. I tested it with everything correct as well as with a variety of forced errors (procedure doesn't exist, user does not have permission to execute, parameter name different

Re: [PHP] MSSQL Stored Proc

2012-08-28 Thread Andrew Ballard
mssql_connect(). The second parameter should be the username, not the database. To select a specific database, you use mssql_select_db() after mssql_connect() returns a valid resource. However, if you have the choice, you really should switch to the SQL Server driver for PHP developed by Microsoft. The mssql library has been phased out. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Cost of redirect and site domain switch? Good Practice/ Bad Practice / Terrible Practice

2012-08-19 Thread Andrew Ballard
his example: /relative/URI/with/absolute/path/to/resource.txt The most authoritative resource I found was from the IETF (RFC 3986). Section 4.3, as I understand it, says that an absolute URI includes the scheme part (e.g. http, ftp, tel, mailto), which would imply that your middle example is NOT an absolute path. http://tools.ietf.org/html/rfc3986#section-4.3 Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP session variables

2012-08-15 Thread Andrew Ballard
on_start() in the second loop. To be absolutely correct, you'd have to remove those echo statements I added for debugging, store all of your timings in separate variables and then output them at the end of the script. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP session variables

2012-08-15 Thread Andrew Ballard
for($i=1; $i < 1000; $i++) { if (session_id() ==='') { echo __LINE__, '::session_start()'; session_start(); } } $endtime = microtime(true); $totaltime = $endtime - $starttime; $totaltime = round($totaltime,5); echo "Second in $totaltime seconds."; session_destroy(); ?> Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Two ways to obtain an object property

2012-08-15 Thread Andrew Ballard
nction call either way though. The advantage I see to both of these method-based approaches versus exposing the property as public is that these methods prevent code outside your class from doing something stupid: isASubscriber = 'rutabaga'; // Fatal error: Cannot access private property User::$isASubscriber ?> (Yes, I have seen proof that it is TECHNICALLY possible to get around this in PHP, for example with unserialize.) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Creating drop-down menus

2012-07-17 Thread Andrew Ballard
to learn how to handle the resources correctly yourself, but the libraries like jQuery and YUI that are available do it for you and seem to eliminate most of the leaks that I've seen. YMMV. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Unexpected Notice message

2012-07-05 Thread Andrew Ballard
to reference a constant named QUERY_STRING that does not exist. The code will work because PHP will assume you meant to use a string instead of a constant, but this will also generate a notice to let you know that the code should be fixed. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Simple XML, (x)html, and xpath

2012-05-25 Thread Andrew Ballard
[namespace-uri()='http://www.w3.org/1999/xhtml' and local-name()='title'] (I'm not sure of the exact syntax since I don't have something open right now that I can test it in. However, I think SimpleXML has some features that make this easier. Take a look at this: http://www.php.net/manual/en/simplexmlelement.registerxpathnamespace.php Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Sunset/Sunrise

2012-03-20 Thread Andrew Ballard
t; > tedd That's the spirit! Truly world-class education! Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Sunset/Sunrise

2012-03-20 Thread Andrew Ballard
orrect longitude. Did you want a location in northern China (as you entered above) or near Dansville, MI (in which case I believe your longitude above should be negative rather than positive)? http://maps.google.com/maps?q=42.57,84.3320&hl=en&sll=42.57,-84.332&sspn=0.023008,0.038581&

Re: [PHP] fgetcsv doesn't return an array?

2012-03-15 Thread Andrew Ballard
s FALSE on >> errors, including End Of File. >> >> [/snip] > > I am using it in a loop. End Of File is an error? Yes. "fgetcsv() returns NULL if an invalid handle is supplied or FALSE on other errors, including end of file." I usually use it in a while loop like this: Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Fwd: [PHP] Function mktime() documentation question

2012-03-09 Thread Andrew Ballard
And again to the list, since for some reason "Reply-to-all" did not do as intended this time. -- Forwarded message ------ From: Andrew Ballard Date: Fri, Mar 9, 2012 at 12:53 PM Subject: Re: [PHP] Function mktime() documentation question To: Tedd Sperling On Fri, Mar

RE: [PHP] debugging PHP memory corruption

2012-01-05 Thread Andrew Morum
>Hi Andy, >Have you tried running it with valgrind? (See [1] for tips). >Otherwise, you might have more luck at php-internals mailing list, >since it is related to PHP development if you intend to fix either PHP >or the plugin. > >Matijn >[1] https://bugs.php.net/bugs-getting-valgrind-log.php Than

[PHP] debugging PHP memory corruption

2012-01-04 Thread Andrew Morum
We've got a problem with PHP 5.3.8 and a third party (open source) library (WSo2 SOAP). At some point during the request to the PHP script, some structures seem to be getting corrupted causing PHP to crash. Depending on the code in the PHP script, it's either crashing during in a print_r/var_

[PHP] Namespaced code with SabreDAV

2011-10-06 Thread Andrew Mason
self has a large amount of other PHP classes which it calls which obviously aren't prefixed with '\' Is there a way i can tell PHP any class name that get's instanciated with 'Sabre_' should resolve to '\Sabre' ? Many thanks Andrew -- PHP General Mailin

Re: [PHP] innerHTML triple quotes issue

2011-09-15 Thread Andrew Ballard
pg"; />'" onmouseout="this.innerHTML='an angel'" > an angel So then I tried a mixed approach and it seems to work in all of them: http://imagecache2.allposters.com/images/PF_New/102008/3070943.jpg"; />'" onmouseout="this.innerHTML='an angel'" > an angel YMMV Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Secure vs httpOnly cookie flag: is one better?

2011-08-16 Thread Andrew Ballard
1548332245&w=2 -- you can easily extend the technique to set both flags. header('Set-Cookie: cookie_name=value; secure; HttpOnly'); Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: Fwd: [PHP] Keeping session info in $_SESSION or in database?

2011-08-15 Thread Andrew Ballard
t; client. I know Gmail has both these options, and the client I use > (Evolution) does and is available for a variety of different platforms. > I don't see a Reply-to-List in Gmail, and haven't seen it any any of the other mail clients I have used either. Reply-All is a pretty standa

Re: [PHP] Problem with inserting numbers...

2011-08-11 Thread Andrew Ballard
ble 4 times to load into a table called numbers. SELECT CONVERT(char(1), Thousands.n) + CONVERT(char(1), Hundreds.n) + CONVERT(char(1), Tens.n) + CONVERT(char(1), Ones.n) AS Number INTONumbers FROMDigits AS Thousands, Digits AS Hundreds, Digits AS Tens, Digits AS Ones ORDER BY Thousands.n, Hundreds.n, Tens.n, Ones.n SELECT * FROMNumbers -- Drop the temporary digits table DROP TABLE Digits Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Struggling with MySQL query

2011-08-09 Thread Andrew Ballard
data rather than text) the condition 'My Article Title' LIKE '%article%' would return a match even though the case is different. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Security: Best Practices

2011-08-08 Thread Andrew Ballard
round for versions before that, I found this pretty quickly through Google: http://stackoverflow.com/questions/36877/how-do-you-set-up-use-httponly-cookies-in-php Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Complex (or not so) array data form submission?

2011-08-04 Thread Andrew Ballard
meric index means that PHP will depend on the order that the browser sends the values, but they are generally sent in the order they appear on the form. If the numeric index is important, it's better to provide it explicitly. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Complex (or not so) array data form submission?

2011-08-04 Thread Andrew Ballard
7;...', >        'address2' => '...', >        'city'          => '...', >        'state'        => '...', >        'zip'           => '...' >    ) > ); > > For some reason I c

Re: [PHP] How to install pecl_http into a web hosting service

2011-07-25 Thread Andrew Ballard
ity) for stating that one *should* use cURL (as opposed to something else like HTTP). Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] static variables inside static methods

2011-07-06 Thread Andrew Williams
I think you are confusing scope visibility level of the variable within method and the class. Variable within the method is going to 1 because it was declare within the test method and there no link to the one declared outside the test method. The second case is referencing the varible of the cl

Re: [PHP] Re: Date validation

2011-05-23 Thread Andrew Ballard
ut on the server regardless of anything you are doing to make things easier in the client. There are ways around using date selectors. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP intreprets trailing slashes incorrectly?

2011-05-20 Thread Andrew Ballard
ly by the user agent, regardless of the URI scheme. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Is 5.3.5 really that much slower than 5.2?

2011-03-06 Thread Andrew Mason
> Is anyone else out there in the same boat? Actually we have found the complete opposite so there might be some people who are in the same boat as you but certainly not all. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Disk IO performance

2010-11-28 Thread Andrew Mason
ches are such a bit > performance boost.  The corollary to that, of course, is that more files = > more IO and therefore more of a performance hit. I'd just organise them how you think makes most sense and then optimize if you run into issues. Kind regards Andrew M -- PHP General Mailing

Re: [PHP] Implementing optional methods in a concrete class, but calling them from an abstract class.

2010-11-01 Thread Andrew Ballard
ss. Right up to here, it sounded more like an interface than an abstract base class. > The concrete class doesn't have to implement handlers for all of the > commands, though, at a minimum, onStart() would be pretty much > essential. [snip] And then it didn't. :-/ And

Re: [PHP] Sessions only work in SSL

2010-10-19 Thread Andrew Ballard
)) { >  echo '' . $_SESSION['name']; >  session_destroy(); > } else { >  echo 'No session found'; >  $_SESSION['name'] = 'My session'; > } > > phpinfo(); > ?> > > -- > PHP General Mailing List (http://

Re: [PHP] Formatting an ECHO statement.

2010-10-18 Thread Andrew Ballard
t any time without changing the HTML itself, just as you suggest. While the same is technically true of italic and bold, those tags by definition imply a specific way to render the content that they contain, which makes a real confusion in cases such as text. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] RegExp question: how to add a number?

2010-10-15 Thread Andrew Ballard
On Fri, Oct 15, 2010 at 11:07 AM, Richard Quadling wrote: > On 15 October 2010 15:45, Andrew Ballard wrote: >> On Fri, Oct 15, 2010 at 5:52 AM, Richard Quadling >> wrote: >>> On 15 October 2010 10:16, Ford, Mike wrote: >>>>> -Original Message-

Re: [PHP] RegExp question: how to add a number?

2010-10-15 Thread Andrew Ballard
gt;> I know there actually exists a way to do the numeral addition >>> ("Re[5]:", not "Re[4+1]:"). >>> How do I manage to do this? >> >> This looks like a job for the "e" modifier (see >> http://php.net/manual/en/reference.pcre.pattern.

Re: [PHP] Casting from parent class to child

2010-10-08 Thread Andrew Ballard
ing, and I assume it won't accept your format directly, > > unless you implement __toString I believe (not tested) > IMO, that would be a truly useful feature to add if you were extending DateTime anyway. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Which PHP 5.3 documentation generators have you found?

2010-09-30 Thread Andrew Mason
On Fri, Oct 1, 2010 at 6:44 AM, David Harkness wrote: > While we don't use any 5.3 specific features such as namespaces yet, we set > up our continuous integration system to use Doxygen. It runs significantly > faster than phpDocumentor, though we put zero effort into tuning either > system. > I

Re: [PHP] Database Administration

2010-09-24 Thread Andrew Ballard
ion to CREATE/ALTER anything. That would pretty well guarantee that the only objects created are the ones you intended. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Session Vars loaded from MSSQL Query drop, those loaded from MYSQL Query stick

2010-09-17 Thread Andrew Ballard
- > Output from empForm.php > --- > session_SSN = > session_CostCenter = > hidden_SSN = 60 (it is displaying my actual SSN) > hidden_CostCenter = 1604 > session_empFName = CHERYL > session_userLastName = sullivan > session_BadgeID = 401337 > I'm not sure if this is it or not, but what happens if you change these two lines: $_SESSION['SSN'] = $rs_emp_info->fields("emp_ssn"); $_SESSION['CostCenter'] = $rs_emp_info->fields("emp_costcenter"); to this: $_SESSION['SSN'] = (string) $rs_emp_info->fields("emp_ssn"); $_SESSION['CostCenter'] = (string) $rs_emp_info->fields("emp_costcenter"); My theory is that since you are using COM to query SQL Server, it is returning COM variants, and the actual value of $rs_emp_info->fields("emp_ssn") is not a scalar value - it's a COM variant of something like an ADODB.Field. The default property of that datatype is the object's value, so when you use print to write its value in the form, it is probably implicitly converting the object to its default property which is a string. However, when you assign it to $_SESSION['SSN'], it may be that it is assigned as a COM variant that cannot be correctly serialized in the session. By explicitly typecasting the value to a string when you assign it to the session, you'll get the value rather than its wrapper. For what it's worth, it is probably also worthwhile to plan at some point soon on changing from COM to a native PHP library to get data from SQL Server. Since you are already running on Windows, Microsoft's SQL Server Driver for PHP should be a great replacement for you. It returns values as the correct native PHP type rather than wrapped inside those COM variants. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Session Vars loaded from MSSQL Query drop, those loaded from MYSQL Query stick

2010-09-17 Thread Andrew Ballard
On Fri, Sep 17, 2010 at 8:13 AM, Cheryl Sullivan wrote: > Hi Andrew - I didn't mean to ignore your reply... > > Here is your earlier post - > > " The fact that you can echo the $_SESSION information on the same page and > they contain the correct values suggest t

Re: [PHP] Session Vars loaded from MSSQL Query drop, those loaded from MYSQL Query stick

2010-09-16 Thread Andrew Ballard
ly lose them on the next request after either a redirect or a manual form POST. If the values are getting into $_SESSION correctly within this page, your issue is not related to the database at all. Am I misunderstanding you? Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Session Vars loaded from MSSQL Query drop, those loaded from MYSQL Query stick

2010-09-16 Thread Andrew Ballard
n either > case, the $_SESSION vars populated from SQL Server ( the SSN and Cost > Center vars) are blank when I echo them on the destination page. The fact that you can echo the $_SESSION information on the same page and they contain the correct values suggest to me that the issue of MySQL/MSSQL is a red herring. I would look into things like the value for register_globals to make sure you don't have a global variable stepping on some of your session variables. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Adjusting Session Times

2010-09-14 Thread Andrew Ballard
the session table is less than the session lifetime (maximum duration of inactivity for that session). That way, each individual user could have his or her own session timeout period if needed. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Show text without converting to html

2010-09-09 Thread Andrew Ballard
On Thu, Sep 9, 2010 at 11:39 AM, Jack wrote: > -Original Message- > From: Andrew Ballard [mailto:aball...@gmail.com] > > > The only people for whom the value will be obscure will be the humans who > actually try to read the HTML source code itself. Neither web browsers

Re: [PHP] Show text without converting to html

2010-09-09 Thread Andrew Ballard
ddress'; echo htmlspecialchars($var); ?> The obfuscation doesn't buy you much, though. string(106) "mailto:y...@email.address?subject=&cc=&bcc=&body="; style="" class="" id="">y...@email.address" The only people for w

Re: [PHP] Re: Dear Lazy Web: Pseudo Randomisation Strategies on Listing Websites

2010-08-20 Thread Andrew Ballard
On Fri, Aug 20, 2010 at 10:19 AM, Colin Guthrie wrote: > The customer is always right -> in his own mind (even if not in his RIGHT > mind) <- after all! Corrected that for you. ;-) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Dear Lazy Web: Pseudo Randomisation Strategies on Listing Websites

2010-08-20 Thread Andrew Ballard
On Fri, Aug 20, 2010 at 9:31 AM, Colin Guthrie wrote: > 'Twas brillig, and Andrew Ballard at 20/08/10 14:24 did gyre and gimble: >> Would it work to return a list of some limited number of randomly >> ordered "featured" listings/items on the page, while leavi

Re: [PHP] Re: Dear Lazy Web: Pseudo Randomisation Strategies on Listing Websites

2010-08-20 Thread Andrew Ballard
d about page breaks (and SEO if that is a concern). You can still use any of the suggestions that have been discussed to determine how frequently the featured items list is reseeded to help make caching practical. Just a thought. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Can't read $_POST array

2010-08-18 Thread Andrew Mason
t;> To unsubscribe, visit: http://www.php.net/unsub.php >> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > Does what your posting contain any content like '<' '>' my guess is that you need to access the content using the filter_ functions. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Variable variables into an array.

2010-08-10 Thread Andrew Ballard
;m trying to map in nested data to >>> over 10 levels. >> >> For something like this, a string that looks like a nested array reference, >> you might need to involve eval for it to "derive" that nested array. >> > > I'm happy with that. > > It seems variable variables can produce variables that do not follow > the same naming limitations as normal variables. > It would seem so. If eval() works, can you rearrange the strings a little to make use of parse_str() and avoid the use of eval()? Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Quotes vs. Single Quote

2010-08-06 Thread Andrew Ballard
em: table.my_table, table.my_table th, table.my_table td { border: solid 1px black; } table.my_table table, table.my_table table th, table.my_table table td { border: none; } As is often the case with CSS,

Re: [PHP] Question about SQL and Graph nodel trees

2010-07-21 Thread Andrew Ballard
le provides much more detail.) I did, however, import a good chunk of an Active Directory tree (just users and groups, not the full list of attributes) into this pattern just to test the concept, and I found that in that case the size of the transitive closure table did not get out of hand.

Re: [PHP] Determining the similarity between a user supplied short piece of text (between 5 and 15 characters) and a list of similar length text items.

2010-07-19 Thread Andrew Ballard
red. That, and the fact that user-defined functions in SQL Server often have a performance penalty of their own. Just for kicks, you could try loading the values in that column into an array in PHP and then time iterating the array to calculate the Levenshtein distances for each value to see

Re: [PHP] access violation

2010-07-19 Thread Andrew Ballard
Microsoft SQL Server driver for PHP Cache: WinCache Since we settled on these items, things have been pretty stable. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] ldap_search filter filter?

2010-07-16 Thread Andrew Ballard
ong time no see, Richard. There are a couple ldap_escape() functions in the comments here. I don't know enough about ldap to know how robust they are. I have used one of them, but only on a few intranet sites where the probability of malicious activity is fairly low. http://www.php.net/manual/

Re: [PHP] XML parser

2010-07-13 Thread Andrew Ballard
array( > [0] => 'Paragraph 1' , > [n-1] => 'Paragraph N' > ) > ) ; > > maybe simple other. Which pear class i can use for this task ? > > > Why PEAR? That looks almost exactly like SimpleXML. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MSSQL failing.

2010-07-09 Thread Andrew Ballard
ere as well. I left the host and port out of my freetds.conf file, though. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MSSQL failing.

2010-07-08 Thread Andrew Ballard
Server Driver for PHP (if you are running PHP under Windows, I'd strongly recommend this over the old mssql library anyway), but this worked: Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mail() + localhost

2010-07-01 Thread Andrew Ballard
gt; (ii) C:\Program Files\EasyPHP 3.0\conf_files Call this in a script running under your web server: http://www.php.net/phpinfo Alternatively, you could also look at these: http://www.php.net/php-ini-loaded-file http://www.php.net/php-ini-scanned-files Andrew -- PHP General Mailing List

Re: [PHP] file_get_contents limit

2010-06-29 Thread Andrew Ballard
On Tue, Jun 29, 2010 at 4:39 PM, Ashley Sheridan wrote: > > On Tue, 2010-06-29 at 16:37 -0400, Andrew Ballard wrote: > > > On Tue, Jun 29, 2010 at 4:21 PM, Ashley Sheridan > > wrote: > > > > > > Have you looked at the memory settings in php.ini? > >

Re: [PHP] file_get_contents limit

2010-06-29 Thread Andrew Ballard
>> > converted the wrong ones? >> > >> > Thanks, >> > Ash >> > http://www.ashleysheridan.co.uk >> > >> > >> > >> >> >> > > Have you looked at the memory settings in php.ini? > > Thanks, > Ash >

Re: [PHP] PHP & QPay

2010-06-29 Thread Andrew Ballard
e as well, for any of the links at the top of the page. I also got 404 responses to the link that Richard posted, until after viewing the root index page. Strange. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mysql case statement

2010-06-28 Thread Andrew Ballard
value "hiddenpanel" using an if (...) test as you suggeted. However, given that the OP stated he "would like to select hiddenpanel only if there is a corresponding value in DB_HIDDENPANELS," the INNER JOIN will do that at the database query level, so an if (...) then test in PH

Re: [PHP] Attachment to email from form.

2010-06-28 Thread Andrew Ballard
On Mon, Jun 28, 2010 at 10:04 AM, Ashley Sheridan wrote: > > On Mon, 2010-06-28 at 09:58 -0400, Andrew Ballard wrote: > > On Mon, Jun 28, 2010 at 8:53 AM, Richard Quadling wrote: > > On 28 June 2010 13:44, Brandon Rampersad wrote: > >> f**k no > > > > E

Re: [PHP] Attachment to email from form.

2010-06-28 Thread Andrew Ballard
On Mon, Jun 28, 2010 at 8:53 AM, Richard Quadling wrote: > On 28 June 2010 13:44, Brandon Rampersad wrote: >> f**k no > > Enlightened criticism aside, why not? Or rather (as I'm willing to adapt) how? Probably because you ignored his latest request to chat. Just guess

Re: [PHP] mysql case statement

2010-06-28 Thread Andrew Ballard
ows from the RIGHT table that happen do match. If you only want rows that exist in both tables, change the join from LEFT (OUTER) JOIN to INNER JOIN. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Returning a Recordset from a Funtion

2010-06-25 Thread Andrew Ballard
t; > > Does anyone have any good ideas so I can access the recordset in the > calling page? > > > > Thanks! > > Is there a reason you need to work with COM/ADODB to get the information from SQL Server as opposed to one of the PHP libraries? If your are using COM you m

Re: [PHP] Making a Password Confirmation in PHP

2010-06-25 Thread Andrew Ballard
On Fri, Jun 25, 2010 at 5:35 AM, Richard Quadling wrote: > And the fact that a browser will transmit as > plain text isn't a security issue? That's what SSL is for. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] $_SERVER['REMOTE_ADDR'] and sql injection

2010-06-23 Thread Andrew Ballard
(10) UNSIGNED in MySQL, though I think I remember having issues with that type). $sql = sprintf('INSERT INTO `mytable` (`ip_address`) VALUES (%u)', ip2long($ip)); I do most of my development with SQL Server, so I often just pass the value as a 4-byte integer (or sometimes even in dotted no

Re: [PHP] $_SERVER['REMOTE_ADDR'] and sql injection

2010-06-23 Thread Andrew Ballard
On Wed, Jun 23, 2010 at 10:39 AM, Ashley Sheridan wrote: > > On Wed, 2010-06-23 at 10:35 -0400, Andrew Ballard wrote: > > On Wed, Jun 23, 2010 at 6:01 AM, Ashley Sheridan > wrote: > > That's what I'd use. You may also have to wrap it inside an abs() call > >

Re: [PHP] $_SERVER['REMOTE_ADDR'] and sql injection

2010-06-23 Thread Andrew Ballard
On Wed, Jun 23, 2010 at 6:01 AM, Ashley Sheridan wrote: > That's what I'd use. You may also have to wrap it inside an abs() call > to ensure it's a positive number, as some IP addresses equate to > negative with ip2long(). NO NO NO NO NO Andrew -- PHP Ge

Re: [PHP] curl help or other suggestion

2010-06-17 Thread Andrew Ballard
og completed versus abandoned requests, this might help: http://www.php.net/manual/en/function.ignore-user-abort.php Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] SQL Syntax

2010-06-16 Thread Andrew Ballard
covered. What's more, there is no simple way (if any way at all) for your design to prevent an image from having a mime-type of 20174 or a size of 'jpg'. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] DOMDocument::loadXML() failed when parsing comments inside a script tag

2010-06-08 Thread Andrew Ballard
/ <![CDATA[ var i = 0, html = "<strong>Bold Text</strong>,Normal Text"; document.write(html); i--; // this line causes the parser to fail alert(html); // ]]> '; $dom = new DOMDocument(); $dom

Re: [PHP] DOMDocument::loadXML() failed when parsing comments inside a script tag

2010-06-07 Thread Andrew Ballard
On Mon, Jun 7, 2010 at 3:30 PM, Raymond Irving wrote: > Hi Adam, > > Thanks for the update but I'm thinking that it would be much easier if the > DOM parser could just ignore the contents of the

Re: [PHP] opening a link in a new window

2010-05-14 Thread Andrew Ballard
>> On Fri, May 14, 2010 at 8:59 AM, Andrew Ballard wrote: >> >> > This also has the side effect that the decision of whether to open a >> > link in the current window or a new window/tab belongs to the viewer >> > instead of the author, whic

Re: [PHP] Append Dom Document

2010-05-14 Thread Andrew Ballard
gt;childNodes->item(0)->nodeValue; $item_desc=$x->item($i)->getElementsByTagName('description') ->item(0)->childNodes->item(0)->nodeValue; echo ("" . $item_title . ""); echo (""); echo ($item_desc . ""); } } ?> Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Multiple Login in a single PC should not be possible

2010-05-14 Thread Andrew Ballard
ing inactive) any rows for the same identity whose session_id does not match the current session_id. That ensures that users can have no more than one active session at a time. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Append Dom Document

2010-05-14 Thread Andrew Ballard
would need to use importNode() instead of appendChild(). Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Append Dom Document

2010-05-14 Thread Andrew Ballard
object is fairly cheap compared to the rest of the actions in your loop, so I doubt you'll save much. As for your original question, if you really need to append multiple XML documents into a single document using DOM, you would need to create a DOMDocument outside the loop that contains your aggregator's information in the header and that will contain the aggregated items. Then inside your loop you would still load each feed into a separate DOMDocument instance just as you are now and import the nodes from the rss feed into your aggregated document. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

  1   2   3   4   5   6   7   8   9   10   >