| |
| |
| |
|
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:
<0> SimAtWork: where I can find some examples for my work? <1> on google? <2> rbax: what is your work? <2> rbax: oh, the birthday thing? <0> I'm a complete noob in php, don't know from which side I should first get to work <2> rbax: just poke around in the date and time functions. <0> SimAtWork: yes <2> www.php.net <2> it's a very nice resource. <3> would it be something like if !eregi('a-zA-Z0-9\(\)\[\]_\.\', ,$string) <2> Squalleh: you just want strings that don't containt alpha numerics? <4> this is interesting <4> I seem to have an asynchronous var in php! <1> what? <5> absentia: how so <3> i want it to detect if the string has anything that isnt alphanmeric or _,.[]()
<4> I do $rva = blah ( ); and then $v = isset ( $rva['key'] ) ? $rva['key'] : ""; and I get a blank... I do it two lines later, and I get a value! <6> Squalleh: http://php.net/ctype_alnum <1> Squalleh: preg_match <5> Squalleh: preg might be easier, and will be faster <4> I'm not even sure how to start debugging this <4> put s usleep in there? :-) <5> absentia: what's the 2 lines <6> and no, preg_match() is the absolute wrong way to go about detecting non-alphnumerics <4> print 'here1\n"; and explode ( " ", $keys). <1> caffinated: he also wants to check for the []() characters BESIDES alnum <1> !tell absentia about error reporting <6> Stormchaser: ok, fair enough <3> im not too fussed about the speed, each user will probably use the function once so if (!eregi('a-zA-Z0-9\(\)\[\]_\.\,', ,$string)) { die('Bad chars');} should work, yes? <5> caffinated: i think he said _,.[]() are valid too <3> yeah, but just those <2> Squalleh: you really should read up on regexes, they're great, but I think you want something like [\d|\w|\.|\,] and then do if (!preg_match("/[\d|\w|\.|\,]/") <1> ew. eregi. <6> SimAtWork: that won't work <3> i have to make sure the string is safe to put in a url as a $_GET, basically <1> SimAtWork: IIRC, \w already contains \d... <3> so no spaces and nothing to confuse things (like quotes), and no maths operators (for a different reason) <5> Squalleh: why not just urlencode() it? <2> Stormchaser: that's right to <3> cos the user needs to remember what the value is...its a very messy system we had to make to do something <7> Hello, I'm installing php, I can do ./configure --disable-all, but can I do ./configure --enable-all ? <1> damn: try it. <5> Squalleh: IIRC, if you type these things into the Location bar the browser will urlencode it for the user. urlencode() is for when you need to echo it for a browser to understand <6> *sigh* !^[a-z0-9\[\]()_.,]+$!i <6> you likely don't want \w either, because it includes characters which are not alphanumeric <3> whats the +$!I bit mean? <5> Squalleh: well, so long as we are talking about things on the right of the =, the get var names need to be valid php var names <6> + is one or more times, and $ means the end of the subject <8> Does /preg_match_all return false if nothing is found? <2> caffinated: such as? <3> ok sure, thanks <3> and !^ starts it at the front, right? <5> ! is the delimiter and i is case insensitive <6> SimAtWork: read the manual about 'perl words' in PCRE pattern syntax <9> resreses isn't a perl word <3> will that stop people putting spaces into it or not? <5> njdavid: no, read the man page about it returns <6> Squalleh: that regex does not allow a space. add it to the character cl*** if you need it <3> nah i dont want spaces <3> that will work for POSIX style, right? <6> probably <6> i wouldn't though, posix regex ****s <6> use PCRE when you need regex <10> Is ereg officially deprecated yet <3> dont have enough access to play with any kinda config, libraries etc <3> im afraid <10> PCRE is enabled by default <6> Dragnslcr: no, and it never will be <1> caffinated: yes it will In php6. <3> this is liek php 4.0.1 or something <11> Dragnslcr: ereg deprecated itself... but it'll probably exist for quite some time yet. <3> this whole server is 2 versions behind in everything, its very irritating <6> Stormchaser: i don't see why one would bother. posix regex acts a little differently from PCRE, and it's handy to have there for some limited situations where you don't want to rewrite things. <6> Stormchaser: most GNU tools use posix regex <10> Squalleh- well, PHP 4.0.1 is more than 2 versions behind <10> Probably closer to 20 versions behind <5> like 6 version behind
<5> dot dot releases don't count <12> Doesn't matter how many releases behind it is. What matters is how old it is. <13> hi <13> how can I check if a string is an integer? <5> Squalleh: BTW, 4.0.1 is a m***ive security flaw waiting to explode on you. <12> And 4.0.x is no longer security maintained, so _that_ is a concern. <6> Juanjo-ar-stafe: http://php.net/ctype_digit <3> meh, theres nothing on there thats epecially secure :p <13> I have see is_numeric() and is_int() with no result <8> what does preg_match_all return if there is no match? <3> anything ive coded is a m***ive security flaw in itself, really <6> njdavid: http://php.net/preg_match_all <10> "Returns the number of full pattern matches (which might be zero), or FALSE if an error occurred." <12> Juanjo-ar-stafe: Well, those are the functions that do it.. <14> njdavid: "Returns the number of full pattern matches (which might be zero), or FALSE if an error occurred." --http://php.net/preg_match_all <1> caffinated: I watched a RoR presentation entitled "Why did I ditch PHP for RoR"? And the first few senteces were "YEah, I ditched PHP because it's crap... blah blah... and it's POS"... I went o.O Then I was listening for almost an hour about the "beauty of Ruby" (which he never shown), and most of the time he babbled about the installation of RoR. I thought I'd die laughing... <6> Stormchaser: in any community there is going to be a few idiots. <1> caffinated: It's scary... <6> Stormchaser: take this one for example. we get some amazing questions in here. <5> s/few/mind boggling number/ <14> I tried installing RoR on a Windows box running Apache at one point, just for fun. If you try to install anywhere but the server root, you're asking for trouble. :P <15> Hi. Does anyone happen to know when phpMyAdmin first grew that point and drool installer (which version)? I'd like the version before that. <6> Stormchaser: my biggest problem with you coming down on it is that you don't have enough experience with it to actually say that it's good or bad. <16> I'm using a syntax highlighter to make a pastebin, all is going great, and it works fine, but GeSHi (the highlighter) outputs double quotes in my HTML >.< I tried to make a regex to replace all double-quotes outside of <*> tags with ", but I can't seem to get it right <5> noodl: they have an installer? apt-get install phpmyadmin works so well... <17> this looks better than ruby http://www.symfony-project.com/ <15> ||cw: A web based one for building up the configuration file. I was happier with munging to bundled one personally. <6> Stormchaser: and frankly, if you're going to base your critisisms on the idea that one person writes a stupid article, then you should really have a look at what some people write about PHP as opposed to other languages. <14> therock: I've heard of symfony, but haven't had a chance to try it yet. I'm inferring from you saying "looks" that you're in the same boat? <1> caffinated: I think my sole problem is the overhyped framework / language. Yes, I know, that sometimes hyped things are okay, but that's just me... That, and I heard Python is faster than Ruby ;) <17> Elazar: i heard is based on Pear, soo that makes it interesting <15> liat: You need a regex engine with super powers from another universe to reliable parse sgml. Better to use sax etc. if possible. <16> :o <18> I have difined a cl*** in a file, I include the file and I instansiate an object of that cl*** -all is good- then I call a cl*** method using the object and I get the error 'Call to a member function on a non-object'... I understand this is a common mistake of some sort, any pointers please? <16> but... but... <5> therock: I tried that once, failed to make it work like its supposed to <16> it's perfectly clean HTML <1> therock: http://www.django-project.com is better. <12> Stormchaser: No dash. <16> perfectly valid, all except for those _DAMN_ doube-quotes <1> no dash? <18> Ooops! It was a typo! <17> http://www.symfony-project.com/ <17> errr http://www.djangoproject.com/ <6> Stormchaser: overall, it is a better methodology. it is cleaner, more concise and to the point. there is less legwork involved. it is, from many points of view, far more flexable than most things i've seen written in php. I can say this because I've spent 6 months with it now. <17> python still alive?? i head from php community it will die after php5 years ago <17> heard* <1> caffinated: That's why I prefer Python over PHP... Too bad we don't use it at work :/ <14> therock: Alive and kicking. :P <6> Stormchaser: i mean, the idea that I can properly mock objects and do proper unit tests without adding something that feels like a messy cludge of strap-on code is enough to make me not want to use php anymore. <6> Stormchaser: of course you do. you know it. you do not know ruby. <1> caffinated: I never, EVER needed flexibility of Ruby, so... <18> Stormchaser, I prefer python too but we too use PHP at work <6> Stormchaser: anyhow, if you want to argue the merits and the failings of the language and/or framework, please, please, please spend the time it takes to actually learn it first. don't sit there and try to decry it because you think it's overhyped. <3> if (!eregi('!^[a-zA-Z0-9\[\]()_.,]+$!i', $url)) <3> crap <3> i wrote the function wrong didint I <1> yep <6> Squalleh: use preg_match <6> Squalleh: i told you this already. that regex is written for PCRE <3> ah right k <3> well the problem with it is it thinks everything is a bad char <9> caffinated: good luck with that... most people won't invest the time required to really learn a language that they're just intending to rip apart <11> caff: Is not liking a fundamental 'feature' of a language sufficient to dislike the whole thing? Not saying the language has merit or failings, just reason enough to hate it? <6> Ahroun: if you don't know the language well enough to actually do something useful in it, you probably don't have any business being critical of it. <11> caffinated: Oh, not being critical. Just hate it already because of the way it's designed. Other people's mileage may vary. <19> $mail->to("test@test.com); -> how can I use a variable $foo in this? like this $mail->to($foo) but something is wrong :( <15> liat: Surely <"> is allowed in sgml cdata anyway? Quotes are only a problem in attributes, iirc. <16> no <6> Ahroun: then one should probably hate PHP from the get-go <16> I want <*> " <20> what does a function declared with an & do? like function &something() <21> is there a php script that offers directory listings? <16> to be replaced with <*> "
Return to
#php or Go to some related
logs:
quadro fx 4500 nvmixer Efnet Python Wiki :Python Snippets manually compile vlc for dapper wmv #osdev #asm #php buttons_inner ubuntu 3dlabs oxygen vx1 #perl gentoo jpg gimp unknown file type
|
|