1 edb Feb 21, 2008 04:28
3 edb Feb 21, 2008 20:03
Cool. Will try it out later today. Always something else is more pressing eh?
Next up is finding the regex that makes sure a value is numbers only. I'm pretty sure I have that one laying about somewhere. Actually I've got it narrowed down to "a hard drive" and I'm pretty sure it's "the first hard drive" so it shouldn't be too hard to find ;)
Yeah the form thing looks good. I then put in a switch that says "if a param that doesn't exist unless someone puts in a value exists then do a different thing". Much nicer than trudging off to htsrv to go right back to the same stupid page so it can go off to htsrv to do it's thing.
4 yabba Feb 21, 2008 23:59
is_numeric() or preg_match( '~^[0-9]+?$~', $foo ); ;)
You could also throw in a if( is_logged_in() && $current_User->ID = bar ) and let evo do all the work ;)
¥
5 edb Feb 22, 2008 00:45
I didn't know there was a function I could use for "is it a number" but I had the preg_replace thing in an old plugin that I found, so that's done. Checking user inputs sucks ya know? Like, how hard is it to put "4" in instead of "april" when the comment on the form field says "1 or 2 digits for the month (ex 4 for april)"? But you gotta check and recheck everything :(
The quick shortcut back to the same page isn't working as nicely as I had hoped for though. Already that part is tucked inside "is logged in" and "is user id NN" so that the occasional person with powers and abilities gets to see the bits they need, but it doesn't seem to be able to hold the value I give it. Gonna do the easy-but-not-clean solution of trudging off to htsrv long enough to come back because what the heck it does the job.
All so that a bunch of users can tell me it should know everything and they shouldn't have to actually have to input any data :roll:
I think :P
¥