Re: [PHP] gzuncompress() Not Working.

2007-11-07 Thread heavyccasey
In my tests, Python can parse both Adler-32 and CRC32, while PHP can only do Adler-32. Anyways, I shortened my function: function fixAdler32($data) { static $f; if (!isset($f)) $f = tempnam('/tmp', 'gz_fix'); file_put_contents($f, "\x1f\x8b\x

Re: [PHP] gzuncompress() Not Working.

2007-11-07 Thread heavyccasey
They're exactly the same, except of the last 4 bytes. Python calculates them differently than PHP. PHP follows the standards, Python does not :] This would be more concise if PHP included the gzdecode (http://us2.php.net/gzdecode) function. On Nov 7, 2007 12:12 AM, Per Jessen <[EMAIL PROTECTED]>

Re: [PHP] gzuncompress() Not Working.

2007-11-06 Thread heavyccasey
The documentation for zlib says that it expects an Adler-32 checksum at the end of the file. PHP follows this [largely outdated] standard. Python, on the other hand, doesn't, and uses a different checksum, CRC-32. That's why it won't decompress. But I've written my own function and it's working

Re: [PHP] gzuncompress() Not Working.

2007-11-06 Thread heavyccasey
Alright, I think I know the problem. PHP's gzuncompress uses the Adler-32 checksum at the end of the zlib, while Python uses CRC32. Why must you follow the standards, PHP!? Does anyone know of any workaround? On Nov 6, 2007 7:03 AM, <[EMAIL PROTECTED]> wrote: > I left that empty. The decompres

Re: [PHP] Memory Allocation Error

2007-11-06 Thread heavyccasey
Thank you! That works. On Nov 6, 2007 12:23 AM, Per Jessen <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > > Hi! > > > > I have a script that reads a 120 MB remote file. This raises a Memory > > Allocation Error unless I use: > > ini_set('memory_limit', '130M'); > > > > I doubt th

Re: [PHP] gzuncompress() Not Working.

2007-11-06 Thread heavyccasey
I left that empty. The decompressed string is about 224 KB, so it shouldn't throw an error. Thanks for the reply! On Nov 6, 2007 12:25 AM, Per Jessen <[EMAIL PROTECTED]> wrote: > Casey wrote: > > > When I try gzuncompress() on the same data (I checked), it returns a > > "Data error". I also trie

[PHP] Memory Allocation Error

2007-11-05 Thread heavyccasey
Hi! I have a script that reads a 120 MB remote file. This raises a Memory Allocation Error unless I use: ini_set('memory_limit', '130M'); I doubt this is good for my server... I tried both fopen and file_get_contents. This used to work fine in PHP 4 until I upgraded to PHP 5. Any ideas? Th

Re: [PHP] mysql_fetch_array

2007-11-04 Thread heavyccasey
Do you even need reset()? I've never used it. On Nov 3, 2007 11:08 PM, Jim Lucas <[EMAIL PROTECTED]> wrote: > Eduardo Vizcarra wrote: > > Hi guys > > > > After doing some changes, I believe it is partially working, what I did is > > the following: > > while($row=mysql_fetch_array($fotos)) > >

Re: [PHP] Newline

2007-10-28 Thread heavyccasey
I use echo 'Blah blah blah blah blah.'; On 10/28/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > On 10/28/07, magoo <[EMAIL PROTECTED]> wrote: > > > > Hi NG! > > > > I have switched to using single quotes, and found out that newline (\n) > > only > > works in double quotes. It looks kind of stupi

Re: [PHP] Timeout for fopen ?

2007-10-13 Thread heavyccasey
You could use Javascript/XMLHTTP to call a PHP script that opens the file. On 10/13/07, debussy007 <[EMAIL PROTECTED]> wrote: > > Hello, > > I want to use "fopen" to open an URL, but is it possible to add a timeout ? > This to avoid that fopen slows down my script ? > Because if site I access take

Re: [PHP] A two flavored post

2007-10-06 Thread heavyccasey
ALSO: can be altered to be: What exactly do you need to do, anyways? Maybe there'll be some better way to do this. On 10/6/07, tedd <[EMAIL PROTECTED]> wrote: > At 1:49 PM -0400 10/6/07, Robert Cummings wrote: > >On Sat, 2007-10-06 at 13:41 -0400, tedd wrote: > > > Unfortunately, my solutio

Re: [PHP] A two flavored post

2007-10-04 Thread heavyccasey
A simple example would be Click here On 10/4/07, Robert Cummings <[EMAIL PROTECTED]> wrote: > On Thu, 2007-10-04 at 22:33 -0400, tedd wrote: > > Hi gang: > > > > I asked this question on the javascript list, but for some reason > > it's taking forever to post there. So, I figured that I would ask

Re: [PHP] str_replace oddity

2007-09-22 Thread heavyccasey
So replace ' \" ' instead of ' " '. On 9/22/07, Jim Lucas <[EMAIL PROTECTED]> wrote: > Kevin Waterson wrote: > > I am using str_replace to strip double quotes. > > > > $string = 'This string has "quotes" in it'; > > > > $string = str_replace('"', '', $string); > > > > this seems to work, yet when

Re: [PHP] MIME type

2007-09-11 Thread heavyccasey
Look up readfile(); Make sure you read the comments. On 9/11/07, Angelo Zanetti <[EMAIL PROTECTED]> wrote: > Hi guys. > > I am linking to a file on a WAP site. the backend is written in PHP. > However I need to link to a file but set the content type. I've done the > following and am wonderin

Re: [PHP] Parsing Variables Inside a String

2007-08-15 Thread heavyccasey
Thank you so much! :D On 8/15/07, Sanjeev N <[EMAIL PROTECTED]> wrote: > Consider the variable name inside database is 'emp_name' and now you want to > use this as $emp_name.. > > This variable will be stored in as follows > $variable1 = $resultfromdatabase['variable1']; > > Then next step is stor

Re: [PHP] Parsing Variables Inside a String

2007-08-15 Thread heavyccasey
I need to get the variable names from a database. On 8/15/07, Chris <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, is there a function that can parse variables within a string? > > > > For example: > > > > $good_day = 'The'; > > $fr['iop'] = "y're crazy!"; > > > > $new = '$good_day$

[PHP] Parsing Variables Inside a String

2007-08-14 Thread heavyccasey
Hi, is there a function that can parse variables within a string? For example: $good_day = 'The'; $fr['iop'] = "y're crazy!"; $new = '$good_day$fr['iop']'; echo TheFunctionIRequest($new); // They're crazy! Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http:/

Re: [PHP] www.soongy.com

2007-08-14 Thread heavyccasey
Yes, add a scroll-bar. Middle-click works, for those who wants to read. On 8/14/07, Bastien Koert <[EMAIL PROTECTED]> wrote: > > Looks nice, but you need to have it adapt to screen resolutions...the fixed > size of the page doesn't allow for scrolling etc...does not fit well on a > 1400x900 lapt

Re: [PHP] Re: Pirate PHP books online?

2007-07-16 Thread heavyccasey
I don't see why people need to buy the books. I learned PHP buy borrowing one book from the library, then using php.net for more advanced functions. On 7/16/07, Man-wai Chang <[EMAIL PROTECTED]> wrote: You have to draw the line between: 1. a book 2. a secret By not allowing customers to sample

Re: [PHP] Re: Pirate PHP books online?

2007-07-16 Thread heavyccasey
I just use the library.. On 7/16/07, Man-wai Chang <[EMAIL PROTECTED]> wrote: > I have to agree with Col on this one. Books are not shareware, freeware > or open source. They are written for profit and anyone wanting to pirate Not really. You could open a sample book in bookstores, scan the cha

Re: [PHP] Re: PHP Brain Teasers

2007-07-06 Thread heavyccasey
Isn't this a PHP list? Why is there discussion about chickens? if ($this == "PHP List") { unset('chicken discussion!'); } On 7/6/07, Robert Cummings <[EMAIL PROTECTED]> wrote: On Fri, 2007-07-06 at 21:40 -0400, tedd wrote: > At 10:24 AM -0400 7/6/07, Robert Cummings wrote: > >On Fri, 2007-07-06

Re: [PHP] PHP Brain Teasers

2007-07-05 Thread heavyccasey
To be.. or not to be? On 7/5/07, tedd <[EMAIL PROTECTED]> wrote: 2b || !2b Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Ma

Re: [PHP] explode string at new line

2007-06-05 Thread heavyccasey
That's exactly correct. Except I /think/ you should use "\n" instead of '\n'. On 6/5/07, Davi <[EMAIL PROTECTED]> wrote: Hi all. I've the fowlling string: $_POST["my_text"]="hi...\nthis is my multi-line\ntext"; Can I use explode to have something like: $str[0]="hi..."; $str[1]="this is my m

Re: [PHP] RE: Bounty

2007-05-14 Thread heavyccasey
One problem: the PASSWORD DOES NOT WORK! On 5/14/07, Brad Sumrall <[EMAIL PROTECTED]> wrote: As a person who has come here in the recent past asking free lancer help and received nothing but near-useless references even though I was asking specific php coding related questions. Now I com to the

Re: [PHP] Enough games, password changed, need a php "make it happen person"

2007-05-14 Thread heavyccasey
Okay, but the password doesn't work! On 5/14/07, Brad Sumrall <[EMAIL PROTECTED]> wrote: Same as earlier posting. Had some fun with my over sight on the password posting, but snort took care of that. But seriously folk! Who can "poop" a program on a bounty! Brad -- PHP General Mail

Re: [PHP] Bounty, NOW!

2007-05-14 Thread heavyccasey
Oh, and 530 Authentication Failed. On 5/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: HAHA! Nice one ;) On 5/14/07, Paul Scott <[EMAIL PROTECTED]> wrote: > > On Tue, 2007-05-15 at 01:46 -0400, Brad Sumrall wrote: > > I got 5 IP breaking Federal Regulations. > > Hehehehe > > Do you thi

Re: [PHP] Bounty, NOW!

2007-05-14 Thread heavyccasey
HAHA! Nice one ;) On 5/14/07, Paul Scott <[EMAIL PROTECTED]> wrote: On Tue, 2007-05-15 at 01:46 -0400, Brad Sumrall wrote: > I got 5 IP breaking Federal Regulations. > Hehehehe > Do you think you are not being logged? > *YAWN* Anything better to talk about? This is very l33t-ish and is now

Re: [PHP] What is the best way to protect the PHP page that returns the AJAX data? [solved]

2007-05-11 Thread heavyccasey
I don't see you giving a solution. On 5/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote: On Fri, 2007-05-11 at 19:59 -0700, [EMAIL PROTECTED] wrote: > Set ajaxObject.setRequestHeader("User-Agent","SecretName"); in > Javascript and check for it in PHP. Not fool-proof, but the average > person wo

Re: [PHP] What is the best way to protect the PHP page that returns the AJAX data? [solved]

2007-05-11 Thread heavyccasey
Set ajaxObject.setRequestHeader("User-Agent","SecretName"); in Javascript and check for it in PHP. Not fool-proof, but the average person wouldn't be able to get in. On 5/11/07, clive <[EMAIL PROTECTED]> wrote: Robert Cummings wrote: > A Guru would have spent 60 seconds testing to see if the ses

Re: [PHP] What is the best way to protect the PHP page that returns the AJAX data?

2007-05-10 Thread heavyccasey
That's a humongous, humongous security risk there. What if someone goes http://example.com/gimmedata.php?query=DROP DATABASE hi? Unless I misunderstood. A better way would be in the script: switch ($_GET['query']) { case "fetch": $dbquery = 'SELECT stuff FROM stuff'; break; case "eatsnacks": $d

Re: [PHP] Best way to format double as money?

2007-05-05 Thread heavyccasey
*sigh* http://www.google.com/search?hl=en&q=PHP+format+double+as+money&btnG=Search On 5/5/07, Larry Garfield <[EMAIL PROTECTED]> wrote: http://www.php.net/money_format On Saturday 05 May 2007, Todd Cary wrote: > I have a MySQL DB that stores currency values as doubles. I want to > display the

Re: [PHP] echo or print ?

2007-04-17 Thread heavyccasey
Me too. I use echo. Print is a function. There's no significant difference between them. My advice: choose one, and stick with it. On 4/16/07, clive <[EMAIL PROTECTED]> wrote: > What do you guys use, and what is the advantage (if ther is any) of > print over echo? And I am not talking about pr

Re: [PHP] auto page generation

2007-04-15 Thread heavyccasey
What you're looking for is basically what PHP is all about. Just read any PHP & MySQL book and you'll find whatever you need. On 4/15/07, Jeremy Adams <[EMAIL PROTECTED]> wrote: I'm building a website right now that will be a database of attractions in the Carolina and Virginia area. The idea is