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\x08\x00\x00\x00\x00\x00" . 
$data);
return file_get_contents('compress.zlib://' . $f);
}
On Nov 7, 2007 7:42 AM, Per Jessen <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
>
> > They're exactly the same, except of the last 4 bytes. Python
> > calculates them differently than PHP. PHP follows the standards,
> > Python does not :]
>
> That is exactly what is so weird - does Python maybe have its own
> implementation of the gzip compression algorithm?   I would have
> thought they both used the same zlib.
>
>
>
> /Per Jessen, Zürich
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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]> wrote:
> [EMAIL PROTECTED] wrote:
>
> > The documentation for zlib says that it expects an Adler-32 checksum
> > at the end of the file.
> >
> > PHP follows this [largely outdated] standard.
>
> Uh, nothing to do with PHP, the code is in zlib.
>
> > Python, on the other hand, doesn't, and uses a different checksum,
> > CRC-32.
>
> There's something crooked going here. No-one should have to write up
> work-arounds for weird incompatibilities in the gzip format.  The
> problem is - why is Python using an incorrect checksum?  And is Python
> not using the zlib library?
>
> http://www.python.org/doc/lib/module-zlib.html
>
> >From this page:
>
> "There are known incompatibilities between the Python module and
> versions of the zlib library earlier than 1.1.3; 1.1.3 has a security
> vulnerability, so we recommend using 1.1.4 or later."
>
> Do you have the right zlib version?  Mine is 1.2.3.
>
> If your work-around works, well, fine.  Personally I'd dig a little
> deeper.  I would positively hate having that kind of crud in my
> production code.
>
>
>
> /Per Jessen, Zürich
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 now. :)
function fixAdler32($data) {
$tempnam = tempnam('/tmp', 'gzfix');
$fh = fopen($tempnam, 'wb');

fwrite($fh, "\x1f\x8b\x08\x00\x00\x00\x00\x00" . $data);
fclose($fh);

$dat = '';
$gz = gzopen($tempnam, 'rb');
if ($gz == false) die('Error opening temporary GZ file.');

do {
$dat .= gzread($gz, 10);
} while (!feof($gz));
gzclose($gz);
unlink($tempnam);
return $dat;
}


On Nov 6, 2007 11:07 PM, Per Jessen <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
>
> > 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?
>
> Are you saying that you've got compressed data in one format by Python
> that cannot be uncompressed by PHP because it expects another format?
>
>
>
> /Per Jessen, Zürich
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 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 tried gzinflate() and many user-created gzdecode
> > > () functions, with no luck.
> >
> > Did you specify a correct length for gzuncompress() ?
> >
> > >From the manpage:
> >
> > The function will return an error if the uncompressed data is more than
> > the optional parameter length.
> >
> >
> > /Per Jessen, Zürich
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 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?
>
> If you need to keep a 120Mb file in core at any point in time, you'll
> need the memory.  Either adjust the memory-limit, or change your code
> to process the file in chunks/lines/bytes.
>
>
> /Per Jessen, Zürich
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 tried gzinflate() and many user-created gzdecode
> > () functions, with no luck.
>
> Did you specify a correct length for gzuncompress() ?
>
> >From the manpage:
>
> The function will return an error if the uncompressed data is more than
> the optional parameter length.
>
>
> /Per Jessen, Zürich
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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?

Thanks.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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))
> >   {
> >$fotos_mostrar[] = $row;
> >   }
> >   $primer_foto = reset($fotos_mostrar[0]); // This is to set the pointer to
> > the first record
> > echo $primer_foto; // This displays the first column when doing a SELECT
> >
>
> if you notice you are referring to an index in your array.
>
> You should be doing the reset on $fotos_mostrar like this
>
> reset($fotos_mostrar);
>
> var_dump($fotos_mostrar);
>
> This will display the entire dataset.
>
> also, if you read the first line just above the first example of use,
> you will notice that it says that reset will return the first array
> element or false.
>
> The reason that you are getting the first column is because in your
> reset call, you are referencing the first index entry in your array.
>
> This would return you the first index of the first index in your array.
>
> NO, I did not just repeat myself.  re-read what I wrote and think it
> through and it will make perfect sense.
>
> So, try what I showed you at the beginning of my comments and you will
> see the results you are wanting.
>
>
> > However, my SELECT statement retrieves 2 columns from one table, how do I
> > display the second column ?
> >
> > Thanks
> > Eduardo
> >
> > "Jim Lucas" <[EMAIL PROTECTED]> escribió en el mensaje
> > news:[EMAIL PROTECTED]
> >> Eduardo Vizcarra wrote:
> >>> I have a WHILE sentence to retrieve all records from a SELECT query in a
> >>> database and am using mysql_fetch_array to store them in a matrix, the
> >>> sentence is like this:
> >>>   while($row=mysql_fetch_array($fotos))
> >>>   {
> >>>$fotos_mostrar[] = $row;
> >>>   }
> >>>
> >>> $fotos contains all records found in a db table, the SELECT statement is
> >>> retrieving 2 columns from a table, how do I store all records in a 2
> >>> dimention table so I can use it later ?
> >>>
> >>> this WHILE sentence seems to only store the last record only
> >>>
> >>> Regards
> >> how are you checking to see the contents of the $fotos_mostrar array() ?
> >>
> >> just after the while loop ends, do a var_dump() or print_r() on the array
> >> and view the contents.
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 stupid using 'someString'."\n";
> > and
> > it`s kind of inconsistent using double quotes for some lines like
> > "someString\n";.
> > What`s the best way to get a consitent code?
> >
>
> choose the string syntax that best fits the purpose of the given string.
> if a string will not have variables embedded in it, or special characters,
> use
> single quotes.  if it will, use double quotes.
> if you have a particularly long string, with variables and special
> characters
> consider Heredoc.
>
> -nathan
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 takes 10 secs to respond,
> I suppose my script will just wait fopen returns something.
>
> Thank you.
> --
> View this message in context: 
> http://www.nabble.com/Timeout-for-fopen---tf4620009.html#a13194530
> Sent from the PHP - General mailing list archive at Nabble.com.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 solution isn't unobtrusive.
> >>
> >>  
> >>
> >>  However, I couldn't see a way to make it so.
> >
> >Why not? I'm guessing because you need to the link to have the
> >JavaScript variable in it. If this is the case then the href target
> >should link to a page informing the user that they need to have
> >JavaScript installed. By doing so you inform them of why clicking on the
> >link is not having the desired outcome :)
> >
> >Cheers,
> >Rob.
>
> Rob:
>
> I would agree with you IF I was creating a web page for the general
> public. However, what I am creating in my laboratory is a monster of
> my own making that will be used only by my clients AND those clients
> will be required to have javascript turned on.
>
> Sometimes, programming for the lowest common denominator limits possibilities.
>
> 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 Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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
> > here as well.
> >
> > I'm currently sending data (the value of s) to another script via the
> > html statement:
> >
> > Click here
> >
> > However, I need to add another variable, namely a javascript
> > variable, to the GET string.
> >
> > How can I send both a php and a javascript variable together at the same 
> > time?
>
> Use an onclick="" event handler.
>
> Cheers,
> Rob.
> --
> ...
> SwarmBuy.com - http://www.swarmbuy.com
>
> Leveraging the buying power of the masses!
> ...
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 I put the $string into mysql,
> > it uses backslashes to escape where the quotes were. The
> > double-quotes are gone, yet it still escapes the 'ghost'
> > where they were.
> >
> > I even tried
> > str_replace(array("\x8c", "\x9c", "'", '"'), '', $string)
> > but the ghost remains and mysql continues to escape them.
> >
> > I check the charsets, and the db is Latin-1 and the sting is ISO-8859-1
> >
> > Any thoughts on this would be most graciously accepted.
> > Kind regards
> > kevin
> >
> >
> is $string honestly something that you are getting via a form submit?
>
> if so, your system might have magic quotes enabled.
>
> This would automatically escape quotes with the attempt to make the
> values safer, and then you go and run your str_replace command and
> remove the double quotes, you end up leaving the '\' that the system
> automatically put in the value for you.
>
> read up on magic quote gpc
>
> hope this helps.
>
> Jim
>
> --
> Jim Lucas
>
>
>  "Perseverance is not a long race;
>  it is many short races one after the other"
>
> Walter Elliot
>
>
>
>  "Some men are born to greatness, some achieve greatness,
>  and some have greatness thrust upon them."
>
> Twelfth Night, Act II, Scene V
>  by William Shakespeare
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 wondering if this is correct:
>
> 
> // We'll be outputting a PDF
> header('Content-type: application/vnd.symbian.install');
>
> // It will be called downloaded.pdf
> header('Content-Disposition: attachment;
> filename="../File/norEnglish.sis"');
>
> ?>
>
>
> So basically I set the HREF to the file above (filename .php).
>
> Let me know if there is anything that im doing incorrectly.
>
> Thanks
>
> --
> 
> Angelo Zanetti
> Systems developer
> 
>
> *Telephone:* +27 (021) 552 9799
> *Mobile:*   +27 (0) 72 441 3355
> *Fax:*+27 (0) 86 681 5885
> *
> Web:* http://www.zlogic.co.za
> *E-Mail:* [EMAIL PROTECTED] 
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 store anything in this variable as follows
> $$variable1 = "John";
>
> I hope this may not help you for what you want, but at least It will gives
> an idea for different methods..
>
> Warm Regards,
> Sanjeev
> http://www.sanchanworld.com/
> http://webdirectory.sanchanworld.com - Submit your website URL
> http://webhosting.sanchanworld.com - Choose your best web hosting plan
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 15, 2007 12:41 PM
> To: Chris
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Parsing Variables Inside a String
>
> 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$fr['iop']';
> > > echo TheFunctionIRequest($new); // They're crazy!
> >
> > Well this:
> >
> > echo $good_day . $fr['iop'];
> >
> > will do what you show here.
> >
> >
> > What are you trying to do exactly?
> >
> > --
> > Postgresql & php tutorials
> > http://www.designmagick.com/
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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$fr['iop']';
> > echo TheFunctionIRequest($new); // They're crazy!
>
> Well this:
>
> echo $good_day . $fr['iop'];
>
> will do what you show here.
>
>
> What are you trying to do exactly?
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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://www.php.net/unsub.php



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 laptop screen
>
> bastien> From: [EMAIL PROTECTED]> To: php-general@lists.php.net> Date: Tue, 
> 14 Aug 2007 20:15:27 +0500> Subject: [PHP] www.soongy.com> > Hello,> > > > I 
> am Gevorg. > > I just wanted to introduce you my new PHP based work here 
> www.soongy.com>  .> > It is working on PHP and MySQL 
> and here is used DHTML, AJAX.> > > > Thank you very much.> > > > Waiting for 
> your response > > > > Regards,> > Gevorg> > >
> _
> News, entertainment and everything you care about at Live.com. Get it now!
> http://www.live.com/getstarted.aspx

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 the book in a bookstore, you would
be selling secrets.

--
   .~.   Might. Courage. Vision. Sincerity. http://www.linux-sxs.org
  / v \  Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Fedora Core 4)  Linux 2.6.17-1.2142_FC4
   ^ ^   10:39:01 up 165 days 18:23 1 user load average: 0.00 0.00 0.00

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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
chapters to decide whether you are gonna buy it. It's not porn magazines
wrapped in plastic bag, with a label "18-year-old or more".

There are bookstores that don't customers to preview the books. For me,
I would not buy a book by just looking at the cover. You gotta kidding
me or you were too greedy.


--
   .~.   Might. Courage. Vision. Sincerity. http://www.linux-sxs.org
  / v \  Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Fedora Core 4)  Linux 2.6.17-1.2142_FC4
   ^ ^   10:36:01 up 165 days 18:20 1 user load average: 0.00 0.00 0.02

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 at 10:08 -0400, tedd wrote:
> >  > I doubt that one can demarcate the non-chicken parents from the
> >>  chicken offspring. So... it is perplexing.
> >
> >We don't need to demarcate, we only need to know that it happened.
>
> Yes, but knowing that something has happened, does not mean that we
> know how it happened.  :-)

Actually in this case there is only one possible way it could have
happened. I'll lay it out simply for you if I must, but it's simple
logical progression.

> This, my friend, is one of those things we can debate forever without
> reaching a definitive answer.

No, it absolutely has a definitive answer.

> Thus, my assertion that this question is perplexing still stands.
> Unless, of course, you wish to challenge it and thus confirm my
> assertion further.  Check and mate.  :-)

The basis of your assertion is incorrect. Methinks you're being
presumptuous by declaring check and mate prematurely.

Cheers,
Rob.
--
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 multi-line";
$str[2]="text";

$str=explode($_POST["my_text"],'\n');


TIA and sorry the *very* poor english.


--
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--
"Religion, ideology, resources, land,
spite, love or "just because"...
No matter how pathetic the reason,
it's enough to start a war. "

Por favor não faça top-posting, coloque a sua resposta abaixo desta linha.
Please don't do top-posting, put your reply below the following line.





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 list offering legit
funding to my supposed php friends for their expertise and received nothing
but low end hacker repossesses.



What would you think?



I am simply trying to support the list, and all I get is hate.



I cannot help it if I am properly guarded.



Attack me, and I have proper defensives.



Respond professionally and I bare rewards..



Sincerely,






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 think you are not being logged?
> >
>
> *YAWN* Anything better to talk about? This is very l33t-ish and is now
> grossly off topic.
>
> --Paul
>
>
> All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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
grossly off topic.

--Paul


All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 wouldn't be able to get in.

Bleh, do it right. Don't settle for half-assed solutions that rely on
someone being an "average" person.

Cheers,
Rob.
--
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 session_start()
> scenario worked BEFORE posting to the list :B

/me was thinking the same

--
Regards,

Clive.

Real Time Travel Connections


{No electrons were harmed in the creation, transmission or reading of
this email. However, many were excited and some may well have enjoyed
the experience.}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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": $dbquery = 'SELECT snacks FROM edibles'; break;
// ...
}

and fetch instead "http://example.com/gimmedata.php?query=eatsnacks";

On 5/10/07, Daevid Vincent <[EMAIL PROTECTED]> wrote:

Like most sites, someone needs to join up to use mine.

I'm using a wee-bit-o-AJAX to pull some results from a database and display 
them dynamically.

For the AJAX to work, it has to hit a script that's accessible from the htdocs 
tree right?
Effectively it's just a (JavaScript initiated) GET URL request correct?

For example, index.html calls http://example.com/gimmedata.php?query=foo
That in turn returns a JS formatted array which is eval() in JS and rendered on 
the page.

(over simplified I know)

My question is, how do you protect gimmedata.php since it's sitting out there 
sans normal web headers and stuff?
Can it include session_start() and do all that wonderful checking to make sure 
the user is logged in before just happily doling out
my precious data?

What is the proper, secure, sanctioned and AJAX/PHP blessed way to do this?

I could set up a test environment and hack up something I'm sure -- and 
probably will if I get too impatient, but nobody seems to
address this issue in any examples, they just do it as if information is *gasp* 
free. I'm a PHP guru, but I am also an AJAX novice.
From what I gather, the return is really in XML transport format and all the 
magic of converting to/from XML is transparent to me. I
worry that putting other headers or whatever may "corrupt" that?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 values in the #,##0.00 format.  What is the best way to do
> that?
>
> Todd
>
> --
> Ariste Software
> 2200 D Street Ext
> Petaluma, CA 94952
> (707) 773-4523


--
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]  ICQ: 6817012

"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it."  -- Thomas
Jefferson

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 print_r or anything, just
> the regular print. :o)

print returns a result, echo doesn't. This makes echo slightly faster
than print, but I doubt theres any significant speed improvement using
echo instead of print.

I use echo, but thats just because its a habit.

--
Regards,

Clive.


{No electrons were harmed in the creation, transmission or reading of
this email. However, many were excited and some may well have enjoyed
the experience.}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 that attraction owners can submit data to the database and the
database will automatically generate a page containing that information.
What I'm trying to figure out is how to generate the pages automatically and
have links to them added to the site.  If someone could help me or point me
in the direction of a book or web page that covers this I would really
appreciate it.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php