| |
| |
| |
|
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
Comments:
<0> I am having trouble with a parse error in 1 line of code, can anyone see it: http://pastebin.com/568242 <1> Knuckles10: You're missing a ; <2> what would be a way to do this without getting a division by zero error? $ratio = $inserts (222300) / $hits(424940) <3> after </a>" <1> ">RED</a>" <-- Need a ; <1> Punkcut: By ensuring that you're not dividing by zero. <0> thanks for that, that was driving me nuts <3> which, according to kuja, you can check with $var != '' :-D <4> :) <5> Ruud: touch =) <2> thanks ruud <3> nono <3> that was an insiders joke <6> re <3> you could simply check if $hits = 0, if so don't divide <5> I'd rather do it with: $hits > 0
<3> but you'll have to think of what you want to do if it is <3> shadow: that was pseudo code <3> :) <1> if ($inserts && $hits) { /* divide here */ } <5> kuja: wrong <6> question: what does the notation of the form _method_name tell me? <6> is this common practice? <5> kuja: what about if $inserts is a string? it will give you another error =) <7> is_num then <1> shadow: '0' is false. <3> looks like we've got him shadow :) <6> my problem is that I am trying to create UML Cl***-Diagramme for a PHP-Project, which is not mine <1> er4z0r: It inicates a private method. <1> indicates, even. <1> shadow: (bool)'0' === false <5> kuja: yes, but that if condition will p*** if one of the variables is a string.. and what happens if you divide with string values? =) <6> kuja: ;) thanks thats what I suspected <1> shadow: It will convert it to an integer. <1> Or rather, a float, depending on what the string is. <5> kuja: so lets say I have $insert = 'moo'; <3> that'll evaluate to 0 <3> heyho <5> and we're back to square one =) <3> division by zero error <1> are we not talking about numeric strings? <3> and what about 'never trusting user input' <5> kuja: too late to back off =) <1> It's obvious you know what I meant, shadow. <1> '123', '12.3', etc. <5> well your code is not failsafe <7> btw... what is this all about ? <1> Depends on the context, shadow. <1> shadow: Who knows what he's doing before that code? <3> 0x41464b: it started with the recomendation of not using empty(), no idea how we got to this point :) <4> Can you guys stop bloody nit picking over this. The point is php is loosely typed, this allows greater flexability in a lot of situations. There is also support for type casting for when you need a specific type. You get the best of both worlds so please stfu and move onto the next topic :) <3> but it's an amusing discussion :) <5> kuja: I do my best to write the kind of code that you can use in all cases, without havin the drop in performance.. your way to do it is to ***ume we're getting the right information in the first place.. but there's always this thing called the "human factor" <7> --------------- cut here --------------- <5> okay, I'll rest my case =) <1> shadow, shadow, shadow... context man, context. Learn the word, move on. <7> How to findout someone able todo PHP or not in 30minutes test ? <7> what test? <6> Lomat: you name it man. I'll never forget again to explicitly (string) a postalcode <8> hey guys <8> how do i count characters? <4> using your fingers? <9> regex <8> lol <3> strlen() <3> ? <8> i need to echo ... after 15 charactes or so <7> php.net/count_chars <8> thanx <10> painkiler: www.php.net/substr <8> thanx <11> why does 99999999999999 % 1000 return 340 ? <9> LO <9> bas your kidding me right <11> ch0wns: it goes wrong when the number contains than 11 digits <12> hy
<6> ch0wns: what's so funny about it? <13> Ok, I've been staring at this so long I'm just confusing myself further. <4> php uses signed 32-bit integers <4> although i;m not 100% if that is the case for 64bit systems, Anybody know? <13> I have a timestamp that is in one of the US time zones, I know that time zone. I need to convert it to GMT, but I'm not getting it. <12> i have a prblem with a php script in wap script <4> Simplex3: gmdate()? <12> i use <input name="aplicatie" size="30"/><do type="Search" label="Answer"> <go href="found.php"/></do> in a script in another $aplicatie=$_POST['aplicatie']; echo $aplicatie; and nothing is happening <12> what is wrong? <4> gangster`s: is the form using POST? <13> So the theory with gmdate is that if the script is currently set to "US/Central" and I have a timestamp that is at time in US/Central, then I run "$whatIWant = gmtime($CSTTime);" then I get out the GMT timestamp? <4> Simplex3: think so <3> bas: a bit late but the maximum integer value is 2147483647 <12> Lomat: thx... i wasn't use a postfile tag ;) <11> Ruud: isn't this supposed to give me some E_NOTICE or whatever? I now have to check for this manually <3> no, it's automaticly changed to a float <3> http://www.php.net/manual/en/language.types.integer.php <13> Lomat: lol. My problem was my debugging code was printing the timestamp using the regular date() so it was convertng it back. Hmm, maybe it's time to hit the sack, huh? <4> :) <3> bas: http://nl2.php.net/is_float should do the trick :) <14> http://mazzanet.id.au/phpstuff/barcode_code.php?str=Macca%60%20smells&scale=1.5 <14> Macca`: <11> Ruud: I know it does the trick, but I would like to emphasize that php should generate a warning (like perl does in this situation). (any php developers listening?) <15> Does anyone know of any ajax libraries with an edit-in-place table ? <15> ie. like a PHP library to make them would be ideal :P <16> hi.. can some one suggest a good php debugger.. <17> which kind of ? <17> "step-by-step" debugger ? <17> or object/variable debugger ? <16> xshad: i am not aware of the different kinds.. probably you can suggest both <17> www.zend.com <17> best one <17> or, you can do a print_r(); hehehe <16> hehe <16> i want the step-by-step one.. <17> zend :) <16> :-P <17> http://phpdebug.sourceforge.net/ <16> hey.. i want free ones.. <16> zend is not free i guess xshad <17> http://mirrors.easynews.com/php/ <17> I've found 64.100 web sites googling for "php debug" <7> Zend PHP Editor and IE <7> IDE* <17> he wants free ones <7> code it for us and host it at sourceforge <7> :D <16> free as in free bear <16> beAr <17> ahhhh :) got my guest windows :) <18> I want to save some text from a <TEXTAREA> input ...what should I do? I want then to redisplay that text in a html page. so, I have to strip_tags() and addcslashes() ...what else would it be? and if my db is mysql ...what type should that field have? the text to be saved will be TEXT not binary <17> Fane_3Dfx mysql text datatype <17> save it AS-IS and format the output as you wish <18> xshad: ...I've set the field type to longtext <19> hello. if i use a reference inside a method is it automatically destroyed when method ends like others function/methode wide vars or d i have to unset it manually ? <18> xshad: so ...I'll save whatever the user typed and when returning it I should parse it, right? <17> thats ok <17> yes <17> vinadelmar don't care to unset <19> xshad, what do you mean ? <17> "or d i have to unset it manually ?"/ <17> no <19> it is destroyed automatically then ? <17> local variables, yes <19> even if the local variable is a reference to an attribute of an object ? <18> xshad: one more thing ..shouldn't I call addcslashes before saving it? ...cuz if not, he'll be able to hijack my db by entering smt like '; SELECT * FROM users; <17> yes Fane_3Dfx <17> vinadelmar hmmm... I'm not sure <19> i can't find info about that in the fcking man :) <17> I'm not sure, but I think that they're destroyed <19> i'd say so as well <20> morning all <21> whats the very best php calender, perhaps groupware solution? emphasis on calender, perhaps with outlook integration <20> anyone heard of something call a tracking server
Return to
#php or Go to some related
logs:
ubuntu mbrola how-to #osdev acx unavailable scan radeon x1600 xgl suse w3schools and gmtime
ubuntu kernal sempron #linux gentoo epia-pd10000 ethernet valknut problem fc5 what is 10.SYS
|
|