|
Posted by Steve on 10/17/06 22:19
".:[ ikciu ]:." <no@mail.com> wrote in message
news:eh3inb$30g$1@news.dialog.net.pl...
| Hmm Steve <no.one@example.com> wrote:
| > but hey, i can take your heat. at least mine is a response in concern
| > and kindness...NOT CALLING ANYONE STUPID FROM THE GET-GO.
|
| no sense to set these variables $action is enought with int value 1 add 2
| edit and so on .... simple to validate and use
even easier to understand and use the way i wrote it to. and no, $action is
NOT enough if you'd care to look at everywhere it is used...particularly in
the form.
| >
| >> $id = isset($_REQUEST['id']) ?
| >> $_REQUEST['id'] : 0;
| >> $personFirstName = isset($_REQUEST['personFirstName']) ?
| >> $_REQUEST['personFirstName'] : '';
| >> $personMiddleName = isset($_REQUEST['personMiddleName']) ?
| >> $_REQUEST['personMiddleName'] : '';
| >
| > PLACE. if you look further down the code, THIS is where i validate
| > the data coming in...suck as the EMAIL address. what else IS there to
| > validate, chump?
|
| you call it validate :))))))))) don't laught me ... give me a url where do
| you use this code and i will show you what you made :)
i call this assigning values to variables in this section. like i said set
it up on YOUR server. if you look further down in the code, you'll see i DO
validate the data but ONLY when necessary (before the data gets
consumed...which it may never be, so why validate here! toad.
| > you say this without knowing how my db::prepare() function work...you
| > fucking tard! see, i told you you were a troll. besides depending on
| > how my server is setup, i DON'T NEED TO STRIPSLASHES...nooby!
|
| i wrote IF if you didn't see it
you refered to it in several comments...sorry if i missed you IF. you missed
far more in reviewing the code!
| >> i preffer second type of insert much better - so hard to make
| >> mistake, you store not encoded password - wrong for me
| >
| > thank GAWD i'm not doing things the way YOU prefer! lol. good
| > programming in general is wrong for you!
|
| do you think insert into () values () is better then insert into a=b ? or
| you are a dumb or maybe you don't know this solution ???? i think so ...
i think you don't know WHY i chose one over the other. ever update a table
schema and wonder why a seeminly unrelated page(s) blows up when insert into
table values(...) is called on the new schema?! ever try and alter an inline
sql statement where the columns weren't stated and the variable names
weren't descriptive...such as $tmp[1]?! probably not. your lacking
experience, as i've said. i always choose
maintenance/legibility/understandability.
i'd hate to see your code.
|
| > no mistakes that i see. wanna point them out in particular. you should
| > peruse w3c specs before you answer, as it is ENTIRELY appropriate to
| > have a css define an entity while using inline style to over-ride the
| > base settings in the css for said entity...since one is applied after
| > the other. nooby.
|
| ofc it is possible but who use it? only you and your stupid team which
| produce html for IE only?
it is completely w3c compliant methodology. it is up to the browser to
implement it correctly. i/we develop for most browsers, not just IE. get
html literate, then come back with your argument here!
| >> good solution is pass form to this function -
| >> onsubmit="validate(this)"
| > a compliment? no fucking way!
|
| ofc, when you will change name of form better way is to change X line of
| code ... point for you
as there is never any other form but 'record', i see no reason to complicate
the code just to make you feel better.
|
|
| >>> if (warning.length == 0 && trim(el.value) == '')
| >>> {
| >>> warning = "FIRST NAME is required.";
| >>> }
| >>> var el = record.personLastName;
| >>> if (warning.length == 0 && trim(el.value) == '')
| >>> {
| >>> warning = "LAST NAME is required.";
| >>> }
| >>> var el = record.personUserName;
| >>> if (warning.length == 0 && trim(el.value) == '')
| >>> {
| >>> warning = "USER NAME is required.";
| >>> }
| >>> var el = record.personEmail;
| >>> if (warning.length != 0 && !isEmail(el.value))
| >>> {
| >>> warning = "Invalid EMAIL.";
| >>> }
|
| > yes, i know what i wrote..fucking moron. YOU JUST DON'T UNDERSTAND
| > IT. the part you snipped is the part that sets focus on the FIRST
| > INCORRECT DATA ELEMENT SUPPLIED. i don't need to show ALL errors ALL
| > at once...that is confusing for the user...not that USER EXPERIENCE
| > CONCERNS YOU!
|
| hehe, so good solution everytime check all fields - ppffff
| if you will have one error then no sense to check rest - your stupid
| function is running only on submit so it means at the end of function el
| will remember last wron field - no more and it will selct it, checking
rest
| fields if one error occured is not important !!!!
it only continues to check other fields if the previous fields are valid.
you're daft and can't read code.
| > your limited imagination kills me! two fields may constitue the same
| > error description one and or both may be at fault, thus generating
| > said description. i simply want to show the error description once,
| > you mindless cad!
|
| ofc great solution pfff i will show you error handling if you want
sure, i'm up for a laugh...even more than i am now.
| >>> <td colspan="2">
| >>> <input class="value"
| >>> name="personRePassword"
| >>> maxlength="255"
| >>> type="text"
| >>
| >> again
| >>
| >
| > again what? stripslashes are completely a matter of server
| > configuration. or, didn't you know that?!!!
|
| did you ever hear about type password ? lamer
yep...did you know you can't set an initial value for a password input?!
complicates the code if i have to determine whether or not the pasword
matches the retyped password or if it was set on prior saves. the page's
functionality fits the context it was written for. there is no need for such
secrecy with passwords here since i employ the page as an admin function
where admin is gawd. dipshit.
|
| > yeah, i usually use cursor:pointer since it jives in firefox...oh
| > well, you actually made a valid point! big fucking deal. and just so
| > you know, hand is an IE thing...POINTER is a w3c thing...so there HAS
| > NEVER been a depreciation of ANYTHING. toad.
|
| heheh if you dont know there is other cursor value which will show hand
i just told you two...you want more?
|
| >
| >>> $lastSort = isset($_REQUEST['lastSort']) ?
| >>> $_REQUEST['lastSort'] : '';
| >>> $sort = isset($_REQUEST['sort']) ?
| >>> $_REQUEST['sort']
| >>>> 'LASTNAME';
| >>> $sortDirection = isset($_REQUEST['sortDirection']) ?
| >>> $_REQUEST['sortDirection'] : 'ASC';
| >>> if ($sort == $lastSort){ $sortDirection = $sortDirection == 'ASC' ?
| >>> 'DESC' : 'ASC'; }
|
|
| excelent error handling :)
|
| > again, i'm simply ASSIGNING the values to variables. validation is
| > elsewhere. you should note how terribly consistant i am in
| > methodology. see how that helps in code maintenance and
| > understandability? oh well, probably not.
|
|
| just use $lastSort=IM_LAMER in url and you will see :)
well, it would be ?lastSort=IM_LAMER in the query string...but this is NOT
an issue with me on this portion of code since it doesn't pose a security
risk or compromise data integrity...just the user display of info which the
user fucked up by setting lastSort=IM_LAMER...if you want to be a 'lamer' go
ahead...serves you right. lol.
| >>> $recordsPerPage = $_REQUEST['recordsPerPage'];
| >>> if (!is_numeric($group)){ $group = 0; }
| >>> if (!is_numeric($page)){ $page = 1; }
| >>> if (!is_numeric($pages)){ $pages = 5; }
| >>> if (!is_numeric($recordsPerPage)){ $recordsPerPage = 10; }
| >>
| >> totaly wrong 123.45 is numeric too so next code is totaly wrong too
| >> .....
| >
| > you're an imbassil...run 123.45 through the algorythm and see if the
| > math fails to work! idiot!
|
| ofc you are totaly idiot i will show you:
|
| $recordsPerPage = 10
| $page = 3
|
| what we will have? try to count
|
| later use this value $recordsPerPage = -10
| look at $range and try to run query with limt -X, Y
|
| and look in the mirror and say IDIONT
if you want to fuck code up, go ahead! you can destroy *anything* i'm sure.
since this portion of code is COMPLETELY untouched by the user, you are free
to make your shit not work...at least this time, you'll know why your code
doesn't work!
|
| $group = floor((($page - 1) * $recordsPerPage) /
|
|
| >
| >>> $sql = "
| >>> SELECT COUNT(*) RecordCount
| >>> FROM people
| >>> ";
| >>> unset($records);
| >>> $records = $db->execute($sql);
| >>> $recordCount = $records[0]['RECORDCOUNT'];
| >>> $currentPage = $page;
| >>> $group = floor((($page - 1) * $recordsPerPage) /
| >>> ($recordsPerPage * $pages));
| >>> $navigation = array();
| >>> $page = $group * $pages + 1;
| >>> $lastPage = $page + $pages;
| >>> $maxPages = ceil($recordCount / $recordsPerPage);
| >>> $range = ($currentPage * $recordsPerPage) -
| >>> $recordsPerPage; if ($group)
| >>>> style="border-bottom:1px solid lightsteelblue;
| >>>> border-right:1px
| >>> solid lightsteelblue; cursor:pointer; font-size:8pt;"
| >>> title="Click to sort"
| >>> onclick="document.location='<?= $_SERVER['PHP_SELF']
| >>>> ?lastSort=<?= $lastSort ?>&sortDirection=<?= $sortDirection
| >>>> &sort=LASTNAME'" >Last Name</th>
|
| > if a user wants to fuck with the query string, let them. the results
| > are simply what they are whether good or bad. it doesn't effect
| > anything involving security or data integrity...which is my concern.
| > you may happily fuck off now.
|
|
| ofc, read my previous info say IDIOT AGAIN
idiot.
|
| >
| >
| >>> $sql = "
| >>> SELECT Id ,
| >>> FirstName ,
| >>> MiddleName ,
| >>> LastName ,
| >>> UserName ,
| >>> Email
| >>> FROM people
| >>> ORDER BY " . $sort . " " . $sortDirection . "
| >>> LIMIT " . $range . ", " . $recordsPerPage . "
| >>
| >> db inssues for your code - means next error
| >
|
| > nope.
|
| ofc
whatever.
| >
| >>
| >>> <a
| >>> class="menuItem"
| >>> href="<?= $_SERVER['PHP_SELF']?>?edit=1&id=<?=
| >>> $record['ID']
| >>>> " style="font-size:7.25pt; font-weight:normal;
| >>> text-decoration:underline; white-space:nowrap;"
| >>> title="EDIT [ <?= $description ?> ]"
| >>> >Edit ▷</a>
| >>> <br>
| >>> <a
| >>> class="menuItem"
| >>> href="<?= $_SERVER['PHP_SELF']?>?edit=1&delete=1&id=<?=
| >>> $record['ID'] ?>"
| >>> style="font-size:7.25pt; font-weight:normal;
| >>> text-decoration:underline; white-space:nowrap;"
| >>> title="DELETE [ <?= $description ?> ]"
| >>> >Delete ▷</a>
| >>
| >> here is your first error should be passed $action variable with int
| >> value and then error handling
| >
| > no error...why not set this up on your server and try to make it blow
| > up.
|
| ok, i will show you - GIVE MA URL WHER I CAN FOUND IT AND I WILL CRASH IT
IN
| 3 SEC
|
| > you may fuck off now.
|
| ofc GURU
put it on your server and compromise the security or data integrity...if you
think lastSort=IM_LAMER qualifies as a big issue, so be it. as it is,
lastSort=UR_LAMER.
Navigation:
[Reply to this message]
|