@# 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



Comments:

<0> figures i missed ben
<0> i'm in withdrawal from poutine humor
<1> lol
<2> evulish: do you still need that perl ported to php? or are you sticking with that?
<3> sticking with it for now
<3> the site needs a complete overhaul but not right now
<3> http://www.gocurrency.com/countries/iceland.htm
<3> each of these country pages were manually made
<2> ouch
<3> one for every country!
<0> that your site?
<3> one of them
<4> evulish: tell the rest of the story
<5> anyone works with php and gzip ?
<4> about the freelance
<0> scanf: i have a bit, other people may know, just ask your question



<3> helvete: the rest of the story?
<4> what happened?
<4> were everyone happy with it?
<4> and where were you?
<3> why do you care?
<4> well, why did you start telling?
<4> cos it's fun of cours
<4> e
<3> we hired a guy to rewrite our site
<3> not everyone was happy with it
<4> hehe
<3> i was here, working on my own stuff
<3> ..
<3> thrilling.
<4> the porn
<0> scanf: absolutely not, don't private message people without permission
<0> why is that out of the topic?
<0> one of you losers put it back
<0> scanf: message me one more time and your ISP is permanently ignored, final warning
<5> ok sorry
<5> so
<5> $content = gzuncompress(gzread($fp,1000000)); when i do this i get the warning
<5> Warning: gzuncompress(): data error in c:\programas\easyphp1-8\www\action.php on line 29
<5> why ?
<6> perhaps you could show us some code.
<0> i know exactly why
<0> no code required
<6> well then
<0> scanf: gzread() automatically decompresses the gzipped data
<0> you don't have to further decompress it using gzuncompress()
<0> gzread() is intended as a drop-in replacement for read(), whereas gzuncompress() is used to decompress an entire string you may have obtained through other means
<6> i love it when i can drink rum+coke at work
<5> http://pastebin.ca/149463
<6> :>
<3> jed-: dammit
<3> you beat me
<0> i am all that is man
<3> i wasn't paying attention!!!!
<0> scanf: what i said was directed at you, did you copy?
<5> jed- so gzuncompress is not necessary ?
<0> absolutely correct
<5> let me try :p
<0> gzuncompress()'s usage is tailored toward, say, reading a gzipped string from a database
<3> gzuncompress(gzcompress(gzread($fp,1000000)));
<0> whereas gzread() is a drop-in replacement for read() on gzipped files
<3> do i win a prize?
<6> no
<0> evulish is also correct in that gzuncompress() is gzcompress()'s inverse, and on the flip side of that, gzread() is gzwrite()'s inverse
<5> humm warning disappear but the result is wrong anyway :s
<0> in one line only, without pastebinning, show me what you're doing now
<0> paste only that line
<5> i want do gunzip a http get request
<5> $content = gzread($fp,1000000);
<3> your get request is gzipped?
<3> how the **** did you do that
<3> and why ist in a file?
<5> the response to get request
<5> is gzziped
<0> is your variable "$fp" a file pointer opened with gzopen and not regular fopen?
<3> hahahah



<3> god i hope so
<3> er hope not
<3> because it's funnier that way
<0> gzopen() will parse the gzip file header and set up a regular file pointer structure to p*** to gzread(), whereas fopen() will require you to do an extra step before reading data from the file
<0> http://us3.php.net/manual/en/function.gzopen.php
<0> make sure you're gzopen()ing the file in question
<0> if all you need is the data from the file, ungzipped and in a variable, you can pull something effectively like
<5> its open with fopen because i need $context = stream_context_create($opts);
<0> well
<0> here's the skinny on that, scanf
<0> gzip files contain a tiny header, if i recall correctly
<0> gzopen() parses that header and returns a file pointer ideal for use with gzread()
<5> $fp = fopen('blah','r',false,$context);
<0> yeah, you can't do that
<0> and then expect to gzread() the data
<0> however, try this
<0> using that $fp that you're creating there, try gzuncompress()ing the fread()ed data
<5> the problem is that i can use gzopen because $context :s
<0> i.e. gzuncompress(fread($fp
<0> give that a whirl
<0> the downside is, you'll have to read the entire file into a buffer before uncompressing it
<0> if you're working with small gzips, that shouldn't be a problem
<5> Warning: gzuncompress(): data error in c:\programas\easyphp1-8\www\action.php on line 29
<5> same warning :s
<5> gzips are around 50000bytes
<5> compressed
<0> i'm not familiar with stream contexts, but my gut feeling is to tell you that you'll need to rethink your design here
<5> *5000bytes
<5> what i need to do ?
<0> in a nutshell, if you open a ".gz" file with fopen(), you can't decompress it, you can only read its compressed data
<0> and it seems gzuncompress() doesn't automatically detect that
<5> but its not a file
<0> what the devil is it, then?
<5> its a response to a get http request
<5> that comes gzipped
<4> :D
<0> alright, here's the deal
<0> your best bet here is going to be to tell the ogame server that you don't want gzipped data by removing the "Accept-Encoding" line from your request
<0> because you seem to have bad luck with gzuncompress()
<0> i have a hunch
<0> that the data error is due to HTTP requests having headers included
<0> er, HTTP responses, not requests, i'm sorry
<5> and if the server dont send anything ungizziped ?
<0> here's a short tutorial on HTTP responses
<0> typically, you get headers first and then the actual data
<0> for your gzip request that might look like
<0> Content-Type: application/gzip\r\n\r\n<actual gzipped data>
<0> you follow?
<5> yeah
<5> so i should remove the Accept-Encoding
<0> you'll have to parse that by hand, meaning you'll need to find the actual beginning of the data
<5> from the header
<0> that's the easy way
<0> if you want to do it the hard way
<0> tell ogame you'll accept the gzipped encoding, and then parse the server's response to find the exact location where the gzipped data starts
<5> and if the server dont accept my request ?
<0> read the entire gzipped data from beginning to end, and then p*** it to gzuncompress()
<5> yeah
<6> hrmm
<0> (minus the headers though)
<0> so you'll have to do a little parsing yourself
<6> !validate www.dal.net
<7> Result for www.dal.net: This page is not Valid (no Doctype found)! ( errors) - http://validator.w3.org/check?uri=www.dal.net
<0> a helpful debug hint you might think of doing here is -- just for now -- printing out what ogame's server sends to you and seeing what you have to work with
<6> figures...
<5> jed- let me try
<0> by the way, i used to play ogame, are you writing a new frontend for it?
<5> no
<5> a bot to espionage
<5> :p
<5> i have writed it in java
<5> but i want it in php :p
<0> i won't comment on that odd choice, but okay
<0> you may consider using a HTTP wrapper to implement this, too, which takes care of the HTTP details for you


Name:

Comments:

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






Return to #php
or
Go to some related logs:

#chat-world
#kl
understand whazzup.txt
ko injection
bytecam
#india
beramput
bsnl server hack
#chat-world
#chat-world



Home  |  disclaimer  |  contact  |  submit quotes