php-general Digest 3 Jan 2009 22:16:14 -0000 Issue 5881
Topics (messages 285393 through 285416):
Re: Searching in a long text
285393 by: Robert Cummings
285394 by: Richard Heyes
285395 by: Vicente
285414 by: Andrew Ballard
Re: Sending files via POST
285396 by: Anders Norrbring
Re: How to count transfered kBytes in File-Download
285397 by: Michelle Konzack
285398 by: Ashley Sheridan
285399 by: Eric Butera
Number Punctuator
285400 by: Alec Wright
285401 by: Phpster
Re: Please point me in the right direction
285402 by: tedd
285403 by: Al
Re: =.='' what wrong ? just simple code, however error.
285404 by: Martin Zvarík
Re: Thank you everyone, What a wonderful world
285405 by: Nathan Rixham
285406 by: Nathan Rixham
285407 by: Robert Cummings
285408 by: Dotan Cohen
285409 by: Behzad
285410 by: Daniel Brown
285411 by: Dotan Cohen
285412 by: Dotan Cohen
285413 by: Larry Garfield
285415 by: Lepidosteus
285416 by: tedd
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
On Sat, 2009-01-03 at 01:28 -0800, Yeti wrote:
> What if the whole text has only 1 line?
What if? Shouldn't matter.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
> ...
You could look into using Zend_Search_Lucene, which is part of the
Zend framework. It's file based and so doesn't require the use of
MySQL. Might make it slightly more portable if that's a concern. It
will be a little more work than simply using MySQL, but it would be
worth it I think.
--
Richard Heyes
HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated December 20th)
--- End Message ---
--- Begin Message ---
Richard wrote:
> You could look into using Zend_Search_Lucene, which is part of the
> Zend framework. It's file based and so doesn't require the use of
> MySQL. Might make it slightly more portable if that's a concern. It
> will be a little more work than simply using MySQL, but it would be
> worth it I think.
well, that's more devoted to obtain a typical search engine results
in a Google style. What I need is something similar of what happens
searching inside books in Google Books:
http://books.google.com/books?hl=en&id=uaZQAAAAMAAJ&dq=pghp+advanced&q=engine&pgis=1#search_anchor
about Robert thoughts:
> I'd store each line of text in the database along with
> the page and line number for indexing. Then using full text search I'd
> retrieve appropriate lines that match the search query. Upon retrieving
> the matching lines, I'd then proceed to pull the accompanying lines by
> incrementing/decrementing the line number found and using an IN() clause
> for matching the various IDs in a single query.
I wonder if storing every line in its field can cause an enormous
table of registers. The book has 580 pages, 40 lines/page gives a
table with 23.200 registers.
Is this size a bad idea regarding resources and speed results?.
Because I will need to parse every field contents when searching the
words.
I'm asking before starting to divide and import the book.
Thanks for the help,
--- End Message ---
--- Begin Message ---
On Sat, Jan 3, 2009 at 4:28 AM, Yeti <y...@myhich.com> wrote:
> What if the whole text has only 1 line?
>
I would worry more (though probably not much) about the fringe cases
where a match spans across lines (or pages) such that it would either
prevent a qualifying match from being returned at all, or a highly
relevant result could be returned at the bottom of the list as two
less-relevant results because of the line split.
Andrew
--- End Message ---
--- Begin Message ---
> Nathan Rixham's original email. Hope it helps!
>
> On Thu, Jan 1, 2009 at 09:35, Nathan Rixham <nrix...@gmail.com> wrote:
> >
> > after having a flick through the source it looks like a limitation of
> http
> > request;
> >
> http://pear.php.net/package/HTTP_Request/docs/latest/__filesource/fsour
> ce_HTTP_Request__HTTP_Request-1.4.4Request.php.html
> > check lines around 600 and 900+
> >
> > you'd have to set the http request yourself i thinks! (setBody)
> >
> > may be worth contacting they who maintain the package
> >
Thanks Daniel.
I sure looks like I have to either do it manually, or modify the HTTP
Request code myself, something I'm a bit reluctant to do..
I guess the better way is to learn how to build the HTTP body and use the
setBody method, so I'll do some Googling on the subject if somebody here
can't point me to a good 'how-to' right away..
Anders.
--- End Message ---
--- Begin Message ---
Good morning Jim,
Thank your for your help, I will now adapt my scripts and test it.
And if a user had done a partial download, how can I set the pointer to
resume the download? I personaly find websites offering downloads but
not resuming very annoying, so I like to do it better... :-)
I know I have to get a $_HTTP['????'] header for the partial request,
but which? And then I have too seek fread() right? But how?
> Then here, do this...
>
> $current_size = 0;
> while ( !feof($HANDLER) ) {
> $current_size += $buffer;
> echo fread($HANDLE, $buffer);
> }
>
> Now, do what you want with $current_size
>
> Maybe have a variable that you check it against that contains the users
> allow amount of transfer...
>
> $current_size = 0;
> while ( !feof($HANDLER) && $current_size < $allowed_limit ) {
> $current_size += $buffer;
> echo fread($HANDLE, $buffer);
> }
>
> Hope this gets you leading down the right path...
Yes. :-)
However, I do not want to break downloads...
So I check the $current_size AFTER each completed download and since
$USER can only download one file at once, it should work without any
problems.
Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator
24V Electronic Engineer
Tamay Dogan Network
Debian GNU/Linux Consultant
--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
<http://www.tamay-dogan.net/> <http://www.can4linux.org/>
Michelle Konzack Apt. 917 ICQ #328449886
+49/177/9351947 50, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com)
signature.pgp
Description: Digital signature
--- End Message ---
--- Begin Message ---
On Sat, 2009-01-03 at 13:27 +0100, Michelle Konzack wrote:
> Good morning Jim,
>
> Thank your for your help, I will now adapt my scripts and test it.
>
> And if a user had done a partial download, how can I set the pointer to
> resume the download? I personaly find websites offering downloads but
> not resuming very annoying, so I like to do it better... :-)
>
> I know I have to get a $_HTTP['????'] header for the partial request,
> but which? And then I have too seek fread() right? But how?
>
> > Then here, do this...
> >
> > $current_size = 0;
> > while ( !feof($HANDLER) ) {
> > $current_size += $buffer;
> > echo fread($HANDLE, $buffer);
> > }
> >
> > Now, do what you want with $current_size
> >
> > Maybe have a variable that you check it against that contains the users
> > allow amount of transfer...
> >
> > $current_size = 0;
> > while ( !feof($HANDLER) && $current_size < $allowed_limit ) {
> > $current_size += $buffer;
> > echo fread($HANDLE, $buffer);
> > }
> >
> > Hope this gets you leading down the right path...
>
> Yes. :-)
>
> However, I do not want to break downloads...
> So I check the $current_size AFTER each completed download and since
> $USER can only download one file at once, it should work without any
> problems.
>
> Thanks, Greetings and nice Day/Evening
> Michelle Konzack
> Systemadministrator
> 24V Electronic Engineer
> Tamay Dogan Network
> Debian GNU/Linux Consultant
>
>
I don't think this is actually possible. I've never seen it happen
before. It would need some sort of dedicated client-side software to
recognise exactly how much has been downloaded and then request the rest
of it. A browser doesn't yet have this capability I believe.
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
On Sat, Jan 3, 2009 at 9:23 AM, Ashley Sheridan
<a...@ashleysheridan.co.uk> wrote:
> On Sat, 2009-01-03 at 13:27 +0100, Michelle Konzack wrote:
>> Good morning Jim,
>>
>> Thank your for your help, I will now adapt my scripts and test it.
>>
>> And if a user had done a partial download, how can I set the pointer to
>> resume the download? I personaly find websites offering downloads but
>> not resuming very annoying, so I like to do it better... :-)
>>
>> I know I have to get a $_HTTP['????'] header for the partial request,
>> but which? And then I have too seek fread() right? But how?
>>
>> > Then here, do this...
>> >
>> > $current_size = 0;
>> > while ( !feof($HANDLER) ) {
>> > $current_size += $buffer;
>> > echo fread($HANDLE, $buffer);
>> > }
>> >
>> > Now, do what you want with $current_size
>> >
>> > Maybe have a variable that you check it against that contains the users
>> > allow amount of transfer...
>> >
>> > $current_size = 0;
>> > while ( !feof($HANDLER) && $current_size < $allowed_limit ) {
>> > $current_size += $buffer;
>> > echo fread($HANDLE, $buffer);
>> > }
>> >
>> > Hope this gets you leading down the right path...
>>
>> Yes. :-)
>>
>> However, I do not want to break downloads...
>> So I check the $current_size AFTER each completed download and since
>> $USER can only download one file at once, it should work without any
>> problems.
>>
>> Thanks, Greetings and nice Day/Evening
>> Michelle Konzack
>> Systemadministrator
>> 24V Electronic Engineer
>> Tamay Dogan Network
>> Debian GNU/Linux Consultant
>>
>>
> I don't think this is actually possible. I've never seen it happen
> before. It would need some sort of dedicated client-side software to
> recognise exactly how much has been downloaded and then request the rest
> of it. A browser doesn't yet have this capability I believe.
>
>
> Ash
> www.ashleysheridan.co.uk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
$_SERVER['HTTP_RANGE']
???
--- End Message ---
--- Begin Message ---
Hey all, is there a php function to punctuate a number?
eg 3482957239525 would become 3,482,957,239,525 and 274018 would become
274,018 etc
Thanks :)
--- End Message ---
--- Begin Message ---
Number_format()
Bastien
Sent from my iPod
On Jan 3, 2009, at 10:47 AM, Alec Wright <ale...@gmail.com> wrote:
Hey all, is there a php function to punctuate a number?
eg 3482957239525 would become 3,482,957,239,525 and 274018 would
become
274,018 etc
Thanks :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
At 8:20 PM -0800 1/2/09, David Knapp wrote:
Greetings,
I need to create a secure customer section on my site. User name and
login would take you to a secured page that displays information
like a calendar, downloads, budgets. These sections would be the
same but each customer would display custom content (over 100
customers).
I browsed php & mysql books, but need a jump start. Any ideas? Is
php not the best solution? If you can't tell, I'm a newbie.
David
David:
So what's your question?
Do you want a secure area, calendar downloads, budgets, or what?
All you say you want can be done in php. If you want to do it
yourself, you probably could write some of the code after a few
months of study. But if you want it done sooner, then hire one of us.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
David Knapp wrote:
Greetings,
I need to create a secure customer section on my site. User name and login
would take you to a secured page that displays information like a calendar,
downloads, budgets. These sections would be the same but each customer would
display custom content (over 100 customers).
I browsed php & mysql books, but need a jump start. Any ideas? Is php not the
best solution? If you can't tell, I'm a newbie.
David
You said "secure"!.... I'd highly recommend looking for a finished product
designed by pros. Designing a secure application is not for newbies.
Al...
--- End Message ---
--- Begin Message ---
It works as expected on my PHP 5.2.4
LKSunny napsal(a):
<?
$credithold = 100;
for($i=1;$i<=1000;$i++){
$credithold -= 0.1;
echo "$credithold<br />";
}
//i don't know why, when run this code, on 91.3 after expect is 91.2,
however......91.200000000001
//who can help me ? and tell me why ?
//Thank You.
?>
--- End Message ---
--- Begin Message ---
rob, are you suggesting that the solution to the problems in the middle
east is to be found lurking somewhere on the php.net site? perhaps with
a little code example to show us how it's done?
lolol great
Robert Cummings wrote:
I find the PHP site to be one of the best resources around. Maybe it can
help you with your problem.
Cheers,
Rob.
On Sat, 2009-01-03 at 08:56 +0330, shahrzad khorrami wrote:
I'm sorry for there are no rules in the world no real men to help them. May
*Allah* help them
as we see what happened in *Iraq* who started war with Iran and just he can!
I believe.... because I can't see any power in men to do that. America is
behind Israel and other countries really are too weak and timid to help.
just pray for them..
thanks behzad
--- End Message ---
--- Begin Message ---
oooh oooh found it, there's a few solutions actually!
array_merge($christianity,$islam);
unset($religion);
//loads more
Nathan Rixham wrote:
rob, are you suggesting that the solution to the problems in the middle
east is to be found lurking somewhere on the php.net site? perhaps with
a little code example to show us how it's done?
lolol great
Robert Cummings wrote:
I find the PHP site to be one of the best resources around. Maybe it can
help you with your problem.
Cheers,
Rob.
On Sat, 2009-01-03 at 08:56 +0330, shahrzad khorrami wrote:
I'm sorry for there are no rules in the world no real men to help
them. May
*Allah* help them
as we see what happened in *Iraq* who started war with Iran and just
he can!
I believe.... because I can't see any power in men to do that.
America is
behind Israel and other countries really are too weak and timid to help.
just pray for them..
thanks behzad
--- End Message ---
--- Begin Message ---
On Sat, 2009-01-03 at 17:55 +0000, Nathan Rixham wrote:
> oooh oooh found it, there's a few solutions actually!
>
> array_merge($christianity,$islam);
> unset($religion);
> //loads more
Sounds like a better solution than:
<?php
die();
?>
:)
> Nathan Rixham wrote:
> > rob, are you suggesting that the solution to the problems in the middle
> > east is to be found lurking somewhere on the php.net site? perhaps with
> > a little code example to show us how it's done?
> >
> > lolol great
Well the post seemed a bit out of context, so I was merely indicating a
good place to start one's search for a PHP problem that seemed awfully
vague... without getting myself involved with picking either side.
Certainly I can sympathize with dying-- anywhere-- but the concept of
unending conflict rather than peace goes somewhat over my head.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
WTF? Isn't it the Gaza government (Hamas) that chooses to build
rockets instead of buying food for it's citizens? So long at Hamas is
in charge both the Gaza residents and the Israelis will suffer. Let's
hope this finally roots them out for good.
By the way, of the 400+ killed in Gaza, about 70 were civilians. A
six-to-one ratio of terrorists:civilians really is not that bad,
especially considering that the Hamas hide among the civilians. Hell,
they take kids with them, crying, when they launch rockets just so
that they can say that another kid was killed if they get intercepted.
According to the Geneva convention, it is _Hamas_ that is responsible
for the civilian deaths in Gaza.
By the way, Egypt (who knows better than anyone else in the world)
blames Hamas fully for what has happened in the past week.
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü
--- End Message ---
--- Begin Message ---
Enjoy ! Be Happy ! Let's free the Gaza! Let's bring there Democracy ! YEAH!
Hamas is a terrorist group, and since it is elected by Gaza's people, they
are terrorists, too!
... Enough already!
For you information:
1) http://en.wikipedia.org/wiki/Sabra_and_Shatila_massacre
2) http://en.wikipedia.org/wiki/2006_Qana_airstrike
KILL TERRORIST! Kill all of those terrorist, including those women and
children! Victory is yours.
Soldiers! Don't make any mistake, since you have modern weapons, equipped
with lasers!
Use your modern war machine; Use F16 and 100-ton bombs to kill,
Do not let them to throw stones at you. Do not let them to leave the land.
Do not let them to have food.
Oh My God ! Look at their rockets... Look at those hand-made toys! How
miserable these terrorists are!
Who are we? Vampires or Blinds?
On Sat, Jan 3, 2009 at 9:59 PM, Dotan Cohen <dotanco...@gmail.com> wrote:
> WTF? Isn't it the Gaza government (Hamas) that chooses to build
> rockets instead of buying food for it's citizens? So long at Hamas is
> in charge both the Gaza residents and the Israelis will suffer. Let's
> hope this finally roots them out for good.
>
> By the way, of the 400+ killed in Gaza, about 70 were civilians. A
> six-to-one ratio of terrorists:civilians really is not that bad,
> especially considering that the Hamas hide among the civilians. Hell,
> they take kids with them, crying, when they launch rockets just so
> that they can say that another kid was killed if they get intercepted.
> According to the Geneva convention, it is _Hamas_ that is responsible
> for the civilian deaths in Gaza.
>
> By the way, Egypt (who knows better than anyone else in the world)
> blames Hamas fully for what has happened in the past week.
>
> --
> Dotan Cohen
>
> http://what-is-what.com
> http://gibberish.co.il
>
> א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
> ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي
> А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
> а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
> ä-ö-ü-ß-Ä-Ö-Ü
>
--
Kind regards,
-behzad
--- End Message ---
--- Begin Message ---
On Sat, Jan 3, 2009 at 14:00, Behzad <behzad.esl...@gmail.com> wrote:
>
> Who are we? Vampires or Blinds?
Worse. We're geeks.
--
</Daniel P. Brown>
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!
--- End Message ---
--- Begin Message ---
2009/1/3 Daniel Brown <danbr...@php.net>:
> On Sat, Jan 3, 2009 at 14:00, Behzad <behzad.esl...@gmail.com> wrote:
>>
>> Who are we? Vampires or Blinds?
>
> Worse. We're geeks.
>
And we have a troll in our midst.
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü
--- End Message ---
--- Begin Message ---
2009/1/3 Behzad <behzad.esl...@gmail.com>:
> since you have modern weapons, equipped
> with lasers!
Did somebody say sharks with frigin' lasers?
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü
--- End Message ---
--- Begin Message ---
On Saturday 03 January 2009 1:17:07 pm Dotan Cohen wrote:
> 2009/1/3 Behzad <behzad.esl...@gmail.com>:
> > since you have modern weapons, equipped
> > with lasers!
>
> Did somebody say sharks with frigin' lasers?
No, but we have some ill-tempered sea-bass.
--
Larry Garfield
la...@garfieldtech.com
--- End Message ---
--- Begin Message ---
> A six-to-one ratio of terrorists:civilians really is not that bad
Ouch.
--
Vianney Devreese - Lepidosteus
http://lepidosteus.com
--- End Message ---
--- Begin Message ---
At 5:55 PM +0000 1/3/09, Nathan Rixham wrote:
oooh oooh found it, there's a few solutions actually!
array_merge($christianity,$islam);
unset($religion);
I prefer:
unlink($the_entire_mess);
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---