Re: [PHP] PHP Hosting

2004-07-09 Thread Adam Voigt
mmendations are also greatly appreciated. http://www.spenix.com Very good prices, very good support. -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] php 4.3.7/5.0

2004-07-13 Thread Adam Bregenzer
alue 0. Also, note the following: var_dump(0 == "0"); //bool(true) var_dump(0 === "0");//bool(false) -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] problem with foreach

2007-10-22 Thread Adam Williams
I have an html page with checkboxes: Modern Mississippi Civil Rights MilitaryHistory and mailform2.php containing: echo "you selected: "; /* line 81 */ foreach ($_POST[option] as $a) { echo "$a"; } but I'm getting the error: you selected: *Warning*: Invalid argument

Re: [PHP] problem with foreach

2007-10-22 Thread Adam Williams
Robert Cummings wrote: On Mon, 2007-10-22 at 18:07 +0100, Stut wrote: Adam Williams wrote: I have an html page with checkboxes: Modern Mississippi Civil Rights MilitaryHistory and mailform2.php containing: echo "you selected: "; /* line 81 */ foreach ($_POST[opt

[PHP] parsing text for special characters

2007-11-29 Thread Adam Williams
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 used in mail($to, "MMH Suggestion", "$message", "$headers");

Re: [PHP] mysql DATE_FORMAT() question

2007-12-12 Thread Adam Williams
nevermind, I see I had a mistake in my mysql statement, I should of been: select DATE_FORMAT(testdate, '%m\-%d\-%Y') as date_column from testtable; please disregard. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] mysql DATE_FORMAT() question

2007-12-12 Thread Adam Williams
I ran the commands: CREATE TABLE testtable ( testdate DATETIME); INSERT INTO testtable (testdate) VALUES (now()); and then I want to select it but format it to show the date only (not the time, and yes I know I could use DATE instead of DATETIME, but there may be cases where I need to show th

[PHP] how to handle inserting special characters into a mysql field

2007-12-14 Thread Adam Williams
I'm going to be inserting data from a PHP form into a mysql field. The data could contain special characters like < > ' " \ /, etc. How do I handle that? just $data = addslashes(htmlspecialchars($data)); before the insert query? because later on the data will be read back from the mysql db

Re: [PHP] how to handle inserting special characters into a mysql field

2007-12-14 Thread Adam Williams
Thanks for all the replies everyone. I have a question on mysql_real_escape_string(). The PHP example page shows: $query = sprintf("SELECT * FROM users WHERE user='%s' AND password='%s'", mysql_real_escape_string($user), mysql_real_escape_string($password)); and I unders

[PHP] Wrong parameter count for imap_open()

2008-01-02 Thread Adam Williams
I'm running PHP 5.2.4 and getting the error: *Warning*: Wrong parameter count for imap_open() in */var/www/sites/intra-test/contract/login.php* on line *9 *My code is: $mbox = imap_open("\"{mail.mdah.state.ms.us/imap/novalidate-cert:143}INBOX\", \"".$_POST["username"]."\", \"".$_POST["passwor

[PHP] Fatal error: Function name must be a string

2008-01-02 Thread Adam Williams
I'm getting the following error and I don't see whats wrong with my line. Any ideas? *Fatal error*: Function name must be a string in */var/www/sites/intra-test/contract/perform.php* on line *57* and my snippet of code is: if ( $_POST["perform"] == "View Contracts" ) { $mysql

[PHP] mysql date question

2008-01-03 Thread Adam Williams
I have a field in mysql as shown by describe contract; | length_start | date| YES | | NULL || Which stores it in the mysql format of -MM-DD. However, I need the output of my select statement to show it in MM-DD- format. I can select i

[PHP] Re: mysql date question

2008-01-03 Thread Adam Williams
nevermind, figure it out, had to take the ' ' away from contract.length_start :) Adam Williams wrote: I have a field in mysql as shown by describe contract; | length_start | date| YES | | NULL || Which stores it in the mysql format

[PHP] handling ' with mysql/php insert and select

2008-01-03 Thread Adam Williams
In my form, I am parsing all the text inputs through mysql_real_escape_string() before inserting the data. however, when I look at the SQL query in PHP, when I type the word blah's to my text box variable, and then insert it into mysql after being ran through mysql_real_escape_string(), it doe

[PHP] checking user input of MM-DD-YYYY

2008-01-15 Thread Adam Williams
I'm having users enter dates in MM-DD- format. is there a way to check if what they have entered is invalid (like if they enter 1-15-2008 instead of 01-15-2008) ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] checking user input of MM-DD-YYYY

2008-01-15 Thread Adam Williams
Thanks, I think I have it: $dateexplode = explode("-", $_POST["date_entered"]); if (!preg_match("/^(\d{2})$/", $dateexplode[0],$data1) || !preg_match("/^(\d{2})$/", $dateexplode[1],$data2) || !preg_match("/^(\d{4})$/", $dateexplode[2],$data3)) { die ("you have entered an invalid dat

Re: [PHP] checking user input of MM-DD-YYYY

2008-01-15 Thread Adam Williams
Andrew Ballard wrote: Just curious why you won't take 1-15-2008. Once you validate it, you can always assign it to a variable as either a timestamp or a DateTime object and then format it however you want when you display it, send it to a database, or whatever you are doing with the date. FWIW

Re: [PHP] checking user input of MM-DD-YYYY

2008-01-15 Thread Adam Williams
Andrew Ballard wrote: All the more reason I would turn it into a timestamp or DateTime object in PHP first. That will prevent trying to insert something like what I used above. Then I would get rid of the MySQL STR_TO_DATE function in the $mysqli_insert_sql value just replace it with something li

Re: [PHP] New search related question

2008-02-05 Thread Adam Williams
http://search.mnogo.ru Jason Pruim wrote: Hi Everyone! :) Just a quick question, I've done some googling but haven't been able to find what I need... I am looking at doing a search function for someone's website, the website is just static HTML files, and she doesn't want to redo the entire

[PHP] PHP Errors to screen

2008-04-29 Thread Adam Gerson
Where do I change the setting to print PHP errors to the screen when running in a web browser? Thanks, Adam -- Adam Gerson Assistant Director of Technology Apple Certified System Administrator (ACSA) Columbia Grammar and Prep School phone. 212-749-6200 ex. 321 fax. 212-428-6806 [EMAIL

[PHP] Question on PHP 6 and static calls to instance methods.

2008-05-03 Thread Adam Richardson
Thank you very much for your time, Adam Adam Richardson Envision Internet Consulting, LLC Phone: (517)623-0485 Services and insight for building effective, user-oriented websites.

[PHP] Question on PHP 6 and static calls to instance methods.

2008-05-03 Thread Adam Richardson
se of that functionality in my framework. However, It sounds like this is going to cause a fatal error in PHP6. Is this in fact true? And, if the behavior is going to change, can somebody explain what the impetus for this change was? Thank you very much for your time, Adam Adam Richardso

Re: [PHP] php.ini

2008-05-09 Thread Adam Richardson
And, at some hosts you have to change the settings in htaccess as opposed to php.ini. On Fri, May 9, 2008 at 12:53 PM, André Medeiros <[EMAIL PROTECTED]> wrote: > I'm not sure PHP5 would read php.ini from that directory. > > You should take in account that your hosting company may _NOT_ allow > y

RE: [PHP] Re: Ignore Tags

2008-05-11 Thread Adam Richardson
I didn't check out your source, but in terms of a regex that only matches items not surrounded by some special tag, what about negative lookaheads and lookbehinds, like: (?http://www.regular-expressions.info/lookaround.html Adam -Original Message- From: Jorge Peña <[EMAIL P

Re: [PHP] Validating Form input

2008-05-14 Thread Adam Richardson
can progressively enhance pages with javascript quite easily. I'm pleased with this approach after using for it for a while now, and I recommend it to others. Adam On May 14, 2008, at 10:48 PM, Chris W wrote: I was wondering what others think of my approach to form validation. I k

Re: [PHP] Restricting access to a file

2008-05-27 Thread Adam Richardson
controller sets the headers, retrieves the file, and then outputs the file contents to the output stream. Otherwise, the controller redirects the visitor to a page that let's them know they don't have access, but prompts them to pay/sign up to get the access for the product. Adam

Re: [PHP] use of static methods after namespaces arrive

2008-05-28 Thread Adam Richardson
function. Most of the time, though, I'd probably start out with a class method instead of a namespaced function so I could more readily adapt to OOP practices if desired as the implementation evolves. Adam On Wed, May 28, 2008 at 11:33 AM, Iv Ray <[EMAIL PROTECTED]> wrote: > In w

[PHP] going from procedural style to object orientated style coding

2008-05-30 Thread Adam Williams
I was wondering if anyone knew of some books/tutorials/howto's, etc on going from procedural style coding to object orientated coding with PHP? I've been using PHP since version 3 and am used to the procedural style, but I'm noticing that PHP's trend is going to the object orientated style, bu

Re: [PHP] Method chaining off constructors

2008-06-06 Thread Adam Richardson
The 'new' keyword has to apply to the object created in the constructor (and not the return value of any of the follow-up calls.) To establish this precedence, chaining wasn't allowed on constructors. On Fri, Jun 6, 2008 at 11:04 AM, Eric Butera <[EMAIL PROTECTED]> wrote: > On Fri, Jun 6, 2008

Re: [PHP] Create .php file with php

2007-06-26 Thread Adam Schroeder
into usage within a high usage web app. =) Adam Daniel Brown wrote: On 6/26/07, Marius Toma <[EMAIL PROTECTED]> wrote: I can not believe how stupid I can be sometime. I was trying to create a file, but a file with the same name already existed on the server - and I did not have the

Re: [PHP] Create .php file with php [POC CODE INCLUDED]

2007-06-26 Thread Adam Schroeder
... if you really couldn't write it as dynamic PHP -- you could also save it in a database. Edward Vermillion wrote: On Jun 26, 2007, at 3:31 PM, Crayon Shin Chan wrote: On Wednesday 27 June 2007 03:53, Daniel Brown wrote: On 6/26/07, Al Rider <[EMAIL PROTECTED]> wrote: I think most sy

Re: [PHP] Removing Spaces from Array Values

2007-07-02 Thread Adam Schroeder
} http://us.php.net/manual/en/function.str-replace.php Adam kvigor wrote: Need to remove all spaces from Array Values... And this doesn't work. This is similar info that's within array values: $someArray[0] = "PHP is awesome";s/b PHPisawesome This is similar info that&

Re: [PHP] how PHP is batter?

2007-07-03 Thread Adam Schroeder
language. Theoretically, this would give ASP.NET an advantage as far as speed is concerned. Does anyone else have other evidence where ASP.NET has been shown to run faster? I don't think the benchmark I have given is very valid. Thanks, Adam Edward Vermillion wrote: On Jul 3, 2007, at 8:52

Re: [PHP] how PHP is batter?

2007-07-05 Thread Adam Schroeder
Crayon Shin Chan wrote: On Tuesday 03 July 2007 22:56, Stut wrote: I saw there is a free version of Studio, but I think it's for students... You cannot go build a corporate project with it I think... More FUD. Go read the licence before claiming to know what it says! Regardle

Re: [PHP] mail() returns false but e-mail is sent ?

2006-06-26 Thread Adam Zey
the return value of mail()? Trust me, we've all made stupid mistakes, they're nasty little buggers that can sneak in and ruin anyone's day; best to include it since it might be relevant. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Strip outgoing whitespace in html

2006-06-26 Thread Adam Zey
day. Definitely worth the enormous bandwidth savings! Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: PHP 5, Windows, and MySQL

2006-06-26 Thread Adam Zey
oblem, have you checked the PHP docs on how to install MySQL support for PHP5 on Windows? http://www.php.net/manual/en/ref.mysql.php Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: If statement question

2006-06-26 Thread Adam Zey
es. Alex. Stuff inside an if statement will be compiled (So it has to be free of syntax errors and such), but it won't be executed unless the condition is true. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: A variable inside a variable?

2006-06-26 Thread Adam Zey
associative arrays? As in, what is wrong with: $level[$buildingname] (I'm only guessing at the correct naming scheme) Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Preventing double-clicks APPEARS TO WORK FINE

2006-06-26 Thread Adam Zey
ewing page source or downloading files. The same would apply to any other security measure; it'd be just fine to use JavaScript to discourage multiple clicks, but it wouldn't solve the underlying problem; he'd still have to solve the problem on the backend. Regards, Adam.

[PHP] Re: modify xml before parse

2006-06-27 Thread Adam Zey
uot;;); I mean, that is what you asked, how to read the xml file... Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Calculations

2006-06-27 Thread Adam Zey
recognise ^ meaning 'to the power of'. Regards, Alex. ... The manual is your friend. Seriously, don't come here looking for all the answers before you checked the manual. I searched for "power", and the first result was the function you want. RTFM. Regards,

Re: [PHP] Calculations

2006-06-27 Thread Adam Zey
comes in handy. Can't say I've used the others recently. XOR is handy on occasion, but doesn't really need an operator. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: modify xml before parse

2006-06-28 Thread Adam Zey
weetat wrote: Hi Adam, Thank for your input. However search and replace the value such as to empty string ? Try the code below , no successful. $xmlfile = "/home/gvintranet/datacraft/htdocs/properties/test_cdata.xml"; $xml = file_get_contents($xmlfile); $xml = pr

Re: [PHP] serve long duration pages

2006-06-28 Thread Adam Zey
che, and by doing all my SELECT queries against a HEAP table (a MySQL table stored entirely in memory), while updates and inserts went to disk and then were mirrored back into the HEAP table. There are so many ways to optimize databases, it's insane. Regards, Adam. -- PHP General Ma

Re: [PHP] serve long duration pages

2006-06-28 Thread Adam Zey
to do the query asynchronously, though, since you'd need to output the tags while it was executing. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: modify xml before parse

2006-06-29 Thread Adam Zey
Yeo Wee Tat wrote: Hi Adam, I can modify the xml file without any error , however when I tried to unserializer the xml file using PEAR:XML , it gave the error message below. I have attached my code for your perusal. Any ideas ? thanks /", "", $xml); $filehandle = fope

[PHP] Re: creating a threaded message system--sorting messages

2006-06-29 Thread Adam Zey
noted that you'd need each post to have a sort of superparent field that stored the topmost parent so that you could do something simple like selecting ten superparents and all their children. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Update site through email

2006-06-29 Thread Adam Zey
r, it's an opensource app maintained by people at my workplace. Still, it's probably the fastest POP3 mail fetcher out there. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: creating a threaded message system--sorting messages

2006-06-29 Thread Adam Zey
uggest you start looking for a more sane method of doing this. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Find out cookies on a computer?

2006-06-29 Thread Adam Zey
ns on this list is, well, pretty dumb. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: creating a threaded message system--sorting messages

2006-06-30 Thread Adam Zey
uld easily go before a post with a lower ID based on where people replied. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: creating a threaded message system--sorting messages

2006-06-30 Thread Adam Zey
r) { You never change the work array, I think, so you can just keep referring back to the original. The second thing to do is to make the foreach work on references instead of copies. I actually think that since what we have in our function is now a reference, the foreach WILL NOT copy it.

Re: [PHP] Re: creating a threaded message system--sorting messages

2006-06-30 Thread Adam Zey
with the original array, so foreach has no chance to copy it. HOWEVER, if my above supposition about foreach not copying a reference is correct, you wouldn't need to do this. It's just a backup plan. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Update or add?

2006-06-30 Thread Adam Zey
compare boolean values. 0 is an integer, false is a boolean. Using === ensures that result is false, and that it is a boolean that is false. It compares the value AND the type. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Chnage Management in PHP aka version control?

2006-07-05 Thread Adam Zey
ail notification software. Free download at http://www.ePrompter.com. His message seemed to indicate that he wanted a version control application WRITTEN in PHP, not that supported PHP. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] GD to database directly

2006-07-11 Thread Adam Zey
sign or the client chooses they want them 450 instead of 400. =) Via MySQL 4.1 & PHP 5.1.4: erics:~ eric$ ab -n500 -c5 http://localhost/fs_vs_db/viewimage_db.php This is ApacheBench, Version 1.3d <$Revision: 1.73 $> apache-1.3 Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://

[PHP] Re: regular expression to extract from the middle of a string

2006-07-14 Thread Adam Zey
") - 3 ); My offsets might be a bit off there, I always get confused with them and have to verify by running the code in case I mixed up a zero-based character position or something :P Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Recurs Directory Delete

2006-07-14 Thread Adam Zey
So? Windows has this thing called the "del" command that does the same thing as "rm". Regards, Adam. Mark Steudel wrote: I wish, I'm on an IIS box. Mark -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Friday, July 14, 2006 2:09 PM

Re: Fwd: [PHP] Recurs Directory Delete

2006-07-14 Thread Adam Zey
in older versions of DOS). You still have to manually (or programmatically) iterate through the directory structure and run 'del *.*' and then 'rd directory' in every single subdirectory to achieve the same result that the single command 'rm -rf' gives you on UNIX-like s

[PHP] Re: headers and newline at end of script

2006-07-20 Thread Adam Zey
Martin Marques wrote: > Now, my question is: Is it a bad practice to "NOT" close the script with the PHP closing "?>"? I mean, just leave the script without a closing PHP simbols, as this scripts are included? Yes. Regards, Adam. -- PHP General Mailing Lis

Re: [PHP] Re: headers and newline at end of script

2006-07-20 Thread Adam Zey
Jochem Maas wrote: Robert Cummings wrote: On Thu, 2006-07-20 at 14:15, Martin Marques wrote: On Thu, 20 Jul 2006 13:06:10 -0400, Robert Cummings <[EMAIL PROTECTED]> wrote: On Thu, 2006-07-20 at 12:12, Adam Zey wrote: Martin Marques wrote: > Now, my questi

Re: [PHP] Re: headers and newline at end of script

2006-07-20 Thread Adam Zey
Martin Marques wrote: On Thu, 20 Jul 2006, Adam Zey wrote: Jochem Maas wrote: Robert Cummings wrote: I don't understand - the links point to posts by Rasmus saying that's 'beneficial' - seems to me to be a fairly robust endorsement yet you consider leaving off trailing

[PHP] Re: Bug in == comparison?

2006-07-21 Thread Adam Zey
ompared as integers. These rules also apply to the switch statement." In your case, it's a bug in your code; you should be using === to also verify type, or casting $var1 to a string in your comparison. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Bug in == comparison?

2006-07-21 Thread Adam Zey
empty() function: http://www.php.net/manual/en/function.empty.php It can do exactly what you want. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Bug in == comparison?

2006-07-21 Thread Adam Zey
. [EMAIL PROTECTED] email 519.745.7374 x103 office 519.897.2552 mobile ~~ Get Mozilla Firefox at http://spreadfirefox.com On 21-Jul-06, at 12:45 PM, Adam Zey wrote: Jeffrey Sambells wrote: OK I have a very strange bug: In the middle of my script I have these two

Re: [PHP] Cleaning bad characters from var

2006-07-21 Thread Adam Zey
tion replaceChars($string) { $find_array = array("a", "b", "c"); $replace_array = array("apple", "banana", "carambola"); return str_replace($find_array, $replace_array, $string); } You can, of course, throw other string

[PHP] Re: Comparing Strings

2006-07-24 Thread Adam Zey
27;s interpreting something as a number somewhere. Did you try using === instead of == for your comparisons? Regards, Adam Zey. PS: Why is your license key so insanely long, and why doesn't it use alphanumeric characters to reduce the length? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Stripping weird characters again...

2006-07-24 Thread Adam Zey
ge this from my feed? Thank you, Paul Nowosielski Webmaster You want str_replace with arrays as parameters. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: SQL Result Set -> HTML Table Fragment (but Simple)

2006-07-24 Thread Adam Zey
Essentially what it does is, loop over each row, and if we're the first row, write out the headers, and for all rows, write out each field. I haven't tested this, just typed it up from memory now, so I'm not sure if it'll compile. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: SQL Result Set -> HTML Table Fragment (but Simple)

2006-07-24 Thread Adam Zey
Adam Zey wrote: Michael B Allen wrote: Anyone have a PHP fragment that just prints a very simple html table from the contents of a db result set? I don't want phpmyadmin or anything remotely that complex. I want something that simply extracts the header info and prints a basic HTML tabl

Re: [PHP] Return Values Copied? Copied if By Reference?

2006-07-27 Thread Adam Zey
he foreach situation, the preferred solution when memory is a problem is to either use a reference, or have foreach iterate over the keys of the array. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Return Values Copied? Copied if By Reference?

2006-07-27 Thread Adam Zey
things. In the foreach situation, the preferred solution when memory is a problem is to either use a reference, or have foreach iterate over the keys of the array. Regards, Adam. - PHP doesn't seem to make a real copy of data until one of the copies is modified, making it necessary to c

[PHP] Re: memory leak - how to find it?

2006-08-01 Thread Adam Zey
mory_usage() at various points in your script to see where it's being used up. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: non blocking fsockopen

2006-08-01 Thread Adam Zey
socket plugins for PHP4, which should allow similar flexibility to stream_socket_client()? The downside is you'll need the socket module enabled/compiled. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Frameworks - Opinion

2006-08-01 Thread Adam Zey
ork. It's a PHP IDE. Zend has multiple products. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: date(n/Y) strtotime

2006-08-02 Thread Adam Zey
easier to read. All these examples assume that your date is in a fixed format, namely mm/. However, the last three should properly handle 09/2006, because they won't add a second zero to that. So that should work either way. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] date(n/Y) strtotime

2006-08-02 Thread Adam Zey
expDate2str('1/2009'); expDate2str( date( "n/Y")); ?> Which when I run it (in PHP 4 though) prints out this: Invalid, blowing up date In: 1/2009 Out: 2009-01-01 Invalid, blowing up date In: 8/2006 Out: 2006-08-01 For the heck of it, here's a more production-oriented version of the function/test script: return date("Y-m-d", strtotime(str_replace("/", "/01/", strlen($date) == 6 ? "0$date" : $date))); else return date("Y-m-d", $date); } echo expDate2str('1/2009'); echo ""; echo expDate2str( date( "n/Y")); ?> Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] date(n/Y) strtotime

2006-08-02 Thread Adam Zey
Actually, I made a mistake in my latest reply. I said "The problem with your comparison is that strtotime thinks the date is invalid, but misinterprets it." I actually mean, it thinks it is VALID, but misinterprets it. Regards, Adam. Mark Steudel wrote: Thanks Adam, I had s

Re: [PHP] POST on redirects?

2006-08-03 Thread Adam Zey
uot; . strlen($message) . "\r\n"; $headers .= "\r\n"; return $headers . $message; } As far as I can tell, these are the absolute minimum set of headers you can get away with for a POST transaction (If you know how to use less, let me know, I use this in a situ

Re: [PHP] convert byte to MB

2006-08-03 Thread Adam Zey
Porpoise wrote: "Austin Denyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] What's with the blank messages?? His message wasn't blank, he sent this: Andrei wrote: > > So what u'r trying to say is that we should use KiB and not KB for > > kilobytes? That's funny!

[PHP] Re: Regular Expresson for checking password strength

2006-08-04 Thread Adam Zey
in the if. I'm not certain how fast strlen is, but it's usually a bad idea to repeat useless function calls like that. 2) Isn't your second function call supposed to be preg_match, and not pre_match? Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: The difference between ereg and preg?

2006-08-04 Thread Adam Zey
work for the command above, but preg not? Thank you for any advice. -- Dave M G Everybody missed one important difference. The PCRE module is compiled into PHP by default. The POSIX module is not included by default. Therefore it's not safe to use the POSIX regular expression module if

Re: [PHP] php behind firewall

2006-08-04 Thread Adam Zey
ortable with. Also while your DNA comment was meant to be humorous, it's not a bad idea to build a "trust-index" via user actions that would be similar to a DNA-like reasoning solution. Just food for thought. tedd Either account-based authentication, or a unique ID stored in a

Re: [PHP] POST on redirects?

2006-08-07 Thread Adam Zey
Chris Shiflett wrote: Adam Zey wrote: $headers .= "Content-Type: application/octet-stream\r\n"; I missed the context of this function, but it seems like you probably mean to send: Content-Type: application/x-www-form-urlencoded Chris The context is a bit strange,

[PHP] Re: Declaring variables from the url

2006-08-07 Thread Adam Zey
OST['var'] This is much safer. If you REALLY want to turn on register_globals (And I strongly recommend against it, it's a huge risk), information on how to do this can be found in the PHP manual. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: php/ajax..

2006-08-07 Thread Adam Zey
. Such things need to be done on the client side, at which point they're usually called AJAX. PHP can be used for the server-side of an AJAX application. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Regular expression to find from start of string to first space

2006-08-08 Thread Adam Zey
ons are a lot slower. Your problem could easily be solved with something like this: $firstWord = substr($word, 0, strpos($word, " ")); I think I've got that right, I'm always forgetting if I need to add or subtract something from the length parameter :P Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Multiple Includes vs. One Long Include (Functions)

2006-08-08 Thread Adam Zey
hing cached in memory anyhow, so if you're using an opcode cache that wouldn't matter either. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Strip non-alphanumerics from beginning and end?

2006-08-08 Thread Adam Zey
in the top pane. It makes writing regular expressions enormously easier. It uses LISP to emulate Perl's regular expressions (PHP in turn uses "Perl Compatible Regular Expressions"), so sometimes it doesn't translate a hundred percent, but it's still an enormous help

Re: [PHP] List Meeting NNOT

2006-08-10 Thread Adam Zey
till a bit of a drive when you live in Montreal and don't have a car. About an 18 hour drive, plus a few hours for bus stops and border crossings. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Including Google Ads

2006-08-10 Thread Adam Zey
variables) is against the AdSense terms of service, and is a good way to get your account revoked really fast. Only premium publishers that get express permission from Google are allowed to mess with those variables. It's possible that your company is a premium AdSense customer, but Mr. Ant

Re: [PHP] Creating custom superglobals

2006-08-14 Thread Adam Zey
ave us from having to make a shell call for syntax checking. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread Adam Zey
x, (unlike DOS), you CANNOT execute applications in the same directory without a path. Even if the program is in the same directory as your present working directory (which is usually where the PHP script is located), you'd have to do "./myprog" as a relative path. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Why does count() make copies of arrays?

2006-08-14 Thread Adam Zey
() on it, which should NOT be modifying the array? Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread Adam Zey
fe_mode_exec_dir". If safe mode is on, you'll need to put your program ("webpasswd") into that directory to execute it. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Include and require

2006-08-14 Thread Adam Zey
with setting information. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Why does count() make copies of arrays?

2006-08-14 Thread Adam Zey
Robert Cummings wrote: On Mon, 2006-08-14 at 13:16 -0400, Adam Zey wrote: I was writing a shell script in PHP (4.4.2) that dealt with a rather large array. To figure out what I needed the new memory limit to be, I did a memory_get_usage() at the end of my script, and came up with about 5.5MB

[PHP] Re: Include and require

2006-08-14 Thread Adam Zey
as NULL. When I wrapped it like this: function getmonths() { $months = array(1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6=> 'June', 7 => 'July',

Re: [PHP] Why does count() make copies of arrays?

2006-08-14 Thread Adam Zey
Robert Cummings wrote: On Mon, 2006-08-14 at 17:24 -0400, Adam Zey wrote: Robert Cummings wrote: On Mon, 2006-08-14 at 13:16 -0400, Adam Zey wrote: I was writing a shell script in PHP (4.4.2) that dealt with a rather large array. To figure out what I needed the new memory limit to be, I did

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