@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
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 35 36



Comments:

<0> I was thinking maybe base 64 encoding a tar file
<1> i'm writing a web app for someone, and it includes avatars, and to avoid uploading the iamges to my server (for security reasons) would it be safer if i were to let them input a URL to the image for them to use, which i would then try and download the image, use `file` on it, to make sure its an image, etc?
<2> Come on you gurus ;(
<0> but then I need to extract it
<3> uh... I'm trying to corellate what self extracting and FTP ... hmm
<4> Gorbulas|iBook, why don't you just have a script upload it like a normal file upload
<4> and then try and use system calls on the tar to extract it
<0> because there are lots of small files
<0> oh
<4> if not, there is a zip reader archive you can use in PHP too if you can't call system calls
<0> I don't know if they have tar available to me, but I can check
<4> *archive = library
<2> How do I setElementTemplate on a textarea element?
<5> I've got a function that doesnt return anything, rather it prints all of its output to the browser... I dont really feel like wasting the time to go through and return a string. How can i capture the output of that function into a string?
<3> ob_start
<4> output buffering (ob_start)



<3> ob_get_clean
<3> ob_end
<4> yes..
<3> or find/replace print|echo with $out .=
<6> when including, is there a way for the included script to know its path?
<7> just wondering, does it make any good practice to write codes like INSERT INTO `mytable`.. compared to INSERT INTO mytable , without the backticks for the later
<8> ramirez: you can use reserved words when using `
<9> how can I access all the 'command' keys of a multidimensional array? foreach($multiarray['command'] as $command) doenst.
<10> marccd: Pay closer attention to the foreach manpage.
<9> mattmcc: will do
<8> ramirez: http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html that's what I use it for at least.
<10> Or, really, just to how arrays are structured.
<10> You probably mean that each element of $multiarray is an array which has a 'command' key.
<10> Not that $multiarray has a key 'command' which has an array in it.
<7> right, personally i dont see any real benefit, it fact it really does obfuscate codes with there is a mix of backticks and quotations like 'INSERT INTO `'.$tablename.'` VALUES..
<11> marccd: foreach($array as $key => $value) if ($key == "command") foo;
<9> spuds: that kinda ****s, but ok, I thought about foreach($array as $iterated) { foreach $iterated['command'] as $command { foo } }
<10> marccd: That would work if $iterated['command'] contained an array.
<12> nested foreach. yum.
<3> heh
<12> it's friday. it's 4:00. should i stay another hour or go home early? hmmm...
<9> mattmcc: will do that, thanks
<13> if u go home i will too
<10> It all depends on the structure of your arrays.
<13> and it's only 1 here
<13> :)
<13> lol
<13> actually i'm having fun renaming most of the cl***es in an entire product.
<12> SDE: 10 cl***es?
<13> about 40
<9> mattmcc: well with the example spuds gave me I would access the value of 'command' with $value['command'] right?
<10> marccd: That's what would happen, if the array was structured accordingly. We're all just guessing, because you haven't given us an example of your array.
<0> will php short tags ever get phased out?
<14> how do I round a number to the nearest factor of "25"
<15> Gorbulas|iBook: doubt it.
<14> including "0"
<0> I wish it would go away
<15> why/
<9> mattmcc: I understand, it works, thanks :)
<16> myconid: I wouldn't hold to that, seeing as they just removed safe_mode, magic_quotes* and register_globals for PHP 6
<0> I want to say <?xml
<2> Argh, how do I get more than 1 thing on the same line? wtf
<15> Davey: all useless features..
<16> myconid: as is <?
<10> Gorbulas|iBook: You could just turn short_open_tag off in your ini file.
<12> i'm happy to see every one of those things go
<15> Davey: thats hardly useless..
<15> short tags wont go away.
<0> I do that on my own servers but I can't do it on this host
<13> Urthogie: you could use the modulus oporator and count how many up, and how many down to find out what is closest. i dunno an easier way.
<10> Gorbulas|iBook: Alternatively, you can echo '<?xml foo'
<16> myconid: its broken, incorrect and not always turned on making it a portability nightmare
<15> Asp isnt going to stop supporting <%
<0> but I don't want <?php echo '<?xml'; ?>
<15> Davey: Ive yet to see it turned off on any major isp
<0> myconid: yes, but who makes ASP?
<10> Gorbulas|iBook: Well, then you have a problem. You've rejected all the solutions.
<16> but <% doesn't conflict with XML PI
<10> myconid: There's nothing wrong with <%



<16> Gorbulas|iBook: turn it off in .htaccess
<10> <?, however, was stupid for PHP to support in the first place.
<13> while ($n % 25 != 0) { $upcount++; $n++; }
<0> oooooooo
<12> Gorbulas|iBook: how about write a function XML_Open() { echo '<?xml'; } function XML_Close() { echo '?>'; } then you can just call those functions whenever needed.
<16> wow b1n0ry thats one of the worst Ideas I've ever heard
<16> were you dropped on your head as a child?
<0> but <? XML_Open() ?> is much longer than <?
<14> SDE:there has to be some math genius way of doing it
<2> Is there a way to save a QuickForm render to a string >?
<14> sde:that doesn't require a lot of work for the processor
<15> davey: why are you trying to parse XML files with php anyways?
<15> dont call your .xml .php and you shouldnt have an issue
<12> Gorbulas|iBook: my aim was for readability, not line length
<16> myconid: who says I am? :)
<0> I'm trying to send xml from php
<10> Gorbulas|iBook: Get over the length issue.
<15> I dont see why you would have an xml vs php issue
<16> myconid: but the same as you can mix HTML and PHP, you can mix XML and PHP
<0> and php is getting in the way
<10> Gorbulas|iBook: If you can't disable short_open_tag, then some extra length is your only other option.
<13> Urthogie: you are only counting up a maximum of 25 times. it's a simple math function. i doubt it.
<15> So its NOT ok for <? for php.. but it is for xml?
<16> September 2006 come along already!
<16> myconid: no, XML uses <?xml
<10> myconid: XML doesn't use <?, it uses <?xml.
<15> Davey: whats sept?
<16> myconid: Zends new IDE :)
<14> SDE:The thing is I want to do this for 500 also
<12> is it possible just to make the first line of a script something like: <?php ini_set('short_open_tag','off'); ?>
<10> No, by then it's too late.
<16> b1n0ry: no, it can't be set at run time
<12> i don't know, just curious
<12> brainstorming at the risk of sounding like an idiot
<10> You'd be attempting to tell the parser how to parse, after it's already started parsing.. :)
<13> Urthogie: same thing: if( $i % 500 == 0 ) { // $i is divisible by 500 evenly }
<16> mattmcc: actually, by that point, its done parsing ;)
<14> SDE:But I'd have to incremement by 250 at lease
<14> *at least, sometimes
<13> Urthogie: oh i see, then just round up to the next hundred and incremenet by 100
<14> ah true
<14> because all 500's are divisible by 100
<13> right
<14> still, its a lot of incremementk
<2> How do you add a rule to a group member in HTML::QuickForm?
<3> addGroupRule?
<2> hmm
<6> when including, is there a way for the included script to know its path?
<2> thanks
<3> xeer: I still haven't thought of a way unless you check the include_paths yourself
<17> $_SERVER has some useful data for that
<1> i'm writing a web app for someone, and it includes avatars, and to avoid uploading the iamges to my server (for security reasons) would it be safer if i were to let them input a URL to the image for them to use, which i would then try and download the image, use `file` on it, to make sure its an image, etc?
<12> Davey: so why would something like this be a bad idea? http://pastebin.com/595188
<18> why does every ****ing company only have projects with php. PHP IS BORING.
<3> and ASP is fun?
<18> thank you for listening {:=)
<1> HS^: regardless if that's true or not, you could be gotten for trolling for that :)
<18> not really.
<18> i just fall asleep from php
<3> that's because PHP does do antyhing
<10> Maybe the problem isn't the language you're using, but the nature of the project you're doing.
<12> i pretty much fall asleep from anything
<3> YO have to do stuff with it
<19> I'm trying to duplicate the first example on http://ca3.php.net/manual/en/function.preg-replace.php but it's not working. I figured this would be a simple job to replace entities with ''. My goal is to replace all shown in the function with ''. Not convert the values to text equivalent. However it's not working, nothing is changed on my string. See the function I created, http://pastebin.com/5951
<19> 87.
<20> mattmcc: No, it's the language. ;)
<1> yay! after 2.5 hours i finsished my database design.
<3> now you get it?
<10> After all, writing a calculator in one language isn't likely to be more exciting than writing it in another language.
<10> "Oh, wow, these operators are so much cooler than calling those boring functions in that other language"
<18> i just hate web programmings i think


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #php
or
Go to some related logs:

pl2305 module
suse texconfig texmfmain not found
python, eg for strptime( date_string, format)
setrootpassworderror gentoo
google transelat
#physics
difference sux su
kubuntu kontact sx1
#gentoo
#lgp



Home  |  disclaimer  |  contact  |  submit quotes