| |
| |
| |
|
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
Comments:
<0> no... things like $var="FS"; print "$v[$this->{$var}]"; <1> yep, i did <2> absentia: Or print "foo".$this->whatever."bar"; <0> tml: ya, that's why my co worker does. <2> absentia: It's cheaper than a copy <0> like I said, I tend to do it that way, vs the {} ... that's all. <0> true <3> NBrepresent: post a link with your question and pray <4> tempest_: Where is this encapsulation found at php.net docs? <0> I need to slow down my php anyway.... it's too fast. <2> I prefer not to use {} in my code, unless it's delimiting a block <0> exactly. <2> So I leave interpolation <2> "".foo."" <0> I'm writing php as a proto type for c++ .. I barely use 10 fuctions in php ... so my code is simple. there's just lots of it -- but it translates line by line to c++
<2> That's an impressive C++ library you've built <5> it's at http://perry.pastebin.com/650725, and i'm warning you, it's ugly. <2> Care to open source it on sf.net? <2> I'm sure others could make use of it <0> no, what I mean is... I'm just manipulating strings... so I don't need much more than explode, l/r trim, strpos strlen fread/fwrite .. <3> NBrepresent: it's not bad <3> NBrepresent: the fact taht you use === makes me happy :) <5> philip: it seems redundant <5> some of it is borrowed from tutorials, etc. <6> where can i download a php script that converts a binary safe string of a png to a bmp and viceversa <7> NBrepresent: first, and in my opinion, most importantly, separate logic and presentation. Your main code should just set variables, and then at the end, call a file which echoes all the html with variables. <8> Keal: CPAN <5> ok. but all in the same file? <6> what is CPAN? <9> NBrepresent: instead of echoing code line by line, just close off your if/elseif/else statements after the brackets with ?> and then your html code and then open up your <?php and close your statement <0> ha! <3> NBrepresent: use foreach instead of while/each <7> NBrepresent: if you want, but if you split the html into a different file, then you and put it in several different files and call one, depending on what you want to do. <6> [RainMkr] what is CPAN? <3> ask #perl what CPAN is :) <8> php-bot: tell keal about google <6> [RainMkr] i am looking for a php script not a perl/cgi script <10> Keal: whatcha think PHP is? <11> hmmm <6> Perl Hypertext Preprocessor? <3> php isn't written in perl :) <7> NBrepresent: btw, line 52 has a relatively common bug. You use = instead of ==. <10> it is CGI though <3> sometimes <0> ha <8> Keal: No, Philip's Hypertext Processor <12> http://pastebin.com/650727 <-- can someone take a look at this function for me.. im making a session variable $_SESSION['registered'] using $this->registered yet, calling while (list($k,$v) = @each($_SESSION['registered'])) { yields no results.. <5> CryWolf: i've been looking for how to fix that! <5> my 'add link' form was displaying on every link category page <3> heh <5> CryWolf: what's the difference? <7> = is ***ignment <6> foreach($_SESSION['registered'] as $k => $v){} <6> right? <3> yes <2> Ruxton: for starters, use foreach() instead of that while loop <2> Are you all reading the same PHP3 book, or what? <6> does Ruxton want to use-> foreach($_SESSION['registered'] as $k => $v){} <2> Yes <2> At least, he SHOULD want to. :) <12> i just did it the way i've done it for the past.. 2 years, unfortunately havent coded php in the last 1 or so <12> so yeah.. ill go change that :P <2> Ruxton: Even 2 years ago, you should have been using foreach(). :) <3> Ruxton: do you access you.com/a.php?foo=bar as $foo too? :) <2> Even *4* years ago <3> he was writing code that was BC friendly :) <12> phil.. used too.. but not anymore <6> philip $_GET['foo'] <0> ok, 232mb up in 23 seconds. <3> Keal: you are a wild man <9> mkdir("../client_upload/$dir_name", 0666); <9> sorry <9> mispaste <6> mkdir $_SERVER['DOCUMENT_ROOT <0> ok, 232mb down... server php process nevre usd more than 23mb rss and started at 5% cpu after the initial fork and mallocs... but then went down steadily...
<9> anyone know why the mkdir command would create a dir with 0644 permissions even though I specified 0666? <6> function rsubstr($a,$b){return substr($a,strlen($a)-$b,$b);}function trunc_root($a){while((rsubstr($a,1)!='/')&&(strlen($a)>0)){$a=substr($a,0,strlen($a)-1);};return $a;};$absolute_root=trunc_root($_SERVER['DOCUMENT_ROOT']); <6> use that instead of '..' to go in one folder from document root <9> mkdir($_SERVER['DOCUMENT_ROOT']."/client_upload/$dir_name", 0666); <9> that should work, should it not? <6> you can hide stuff inside there you obviously have found out but do not use .. <9> Keal: what do you mean? i don't understand what you just said :( <6> .. has a chance of screwing you over if you move the script or the folder to a new location <11> how would I add a value to an array and then check if $whatever == any of the ones listed in array? <11> >< <9> i know, that's why I switched to just using $_SERVER['DOCUMENT_ROOT'] and then specified the path name <9> that should be safe, should it not? <6> simply use either $_SERVER['PHP_SELF'] or $_SERVER['DOCUMENT_ROOT'] in order to mark off the relative location and instead parse the path itself <6> rather than use '..' <9> i know, i killed the .. as soon as i saw your first comment <9> it now reads <9> mkdir($_SERVER['DOCUMENT_ROOT']."/client_upload/$dir_name", 0666); <6> it might be convenient but it makes for foulups if the script location changes or the target path changed <6> where is client_upload located? <9> its a folder on the root of the directory for the virtual server <3> mugger: in_array <6> DOCUMENT_ROOT is where all your url accessable files are <6> one folder inside that it non accessable by url <6> is* <6> is non <7> I think I'd avoid long unreadable expressions like the plague. I'd set a constant defining the upload dir at the very beginning. If directories move, then you've only got one easy-to-find thing to change. <6> that is what i meant CryWolf <7> Keal: you gave a long unreadable expression. <6> parsing document root to obtain the path from the very beginning <6> it was two functions and a call to one to create the path of the folder containing document_root for use at the beginning of the script <9> for mkdir, is it relative to the document root of the webserver or is it relative to the filesystem structure? <6> containing as in there is a folder inside it equal to $_SERVER['DOCUMENT_ROOT'] <6> all file procedures are relative to the filesystem <9> that's what i thought <6> the filesystem' <9> just making sure <6> the filesystem's deepest root is defined by the server <6> permissions determine the deepest root that php can access <9> alright, so I will just define the filesystem path in a constant and go from there...but that still doesn't addresss the file mask not being properly set on the server, or am I over looking something/not understanding something about permissions? <6> the server var $_SERVER['DOCUMENT_ROOT'] determines the deepest accessable by url <9> i understand that <6> oddly php is missing the $_SERVER[] tag that describes the deepest root accessable by php <6> which is what that long *** expression i wrote guesses at <9> gotcha <9> alright, that makes sense now <6> deepest root accessable by php <6> which is usually where the upload folder is located within and where the cgi-bin is located within, and logs etc <6> brb i need a smoke <13> Hey, if I have a string that is storing a date(m/d/y) is there a way I can pull the month number right out of that string? <0> ok, just got 21MB/sec download via php... that's good 'nuff for now. <9> Keal: thanks for all the help...i really appreciate it <6> hi <14> hi <14> how to delete all whitespaces on a string? <8> rogozhin: str_replace() <14> thx <8> lig: I'd image that is quite a humorous read. <15> actually he is being very nice for idiots like me who have no clue... this time he is using the Y! library to explain ajax again <16> ... i can run my knuckle across the wrist part of this thinkpad and it leaves a white line........ this cant be good <9> in a preg_replace, how do I have to enclose the filter? like "[^a-z0-9]" or someother way? <8> just like that. <9> okay, well, it isn't working or something, because it is still matching spaces... <16> /[^a-z0-9]/ <16> ive found you need the /'s ? <9> okay <9> thanks <8> Ah, sorry. <16> that aside, doesnt ^ mean not... <8> lig, google for it. I just learned about it three days go. <15> [RainMkr] there now :D <17> devians: in a character set, it means "any character except" <15> isn't it being introduced to php?...
Return to
#php or Go to some related
logs:
Vaio Specs for F580 -Battery -Picturebook -128MB -HP -ebay -adapter -prices
#kde usr initramfs erro #php ubuntu wpa ferrari rccups restart ubuntu #debian open_wr: /newroot/dev/pts/1 5.7.1 relaying not permitted thunderbird #web
|
|