[PHP] PHP5 Static functions called through __call() that don't exist... yet

2007-05-18 Thread Jared Farrish
} return $obj; } } } echo(''); echo(TypeAssert::string('test')); echo(''); I don't think this is possible (see http://marc.info/?l=php-general&m=114558851102060&w=2 ). But I would LIKE for it to work (currently, the above code does

[PHP] Re: PHP5 Static functions called through __call() that don't exist... yet

2007-05-18 Thread Jared Farrish
self::$types); $i++) { $obj->{self::$types[$i]} = (bool) false; } return $obj; } } } echo(''); echo(TypeAssert::string('test')); echo(''); I don't think this is possible (see http://marc.info/?l=php-gener

[PHP] Re: [PEAR] PHP5 Static functions called through __call() that don't exist... yet

2007-05-22 Thread Jared Farrish
27;string'; $_test = 'string'; break; } foreach (TypeAssert::getTypesObject() as $type => $v) { echo("is_$type($_test) === ". (TypeAssert::$assert->$type($test)? 'true': 'false'

[PHP] Re: Form Validation Issues

2007-05-23 Thread Jared Farrish
x27;=>true,'ut'=>true, 'vermont'=>true,'vt'=>true, 'virginia'=>true,'va'=>true, 'washington'=>true,'wa'=>true, 'west virginia'=>true,'wv'=>true, 'wisconsin'=>true,'wi'=>true, 'wyoming'=>true,'wy'=>true ); function States() { } function isValid($str,$suggest) { if ($this->states[strtolower($str)] === true) { $this->suggest = null; return true; } elseif ($suggest === true && strlen($str) > 3) { $this->doSuggest($str); return false; } else { $this->suggest = null; return false; } } function doSuggest($str) { foreach ($this->states as $state => $val) { similar_text(strtolower($state),strtolower($str),$result); if ($result > 85) { $this->suggest = $state; } } if (empty($this->suggest)) { $this->suggest = null; } } function isSuggested() { return $this->suggest; } } $states = new States(); $state = 'Hawii'; if ($states->isValid($state,true) === true) { echo("$state is a state."); } elseif ($suggest = $states->isSuggested()) { echo("May we suggest $suggest?"); } else { echo("State not found."); } ?> -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: Form Validation Issues

2007-05-23 Thread Jared Farrish
Also, Indiana and Connecticut were misspelled. -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: problems in WHERE statment

2007-05-23 Thread Jared Farrish
st2'; var $c = '$a$b'; var $d = "$a$b"; var $e = $a.$b; $e is equivalent to $d, where c would print literally $a$b, since you told the parser using the single quotes to leave the string alone. Likewise, var $f = $a."-$b$c-".'$e'; would print test-test2

[PHP] RE: Cannot access file on Network Drive (Windows 2003)

2007-05-23 Thread Jared Farrish
chines to be known. It's probably a permissions thing, though. FWIW -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: Cannot access file on Network Drive (Windows 2003)

2007-05-23 Thread Jared Farrish
Oh yeah, and tijnema has a good point: \\compname-x\\offsite\\db\\test.dbf Btw, what does top post mean? On 5/23/07, Jared Farrish <[EMAIL PROTECTED]> wrote: Other than permissions, you might be referencing the folder by the local network mapping drive initial, instead of the actual pa

Re: [PHP] RE: Cannot access file on Network Drive (Windows 2003)

2007-05-23 Thread Jared Farrish
ions related issue and I'm doubting it is a permissions issue. I have Full Control given to the system all this is on. -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: RE: Cannot access file on Network Drive (Windows 2003)

2007-05-24 Thread Jared Farrish
Win machines, I would think, would be a MAJOR headache if you've never done it before. One essentially speaks Polish, while the other speaks Italian. -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: RE: Cannot access file on Network Drive (Windows 2003)

2007-05-24 Thread Jared Farrish
ped addresses, since a mapping is just a localized version of a resource name alias. If, after determing that Apache is running with the right permissions for the owned processes to connect to and use a network shared resource, then it's probably an Apache UID conflict (is PHP in safe mode?)

Re: [PHP] Re: RE: Cannot access file on Network Drive (Windows 2003)

2007-05-24 Thread Jared Farrish
they are not reliable for programming purposes, IMHO. For the advanced PHP gurus on the list, is it accurate to characterize PHP as relying on Apache for file manipulation? Is it accurately described as: Process Request->PHP->Apache->[File System Poof!]->Apache->PHP->Process

[PHP] Re: Protecting MySQL Injection from PHP form

2007-05-24 Thread Jared Farrish
off wrapping your SQL commands into a class or at least a series of functions, so that you can implement your sanitization once and use it for all database interactions. Google: http://www.google.com/search?q=php+sanitize+sql+statement PHP.net: http://www.php.net/manual/en/security.database.sql-inj

[PHP] Re: Protecting MySQL Injection from PHP form

2007-05-24 Thread Jared Farrish
ybe you manage that... On 5/24/07, Jared Farrish <[EMAIL PROTECTED]> wrote: I'm not sure exactly what kind of sanitization you think you're doing, but if all you do is check to see if it's empty (empty() implements isset(), empty() checks to see if it's set, then if it e

[PHP] Re: php hosting-mediatemple/dreamhost

2007-05-24 Thread Jared Farrish
get off the shared server. Shawn Inman is a modestly-famous web designer/developer who uses MediaTemple for his website: http://www.shauninman.com/ -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: Check if Record was Entered Today.

2007-05-24 Thread Jared Farrish
= Incidentally, does this mean you solved the file access problems from this thread: http://news.php.net/php.general/255542 -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: Developer / Client Documents

2007-05-24 Thread Jared Farrish
webdbapps2/ This will give you most of what you're looking for. Think XAMPP for a localhost install to run tests, and MySQL for a database backend (part of XAMPP): http://www.apachefriends.org/en/xampp.html It will take time. Good luck! -- Jared Farrish Intermediate Web Developer Denton, Tx

[PHP] Re: Re: RE: Cannot access file on Network Drive (Windows 2003)

2007-05-24 Thread Jared Farrish
file permissions extended through primary processes (such as Apache using an executable)... The whole apache GUID mess seems like cryptic middle ages eye gouging... -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: Include???

2007-05-24 Thread Jared Farrish
introspection. Useful for $_GET, $_COOKIE, $GLOBALS, $_SERVER, etc... p.s.: Could you use descriptive subjects; include doesn't really say much... -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: Scalable Site Architecture

2007-05-24 Thread Jared Farrish
ent animals, but knowing how each works at least superficially can help later. What I suspect you need is a book on LAMP (www.oreilly.com). -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: Uploading Files into MySQL

2007-05-24 Thread Jared Farrish
e php script upload file mysql database You can thank me later. *snap* -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: help with multi dimensional arrays

2007-05-24 Thread Jared Farrish
omma. Well, I got a chuckle. :D -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: Re: help with multi dimensional arrays

2007-05-25 Thread Jared Farrish
effort on this list in the past. Please start a new thread with a more appropriate title. Thanks! -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: Protecting MySQL Injection from PHP form

2007-05-25 Thread Jared Farrish
box to show up so I can delete multiple people at one time :) But I'm still learning about that. I sure hope you're testing on test data, and not live data... -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

Re: [PHP] Re: Check if Record was Entered Today.

2007-05-25 Thread Jared Farrish
whatnot, and is then used as an include() file. This way, the data is rebuilt each go around, but the overhead is pushed to another machine, similar to a SOAP service (which is another...). Pass a variable id to the CLI script... -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslo

[PHP] Re: Using PHP to retrieve and display file from MySQL database

2007-05-25 Thread Jared Farrish
Is there a valid $id being passed through a query ($_GET) variable, like so?: http://www.filecircus.com/somewhere/outthere/gimme.php?id=badphoto103 What happens when you click on that? -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have

[PHP] Re: PHP debugger

2007-05-26 Thread Jared Farrish
an/JS/lem.json.js -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: installing error

2007-05-26 Thread Jared Farrish
h would be the best for me WAMPP makes apache and php installation stupid easy (MySQL too, but you don't seem to need it). Maybe, you might install WAMPP, uninstall MySQL, and install PostgreSQL... Never done it, but with some fiddling, it should work. -- Jared Farrish Intermediate Web Devel

[PHP] Re: $_GET strings seperation

2007-05-26 Thread Jared Farrish
alues that are not replaced ($query=Array('cID'=>51,'doesnotexistyet'=>'completelynewvalue'), for instance). Also, the above is an example; there are certainly many other ways to do what is done above (such as replacing the last foreach loop with an implode(

[PHP] Re: Too many records to display in one web page

2007-05-26 Thread Jared Farrish
is is called pagination, and is well-discussed and documented on the web: http://www.google.com/search?q=php+pagination -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: $_GET strings seperation

2007-05-26 Thread Jared Farrish
'curly'; $array[] 'larry'; // Is equivalent to ~ $array = Array(); array_push($array, 'moe'); array_push($array, 'curly'); array_push($array, 'larry'); When you add a numerical array in php, it is added to the stack as a new item, or push. Essenti

[PHP] Re: PHP5 oop question...

2007-05-28 Thread Jared Farrish
when in scope to an instantiated object should work), and/or make it work entirely on it's own without $this. -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Tracking exit links with php?

2007-05-28 Thread Jared Farrish
). What you want is access to their redirect page log. You also might look into Urchin and the ISP's that support it. -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: Upload a ppt file

2007-05-28 Thread Jared Farrish
Does any have any references or an example to show me? Well, I think we need a description of the error or the invalid response you're having. It could be a file-size issue (your php.ini configuration won't allow file sizes > 8mb's, for instance). Have you googled it?

[PHP] Re: Unknown number of check boxes?

2007-05-28 Thread Jared Farrish
ot;; } return $str; } echo(getCheckBoxes()); ?> Consuming of form post An example of inverting a posted checkbox array to support $checked[45] === true behavior, making it easier to access and test the posted content Please select some random checkboxes above' . '

[PHP] Re: Unknown number of check boxes?

2007-05-28 Thread Jared Farrish
On 5/28/07, Jared Farrish <[EMAIL PROTECTED]> wrote: $tr = $i % 5 === 0 ? Array('','') : Array('',''); Ignore this line, it was from an earlier iteration of that function. -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham

[PHP] Re: Web Application Design Literature

2007-05-28 Thread Jared Farrish
ogramming techniques, keep in mind PHP is quite a bit different from other languages (such as C#) in the way it implements some details of objects, and that PHP4 and PHP5 are quite significantly different versions, vis-a-vis objects and classes. Good luck! -- Jared Farrish Intermediate Web Developer

[PHP] Re: a question on session ID and security

2007-05-28 Thread Jared Farrish
session is destroyed and the temp file where it is stored is deleted from the harddrive. Do not store sensitive information or use a SESSION id to authenticate a user. -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see eve

[PHP] Re: a question on session ID and security

2007-05-29 Thread Jared Farrish
inst a visitor. I just think it feels flimsy to validate a user on a SESSION key only. -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$ -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

Re: [PHP] Re: a question on session ID and security

2007-05-29 Thread Jared Farrish
was a reliable way to add security to sessions don't you think that one of the multitude of web development languages out there would have done it, including PHP? I certainly don't think you're implying I thought I had given some new, "better" way of doing sessions that nobody h

Fwd: [PHP] Re: a question on session ID and security

2007-05-29 Thread Jared Farrish
ut browser bickering, OS wars, and all the other "dispassionate" discourse currently "enlightening" the internet. At least with security, there's some known benefit to discussing it! -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only too

Re: [PHP] Re: a question on session ID and security

2007-05-29 Thread Jared Farrish
That's not what I'm saying. My basic question is why send the "secondary hash key" to the client when it doesn't need it? Use the authentication key to identify the users data, then get the "secondary hash key" from that data. The browser never needs to see the hash, and from a purist security poi

Re: [PHP] Re: a question on session ID and security

2007-05-29 Thread Jared Farrish
On 5/29/07, Jared Farrish <[EMAIL PROTECTED]> wrote: I do think the stated best practice of SESSIONS, at this point, probably does need to be described to be further useful as a topic of discussion. I've been a little unclear in some things, so I get the feeling we've got the sa

Re: [PHP] Re: a question on session ID and security

2007-05-29 Thread Jared Farrish
than yours? Of course not. Mind telling me again?! :D I appreciate that you posted the historical information on sessions and cookies. Whether it's accurate to reality, I don't know, but it makes sense, not lemons, so for now, it's good enough for me! p.s. Maybe everyone wasn't around when that history occurred... -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] RE: Return or not to return, that is the question

2007-05-30 Thread Jared Farrish
moot question anyways. PHP's soft-typing complicates this further (0 == false == null == '' == ??). This makes a whole lot more sense in C++ or something other strong-typed language. Thus, code to what you need, but have high standards (by knowing what you need)! -- Jared Farrish Interm

[PHP] Re: scheduling a script to check a directory for files

2007-05-30 Thread Jared Farrish
to handle the call, though. http://en.wikipedia.org/wiki/Lynx_(web_browser) -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: RE: Return or not to return, that is the question

2007-05-30 Thread Jared Farrish
ere are times when "return;" is meaningful, such as breaking out of loops (and the function), switch statements, and whatnot. For all other times when a return isn't expressly meaningful, I see it as a matter personal preference, which is usually influenced by someone else's over

[PHP] Re: RE: Return or not to return, that is the question

2007-05-30 Thread Jared Farrish
I think in a lot of cases using surrogates is a better, scalable solution, but that only matters if you need a "better, scalable solution." Depends on coding style, preference, and the situational need. -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] preg_match() returns false but no documentation why

2007-05-30 Thread Jared Farrish
ttp://www.sitepoint.com/article/regular-expressions-php). Thanks! -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

Re: [PHP] Re: a question on session ID and security

2007-05-30 Thread Jared Farrish
On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote:> If they can get the first cookie, they can get the second just as easily. I thought this said "just as weasily" at first, and I thought, "Ain't that the truth..." -- Jared Farrish Intermediate Web Develop

Re: [PHP] preg_match() returns false but no documentation why

2007-05-30 Thread Jared Farrish
On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Wed, May 30, 2007 12:33 pm, Jared Farrish wrote: > > preg_match("^ldap(s)?://[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$",$this->server) You are missing the start/end delimiters is your first problem... Which ones? I'

Re: [PHP] preg_match() returns false but no documentation why

2007-05-30 Thread Jared Farrish
s saying was that "false" is not the stated return value if it's not found. If it's not printing a zero, shouldn't that mean it's returning false? preg_match("/^ldap(s)?:\/\/([a-zA-Z0-9-])+\.[a-zA-Z.]{2,5}$/",$this->server) Now when I add the slashes, I g

[PHP] Re: find (matching) person in other table

2007-05-30 Thread Jared Farrish
sted that, but I think it would work. You would need to work on a way to LIMIT the matches effectively. If that doesn't work, hey, this is a PHP list... -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: find (matching) person in other table

2007-05-30 Thread Jared Farrish
On 5/30/07, Jared Farrish <[EMAIL PROTECTED]> wrote: $lastname = strpos('Rogers',0,2); $firstname = strpos('Timothy',0,2); $select = "SELECT `uid`,`LastName`,`FirstName` FROM `users` WHERE LastName='$lastname%'

Re: [PHP] preg_match() returns false but no documentation why

2007-05-30 Thread Jared Farrish
etty color syntax highlighting of the target string and your regex to show you what's going on, as well as a slow-motion instant replay to "step" through it piece by piece. Oooh, pretty colors! Stepping through sounds interesting. I'll have to check it out. Thanks! -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

Re: [PHP] Re: find (matching) person in other table

2007-05-30 Thread Jared Farrish
g is weighting it by email address, which you can add to the SELECT I posted (although you need to think about how you use your wildcards for email addresses, such as maybe matching the beginning OR the end, for instance). It's even better if the person has to activate the account with an email link to activate, since then you'd know the email address existed (although it doesn't mean it isn't someone in the database that isn't already in there). -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: preg_match() returns false but no documentation why

2007-05-30 Thread Jared Farrish
ce.html Also, why are you allowing for uppercase letters when the RFC's don't allow them? I hadn't gotten far enough to strtolower(), but that's a good point, I hadn't actually considered it yet. Just my thoughts Hey, I appreciate it! -- Jared Farrish Intermediate

Re: [PHP] Re: find (matching) person in other table

2007-05-30 Thread Jared Farrish
less "heavy" operation. If you did the first a couple hundred or thousand times, I would bet your page would drag to a halt while it loads... -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: Re: preg_match() returns false but no documentation why

2007-05-30 Thread Jared Farrish
ifiers.php "i (PCRE_CASELESS) "If this modifier is set, letters in the pattern match both upper and lower case letters." How do you test regex's against any known variants? I suppose I need to build a test function to make arbitrary strings and then test and print the

[PHP] Re: Re: Re: preg_match() returns false but no documentation why

2007-05-30 Thread Jared Farrish
definition doesn't make any kind of sense to me, ie, practical usage. Does it mean match anything that, say, *starts* with a pattern but ends with "whatever" (.)??? Thanks! -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the only tool you have is a hammer, you tend to see every problem as a nail." $$

[PHP] Re: local v remote

2007-05-31 Thread Jared Farrish
Do database stuff that needs a connection } IMPORTANT: Do not use mysql_pconnect() without first reading about it: - http://us2.php.net/manual/en/features.persistent-connections.php - http://us2.php.net/manual/en/function.mysql-connect.php - http://us2.php.net/manual/en/function.mysql-query.php - htt

[PHP] Re: Re: Re: Re: preg_match() returns false but no documentation why

2007-05-31 Thread Jared Farrish
it 'Full Stop' when it doesn't seem to actually correlate to the regex meaning it identifies, don't you think? Maybe to a Brit or someone who understands Commonwealth English would know (I was aware of what it meant in CE, I just woudn't have imagined to apply it here, since it

[PHP] Re: More include issues

2007-06-06 Thread Jared Farrish
ults may vary, and may not work on all servers (IIS, for instance) or some Apache installations (I guess). Try creating a test page and play around with it using echo and so on to see what it outputs. You can contact me directly if the forum mungs it up on the line-wrap. Also try: echo '&#

Re: [PHP] Re: More include issues

2007-06-06 Thread Jared Farrish
On 6/6/07, Robert Cummings <[EMAIL PROTECTED]> wrote: On Wed, 2007-06-06 at 17:21 -0500, Jared Farrish wrote: > I feel ya brotha! I think Stut might be having a bad day... Bad day?? Did you read the same posts I read? Cheers, Rob. Sure I did. Let's not take this too

Re: [PHP] Re: More include issues

2007-06-06 Thread Jared Farrish
On 6/6/07, Robert Cummings <[EMAIL PROTECTED]> wrote: On Wed, 2007-06-06 at 20:26 -0500, Jared Farrish wrote: > On 6/6/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > > > > On Wed, 2007-06-06 at 17:21 -0500, Jared Farrish wrote: > > > I feel ya brotha! I