| |
| |
| |
|
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
Comments:
<kuja> No, the wall. <kuja> The very big black wall surrounding this channel... yes, I'm talking to you. <kioto> you're fun of pink floyd <kuja> If you can't form proper English (at least where I can understand half of what you're saying), please don't speak. <mjec> kuja: had a good day then? ;) <kuja> Just another day :P <kuja> I need a shower. <mjec> bathroom's at the end of the hall on your left, there should be fresh towels in there <CarlH> !rules <CarlH> !guidelines <kioto> kuja i need to choose an abstract layer to use <AzMoo> Does XPath even work with RDF? :\ <CarlH> ok cool, no rule against asking for PHP workers :) --- Anyone here want to work for me as a PHP coder? if so msg me <whyz> hey.. the $_FILES array is just for files posted via forms, right? Am i right in thinking that messing with $_FILES manually would be a bad idea? (i.e. adding stuff to it) <kuja> CarlH: Are you stupid? Do people read the topic at all? <mjec> whyz: well, it's not good practice to do so... why would you? <AzMoo> CarlH, Guideline 7 <CarlH> grrr -- thought I read the whole thing, 'job postings' missed my eyes altogther --- <eml> 'e dot ahlback[ at ]muff dot com' <- I compare two exactly-the-same strings like these, but with strtolower() before, how can they not be equal? <CarlH> there is one PHP channel on one net where that isn't against the rules thought this was it <Getty> whyz: why you would do it? <whyz> mjec: there's this project i'm supposed to develop further. It relies on dump variables, among those $_GET, $_POST and $_FILES .. in order to edit the information i must either mess around in those variables, or take on a new approach <AzMoo> CarlH, thats' efnet <Getty> whyz: aehm <Getty> whyz: why you want to work directly with the variables? <CarlH> AzMoo: efnet ?? are you sure <whyz> ie the variable dumps are used instead of databases or xmls or anything <cb921> i think that if i were looking for work then carlh's propposition would have been welcome... i am here, sitting and reading and working and hey, cash. why not? does it really become a problem? <mjec> eml: var_dump() them to see if they really ARE identical. There might be whitespace <Getty> whyz: my constructor of main has the following: $this->POST = $_POST and so on <AzMoo> CarlH, no, vague recollection. It's quite likely I'm wrong. <Getty> whyz: so why you just THINK about using the internal variables as your storage? <Getty> whyz: never thought 2 steps further? <kuja> cb921: Questioning, debating, arguing the rules will not get you anywhere. <whyz> Getty: i'm not THINKING about storing them that way, they already are <Getty> whyz: you want to change $_FILES <Getty> whyz: thats the point <cb921> kuja well hell where do you think I am trying to get? <kioto> oki kuja i have take some stuff from this intro http://netevil.org/downloads/Introducing-PDO.ppt <Getty> whyz: so copy it before, change whatever you like and let always your function NOT access the original one <kuja> cb921: Straight out of this channel. You could do yourself a favor. <Getty> whyz: thats a solution, its clean and straight........ what is your excuse now? <guru[1]> hi monday <guru[1]> hi sahithya <monday> hi guru <eml> string(31) "e dot ahlback[ at ]muff dot com" string(31) "e dot ahlback[ at ]muff dot com" <- if $var == $var2 should return true yes? <TML> eml: Yes. <eml> ah, it does, perfect :] <eml> hehe :P once again I <Syruss> what's the best/easiest way to check for the existance of a mysql table in php4? <eml> I'm acting drunk, can't even write <MBzle> guys, how do i retrieve the total amount of rows? <MBzle> mysql_num ? <MBzle> i mean: mysql_num_rows right? <AzMoo> tias <Frixon> MBzle: I think you want SELECT COUNT(*) <Frixon> That's somehow optimized. <TML> Unless you're *also* going to return the rows themselves. <TML> In which case you don't want to run two queries. <MBzle> Frixon, thx... this is what i wanted <MBzle> TML, thx <MBzle> but one more thing: after doing the COUNT(*) how can i insert the result in a variable? <Frixon> The same way as with a normal SELECT. <Frixon> You can also use SELECT COUNT(*) AS yourName FROM ... <Frixon> So you can access it via yourName <MBzle> Frixon, after doing: mysql_fetch_array ? <TML> Yes. <MBzle> TML, aight... <Faces\away> so, i have this preg_replace, and i want to replace using a $text[array][key] where array and key are $1 and $2, but i don't know how to put $1 and $2 in the call to the array <Faces\away> $text["string"] = preg_replace("`\[\%ts\:(.+?)\:(.+?)\%\]`i","<b>$text[{$1}][{$2}]</b>",$text["string"]); <Faces\away> is what i've got, and i've tried varios combinations of "{ }" ".$var[$1... etc <Frixon> Faces\away: I'm not sure if the variable interpolation works that way. <Faces\away> so how could it be done? <Frixon> Have you first tried preg_match if your pattern is correct? <Faces\away> yeh <Faces\away> if i do just "<b> $1 $2 </b>" it works fine <Frixon> You could use preg_match, using the optional last parameter, create the replacement from within these results and afterwards perform a regular replace. <Frixon> Or else. Try "<b>".$array[$1].".... <Frixon> Btw...what do you expect of those curly braces? <TML> Faces\away: You shouldn't do what you're trying to do, it can lead to bad, bad things. But the answer to the question is that you have use a special modifier on the pattern that tells PHP to eval() the replacement string. <mazza[W]> they'll run away in fright <Faces\away> hm, so what other way is there? <Frixon> Ah OK. That's what I meant by interpolation. :) <Faces\away> preg_match_ all then go through? <TML> Faces\away: I liked Frixon's suggestion. It sounds nicely constructed. <Faces\away> kk, i'll look into it, thanking you <Frixon> Hm. Didn't know the "e" modifier. :) <TML> Frixon: Sorry for stripping away your blissful ignorance. :) <four_eyes> how do i encode & or ? in the source code? anyone? <TML> four_eyes: php.net/rawurlencode <four_eyes> ok <four_eyes> will it be possible to link to an external site from my site, wherein i can encode/decode the & and ? that is in the url of the external site? <four_eyes> :d confusing sentence. :)) <ace_me> hi all <four_eyes> lolz what a msg style :)) <ace_me> :) <four_eyes> javascript? <ace_me> not necesarly but yes please <ace_me> is better not posting if he doesen't press a key <four_eyes> ? <Frixon> ace_me: What excatly is your problem? That an empty input field can occure? <dexta> englighten us <ace_me> thank you frixon <Frixon> No problem. <Frixon> I don't know what I did...but OK. <ace_me> I've just inserted an if empty(... :) <Frixon> I wouldn't do that. <ace_me> in fact that was the problem <Frixon> User != '' instead of emtpy() <Frixon> -r <Frixon> empty() has a very strange way to determine what's empty and what's not. For example "0" (string) is seen to be empty. <Frixon> And since $_POST data is always a string, you can use != '' <kuja> Frixon: It's not strange. <Frixon> kuja: Yes...but not always useful. <Frixon> I really don't like empty() <ace_me> In my case was a id of an item <ace_me> so it's ok with empty ! ( a search function) <kuja> Frixon: (array() || 0 || null || false || '' || "") === false <Frixon> kuja: I know what empty()n does, thanks. <kuja> So, that's what empty() does, no abnormality. <ace_me> I will fill it with current id and set a msg to please input a sequence <kuja> Frixon: Well, just pointing out that even if you don't use empty, and just do if ('') it's still false :) ...I know what you mean, though. <Frixon> irb(main):002:0> "0".empty? <Frixon> => false <Frixon> That's how I like it to be :) <kuja> Ruby's types are different. <Frixon> I know. <kuja> Ruby doesn't have a concept of "undefined variables" <kuja> foo.nil? #=> true <Frixon> irb(main):003:0> defined? a <Frixon> => nil <kuja> I like Ruby's way of doing it too. <kuja> Less things to worry about, and you're always sure that nil and false will always fail on boolean expressions. <kuja> Whilst everything else is true. <Frixon> Well...Ruby plays in another league than PHP does. :) <kuja> PHP is no comparison to Ruby :) <kuja> Ruby and Python are comparable, but Python and Ruby are not comparable to PHP. <kuja> Simply, cause PHP is naturally meant to work with web applications, while Python and Ruby naturally aren't. :P <Frixon> kuja: Have you had a look at rails yet? <Frixon> kuja: Fantastic framework. Very powerful. <kuja> Frixon: Yes, but that's a framework, not the bare language. <kuja> I'm saying you can't compare PHP and Ruby as bare languages, cause PHP will always be better at what it does. <kuja> And vice versa, Ruby will always be better than PHP at what it does :) <Frixon> Yes sure. PHP was designed for web applications.
Return to
#php or Go to some related
logs:
#linux #oe #css #ubuntu #perl make install SDL_image with Dev-Cpp nvidia api mismatch linux xorg gentoo #oe resolveconf debian 2.6.8 CONNMARK
|
|