| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
Comments:
<0> style: couldn't you avoid that by doing proper transactions in a MySQL table type that supports it? <1> syle, database management systems don't allow that, thats the whole point they were invented, they aren't flat files <2> I'm trying to sort a multi-dymensional array like this: 1) by a number ASC, 2) by a number DESC, 3-5) by strings ASC. why won't my function sort the strings correctly? http://nopaste.info/index.php?id=0fad007ba3 <3> Stormchaser: Yeah <4> drebinDE: By any chance would you be able to get this data into a database and sort there? It's gonna be WAY faster/easier. <2> richardlynch: I know, but the informations is coming out of a CSV file... <4> acidjazz: I have been told by people I trust that FUDforum is the least insecure option, and it might actually be "good" HTH <3> syle: To prevent that, we have a thing called mysql_insert_id(), which can return the ID generated from the previous INSERT operation <0> drebinDE: just use some temporary DB tables <5> richardlynch: graci <4> drebomDE: recent versions of MySQL will let you use a CSV file as your storage engine... :-) <2> richardlynch: it should be possibly with usort though, right? my function just doesn't seem to work correctly yet. it might need a slight adjustion and then it should work... you can have a look here: richardlynch <4> Folks: syle wants his unique ID to be a random non-predictable value. Please stop suggesting auto_increment and mysql_insert_id as I also did way back when... <2> http://nopaste.info/index.php?id=0fad007ba3 <6> richardlynch: thank you for the str_replace line -- i have a problem though maybe you can help me?! fiphp doesn't like the '1' attribute at the end - i don't get an error, i just get no output with that att!? <7> ok lets say your idea is feasible, then what happens if you try to insert a duplicate key? you;ll get warnings that are not user friendly
<4> syle: You should not be showing ANY of those warnings on a production server. YOU control their output, ultimately. <7> thats just a bad programmer to me <1> syle: thats why you capture the warnings and then handle them <0> Random, non-sequenced primary keys... I guess I'm missing something there <1> syle, in php you can supress errors and then deal with them <4> syle: If you have a production server dumping MySQL errors to the public, then you have another bigger issue to solve... <7> i am unaware of how to capture a duplicate error warning , can you give some insight? <8> just write a function to create random ID's, it isnt hard to do <1> syle: prefix the command with @ and it will suppress warnings <4> syle: if (mysql_errno() == 1062){ //duplicate key entry } else { //real error } <9> !+@ <10> [@] The PHP error control operator that suppresses errors (@foo()), see: http://php.net/operators.errorcontrol - Don't use it. Think I'm wrong? Ask me about "GO". <4> 1062 might be 1064 -- I forget. <7> richard: if public is informing you of your error codes, that just solves to know exactly what is wrong <4> syle: If Bad Guy uses your error messages to figure out how to take over your server, that's the risk. <7> once again bad code if they can do that <1> syle: never give users real errors, suppress the real errors, and give them a fake user friendly one: "an error has occured" <11> hrm, can PHP get the PATH variable of a unix/linux system? <3> syle: You probably shouldn't have display_errors turned on in production servers; but that's beside the point. mysql_query() doesn't put any warnings to the browser by default. <4> syle: You are making zero sense -- If the public can see your error messages,the Bad Guy can purposefully TRY to cause errors to see them. <7> cyth: always do :) <3> Seadog: $_ENV['PATH'] <7> teach richard :) <11> thanks <1> syle: then store the real errors in a error file and go through it regularly <4> syle: You could EVEN give users some kind of error info about date/time and have them give you that to match up with the log files -- to get best of both worlds. <7> the point was instead of die mysql_error() you can die "error code 3110" <4> drebinDE: First problem is you have TWO tests for > in your cmp function for dateBase and one of them should be < instead. <7> if you don;t want people to see that <2> richardlynch: sorry, that's typo. the second one should've been "dateEnd" <4> drebinDE: Then you need to test host being < right after the host > and then the same pattern again for event and location. <7> but i don;t see how thats a big deal, it doesn;t show user/p*** connecting, your db is down, good youknow what to fix <2> richardlynch: the problem is the string comparisons <1> syle: remind me again: why are you against using auto increment? <7> because i need to generate unique usernames between 1mill and 90mill, because they are usernames <1> numbers as usernames? <2> richardlynch: so, for each string first > and then <? what do I return for those two? -1 both times? <1> ...ok <12> syle: that sounds like a Bad Idea (tm) you should generate a random number for it <7> prevents joe blow from signing up seeing next increment, running p***wd cracker kknowing username etc <4> drebinDE: If it's bigger, you return 1, if it's smaller you return -1, and if they are exactly equal in all respects, return 0. <8> syle, generate a random number then, it isn't hard to do <7> mfonda you need to read pastebin, thats not the topic at all <13> i realize this is a bit trickier. what would be a good method for changing the first <td> to <th> in every <table> in an html page? just point me in the right direction please :) <1> syle: why not use text usernames? and a auto increment id? <1> problem solved? <8> syle, what is the issue? I just got here? <2> richardlynch: I got it now... thank you so much! :) <7> the issue was when i was recursing on a function the return values no longer worked <7> cyth because VOIP doesn;t work like that <12> syle: you should never refer to the username, but the userid - username is just to make nice with visual things <4> rloaderr1: Something like Tidy could be used to tear apart the HTML in a sensible way. Or you could use preg/explode to find it by hand. <12> nah, you should use DOM <7> there is a webusername linked to the real voip username <7> so its not like your 567843 id logging in hehee <4> I consider DOM to be something like Tidy :-) <14> whats the array that holds $_GET and $_POST together? <13> itrebal: i know i could very easily do this with javascript - but i would prefer to affect the html itself for accessibility concerns... <4> don-o $_REQUEST <14> richardlynch: thx. <4> don-o It has COOKIES in it too.
<14> mmm. cookies. <9> syle did you say you DID have text usernames already ? <15> Is && in php the same as it is in C ? Like, if (foo == 1 && bar == 2) { ... } ? <8> yes <1> well if your afraid with username guessing, which isn't a problem on many online communities where everyone knows each other ids: you could just make a tarpit, so that brute forcing would pretty much be impossible in a sane amount of time. <16> Jymmmmmmm <4> jsoft: pretty much, yeah, though order of operations with regards to OTHER operators may not be what you expect... <1> like for example: only allow 3 failed logins per hour <13> "Tidy is currently available for PHP 4.3.x and PHP 5" <-- i'm using PHP 4.4.2, erm... Tidy will not work?! <9> hey Julian|Work, how ya doin? <16> Good, yourself? <17> Whichever of you bids closest without going over wins the showcase! <0> jsoft: you would probably want to explicitly group your comparisons <9> Julian|Work: Hanging in there, working on a new tooling design <1> plus an autoincrement user name in these cases would be easier for you the administrator to track <1> you could also log failed authentications, and when you notice one location failing too much, take action. <18> is anyone here looking for a webhost? <15> JAJMaster: with () ? <9> !+g7 <10> Guideline #7) No spam, bots, scripts, trolls, job postings (no job posting / asking for jobs on ##php. You might want to check out: ##php.jobs http://www.geekfinder.com, http://www.monster.com, http://www.rentacoder.com or http://www.getacoder.com, or php.net/links, "Developers and Job Opportunities"), advertisements or onjoin/away/back messages. <1> and rather than recursion, iteration would be much easier and much cleaner. <18> ? <18> dude, i only asked if anyone was looking <3> Demio: No advertisements <18> i didnt make pub <0> jsoft: yepper <18> jeesh <1> syle, since you seem pretty strong headed about it <9> syle did you say you DID have text usernames already ? <18> not like i posted my websites address or anything <18> i asked <4> Demio: Were you about to? What other followup could you hve expected? <3> Demio: Please don't ask that sort of question here. <18> *sigh* <18> I was trying to make my self useful <18> but I guess you dont like useful <4> jsoft: http://www.php.net/manual/en/language.operators.php <15> if (($gigs < $alrt_space_low) && ($alrt_space_epoc < time() + $alrt_freq)) { <15> mail($mail_to, "RRPROD USB HDD free space low!", "Danger, Danger!\nThere is only $gigs free gigs of space left on the USB backup drive that is plugged into the rrprod machine.\n"); <4> Demio: If you define useful as "Flame-war over various webhosts" then, yes, we don't like that. :-) <15> $alrt_space_epoc = time(); <15> why does that not work as desired? <0> Demio: it's just that web hosts are a dime a dozen and easy to find, or do yourself actually. <7> i was just trying to figure out why a peice of code didn;t work, race conditions etc, that 1 in 90 mill chance etc i wasn;t overly concerned with etc but was interesting <15> it mailing every time it is hit? <15> oh... doh! <4> jsoft: Have it email you $gigs, $alrt-sapce_low and all the other vars in the message body. <18> well, im webhosting sites my self, and I think as a php developer I could be more usefull to some php devs than other webhosts out there <15> I see what im doing now, .lol. <18> because I can instal apache mods, etc to fit the customers <4> Demio: You and about 20 people on this list. <19> jeesh <19> i sense a lot of hostility here <20> any one here familiar with OOPHP? <1> i have a question out of curiosity, why do the ops in here only op up when needing to enforce a ban? <21> nope - what is it? <9> cythrawll network policy <1> oh <4> cythrawll: Probably just easier/safer -- like su to root only when you gotta. <20> how do you cast an object to a type in php..i have an object Employee and i want to send a cl*** and instance of this object..but in another cl*** i need to cast it to Employee..how do i do that? <1> i see <20> something like this isnot working $this->Employee =(Employee) $Employee; <4> dotnetter: I suspect that $foo = (Employee) $bar; would do it... <22> hello <23> i would like to append 'OR' to the values in an array, but if there's only if there's more than one and not at the end. any hints? <24> hello, there is any function that returns how many times it occurs a string $s1 into a string $s2? <20> not doing it ..i get an error <4> mandric: http://php.net/implode <23> richardlynch: oh yea <23> richardlynch: thanks <4> dotnetter: Might not be able to do it at all, then. <1> dotnetter, what error? <23> richardlynch: will that do the trick if there's only one value?
Return to
#php or Go to some related
logs:
inline event registration model #perl format freespace ubuntu mount: special device /dev/mapper/ does not exist #perl quantact sucks #kde problema cursor ubuntu #sed #linux
|
|