| |
| |
| |
|
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
Comments:
<0> okay, so I can do like if($bla[$i] == '') { unset ($bla[$i]); } <1> i'm pretty sure yes <0> Is it really removed then? <2> Yes <1> unset i believe is the way, if there isnt an array function to do so <0> so if $i = 10, then $bla[10] does not exist? <1> i'm rusty with some bits of PHP <3> hi <3> does anybody have any link where I should read about sending files throught headers ? <2> Cavallo: "Don't"? <2> You shouldn't send a file through headers. <0> Cavallo: Do you want to force a download? <2> Headers are simple key:value pairs, and should be kept to those supported by the RFCs. <2> If you're going to add some, make sure to use the X- namespace, but I'd strongly urge you NOT to send a file in a header unless it's a VERY tiny file <3> I mean to refer user to file.php and then user can dl file. So if file is txt user will get download window and not to open it in browser <0> Cavallo: Yes that's possible... let me check...
<0> Cavallo: I use this for doing what you want: http://pastebin.com/624630 <0> Cavallo: Did you get the URL? <2> "application/force-download"? <2> Just making up our own MIME types now? <1> lol <0> Hmm... I think its a fix for a certain browser problem... I cant remember where I found that snippet... not made by me... but works fine in all browsers ive tried though =) <4> Greetings! <1> there is working, and there is tuned :P <1> large difference <0> true =) <2> CopyNinja: Maybe, but it's not strictly conforming to the spec <1> limp along, or run on nitro and a turbocharger <2> Depending on how you feel about that, it may or may not matter <1> although you could argue some hacks are required for cross platform compliance <1> er, compliance is a bad word to use <0> TML: I've only used this once... if you know a better way doing it I would be glad to have it presented =) <2> CopyNinja: Just drop lines 8 and 10, since you can't send multiple headers of the same value anyways, and those two MIME types don't actually exist <2> CopyNinja: In effect, only one of those three values will ever be sent. Right now, unless you've screwed with your config, it'll be "application/download". <2> Which isn't a real MIME type <3> CopyNinja: thanks ;) <4> i'm trying to install PHP for the first time <4> but i can't get Apache to load libphp.so <4> any help would be greatly appreciated <4> libphp5.so: cannot restore segment prot after reloc: Permission denied <0> TML: Okay! Thanks a lot! Always fun to learn :) <0> Cavallo: Read what TML said about the headers-thing... My version works, but is not recommended since its invalid (or however to put it) <2> CopyNinja: Also, note that your Expires header is invalid. It *MUST BE* in RFC 1123 format <2> CopyNinja: e.g., Expires: Thu, 01 Dec 1994 16:00:00 GMT <2> CopyNinja: If it's not, the HTTP spec REQUIRES that all UAs ignore it <0> aha... do you have a link to where I can get more information on headers and its valid values? <2> RFC 2616 <4> TML, could u help me with my simple problem? <2> !tell M3 about u <2> M3: Do you have a simple problem? <4> yessir <2> What is it? <5> hey TML <2> Heyh <2> s/h$// <5> TML: feel like helping me figure out a (should be easier than this) regexp? <4> TML, can I paste the error msg here? <2> M3: If it's less than 160 characters, yes <2> kodekrash: Let's hear it <4> httpd: Syntax error on line 54 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied <2> M3: That's not a simple problem. I thought you had a simple one. <5> TML: I need to explode() a string by any of 3 XML tags -- </string> </base64> </integer> <4> TML, hmm <4> i thought it was simple <4> looked like i've configured something wrong <0> TML: if you have the time... can you please take a look at http://pastebin.com/624645 for me and tell me if this is a good way doing it? and if not, what is wrong with it? The code scrapes a webpage to get available servers and races for each game. <2> M3: It's not. The answer is "Figure out how to adjust your SELinux settings appropriately.", but I don't use SELinux, so I can't help you <5> TML: I'm doing preg_split with the offset option... <4> TML, i'm running Fedora 5 on a laptop <2> kodekrash: preg_split('@</(string|base64|integer)>@' <2> M3: That doesn't tell me anything <2> M3: Figure out how to adjust your SELinux settings appropriately. <5> CopyNinja: is the code _broken_ ? <4> tml, selinux? <2> M3: Yes <5> TML: um... is it that easy?
<0> kodekrash: broken? <4> tml, i'm running Fedora 5 <2> kodekrash: Why wouldn't it be? :) <5> TML: it's regexp :p <2> kodekrash: regex (no 'p') is easy. :) <2> !+regexp <6> regEX There's no P. See the POSIX documentation. Adding a p is a common spelling mistake. <2> CopyNinja: I'm sorry, my attention span for IRC ***istance spans no more than 30 lines of code. <0> TML: okay! thanks anyways :) <5> TML: I owe you an ale matey! <4> tml, but i'm not running selinux? <2> M3: Yes you are <4> ah, <4> tml, i thought i was running Fedora Core 5 <2> M3: You are. <4> tml, obviously i'm lost <7> people, how to read a text file "line-by-line"? <5> M3: selinux is a kernel hack that's part of Fedora and various other distros <5> noppo: file() <2> kodekrash: It's actually part of the kernel mainline <4> thanks kodekrash <7> kodekrash: thx <5> TML: not all distros compile it in... <0> noppo: there are a lot of different ways... file() is one way doing it... you get the file in to a array, line by line <2> M3: Probably because you didn't read the system documentation. Maybe you could try googling for SELinux, or asking a fedora support channel. <4> thanks tml <5> noppo: or, fopen() + fgets() + fclose() <5> CopyNinja: is your scraping code broken? <5> TML: jeebus.... that's fast <2> kodekrash: That's true, my point is simply that it has nothing to do with distros. It's a part of the kernel whether you enable it or not. IDE support is part of the kernel too. <5> TML: lol, true <7> CopyNinja: file() is the one i needed. fgets() contains a lineend symbol at the end of the string <7> kodekrash: fgets() returns a stirng with lineend symbol, which i don't need <5> noppo: trim( fgets() ) <5> noppo: file() is a dog on large files... <7> kodekrash: my file is no more than 101 lines <5> noppo: ah, then file() will be fast enough... I'm currently building a system that has 11-15 MB files to parse... file() doesn't work so well <7> :) <7> no, my file will be <1mb <7> so file() should be ok <2> I'm not sure what that's supposed to mean <8> CopyNinja, Line:38, remove i++; you never define it, and i guess its working, i can see "Atlantean - RK1,Rimor - RK2" on the $matches print_r <5> TML: ok, you may be converting me here... <2> If you're about to announce that you've switched ***ual preferences, you don't get to blame that on me. :) <5> from non-regex to regex <5> I've NEVER used them in production code <9> FUD! <5> TML: can I modify that regex to give me the contents of the xml tag, and not just explode by end of tag? <9> kodekrash, I recommend buying the Regular Expression Cookbook <5> well... I _know_ I _can_ do it... question is how... <5> X13: O'Reilly? <2> !+regex book <6> Oh, you mean 'Mastering Regular Expressions', by Jeff Friedl, published by O'Reilly and ***ociates. ISBN 0-596-00289-0, on the web at http://www.regex.info <10> YA Reilly <9> Not sure. I have it though. Dozens of examples like "Validating an e-mail address" with example code in bash/perl/PHP <2> Best $45 most programmers can spend. <4> tml, that was easy. i just changed my SELinux setting from Enforcing to Permissive <5> TML: I think the $45 I spent on my keyboard was a good way to spend that money <2> kodekrash: If you're getting deep into XML, though, you might want to look at XML specific tools, instead of using regex and treating it like a string. <4> tml, simple too! once u and kodekrash told me what SELinux was <8> kodekrash, if its okay for you i can give you my cl*** BIGXML.src (can handle 40GBBIG.xml) <2> M3: Stop saying "u" <2> It's not a word <4> tml, sorry and ok <5> Ox41464b: I have my own code to handle stuff... why would I need your's? <8> okie :D <2> Ox41464b: What is "40GBBIG.xml"? <2> Is that part of some reference test suite? <8> a file with extention .xml and have total size 40gb <8> :( <2> your XML filenames are chosen for the size of the file? <2> That seems less than ideal <5> TML: I'm quite good with xml tools... however, they won't work with this particular xml...
Return to
#php or Go to some related
logs:
#debian #perl smergler #ubuntu #asm #css gre ipw2200 pptp Universe repos #ubuntu ubuntu t30 cdrom
|
|