php-general Digest 10 Jun 2006 09:22:28 -0000 Issue 4177

2006-06-10 Thread php-general-digest-help

php-general Digest 10 Jun 2006 09:22:28 - Issue 4177

Topics (messages 237711 through 237732):

Re: Skip first 4 array values
237711 by: Richard Lynch

Re: substring with numric values
237712 by: Richard Lynch

Re: mail() function dying half way through.
237713 by: Richard Lynch

Re: transfer file
237714 by: Richard Lynch

Re: remove last comma in string
237715 by: Richard Lynch
237717 by: Paul Novitski
237719 by: Richard Lynch

Re: order of elements in $_POST super global
237716 by: Richard Lynch
237718 by: Richard Lynch
237720 by: Richard Lynch

Re: server sending notifications to clients
237721 by: Richard Lynch

Re: running php method in the background
237722 by: Richard Lynch

Using php4 to manage Apache 1.3 access database
237723 by: Doug Carter

Re: Session puzzle... / why no new session?
237724 by: chris smith

Re: Tables vs. databases
237725 by: chris smith
237729 by: Lester Caine

How to re-order an array
237726 by: jekillen

How to tell if a socket is connected
237727 by: Michael W.

Mail sending program (beginner)
237728 by: aci india
237730 by: Rabin Vincent
237731 by: benifactor

1,600,000 ÃÒª×èÍÍÕàÁÅì ¤Ñ´ÊÃÃàÃÕ§ÅӴѺÍÑ¡ÉÃÊдǡÊÓËÃѺ¢ÂÒ¸ØáԨ¢Í§·èÒ¹ 
¾ÃéÍÁ·Ñé§á¶Áâ»Ãá¡ÃÁ·Ñ¹ÊÁѨҡµèÒ§»ÃÐà·ÈÍÕ¡ËÅÒÂÍÂèÒ§ ÃÒ¤Ò¶Ù¡ÁÒ¡ËÒäÁèä´éÍÕ¡áÅéÇ 
¨Ó˹èÒ¨ӹǹ¨Ó¡Ñ´
237732 by: 1,600,000 ÃÒª×èÍÍÕàÁÅì 
¤Ñ´ÊÃÃàÃÕ§ÅӴѺÍÑ¡ÉÃÊдǡÊÓËÃѺ¢ÂÒ¸ØáԨ¢Í§·èÒ¹ 
¾ÃéÍÁ·Ñé§á¶Áâ»Ãá¡ÃÁ·Ñ¹ÊÁѨҡµèÒ§»ÃÐà·ÈÍÕ¡ËÅÒÂÍÂèÒ§ ÃÒ¤Ò¶Ù¡ÁÒ¡ËÒäÁèä´éÍÕ¡áÅéÇ 
¨Ó˹èÒ¨ӹǹ¨Ó¡Ñ´

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
php-general@lists.php.net


--
---BeginMessage---
 Jonas Rosling wrote:

Is there any way you can skip for example the first 4 array
 values/posisions
in an array no matter how many values it contains?

http://php.net/array_slice


-- 
Like Music?
http://l-i-e.com/artists.htm
---End Message---
---BeginMessage---


$int = (int) $value;

On Fri, June 9, 2006 2:51 am, Jonas Rosling wrote:
 Is there any easy way to trim or pick out the none decimal values in
 a
 numric value? Like:

 1,333 = 1
 5,667 = 5
 12,145 = 12
 15,997 = 15

 Thanks // Jonas



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




-- 
Like Music?
http://l-i-e.com/artists.htm
---End Message---
---BeginMessage---
On Fri, June 9, 2006 12:59 am, Dave M G wrote:
 I have a database of about 120 users. Each weak I send out a
 newsletter.
 So far as I know, it's been working fine for the last couple of years.

 Then recently some users emailed me to let me know that they haven't
 been receiving all the messages. I added extra output to my script to
 echo out the name of each member that got an email sent to them, and I
 can now see that only about 50 of them are getting the email.

 The only think that has changed that I can think of is that I've
 upgraded to MySQL 5.0. However, given the type of problem I'm having,
 I
 don't think it's a MySQL problem, it appears much more likely to be a
 problem with my PHP code.

 This is the script that sends out the message (edited slightly to take
 out irrelevant bits of newsletter content):

 - - - -
 $count = 0;
 while ( $member = mysql_fetch_row($result) )
 {
 set_time_limit(0);
 $subject = Newsletter subject line;
 $mailcontent = This message was sent to  . $member[0] .  at
 {$member[1]}
 Blah, blah, blah - newsletter content goes here.;
 mail($member[1], $subject, $mailcontent, $fromaddress);

mail() returns a value to indicate if it failed/succeeded in queueing
up the email.

Check it.

Also, every call to mail() fires up a sendmail process.

This is expensive.

maybe sleep(1) in between calls

or consider switching to SMTP

or sending ONE email with a Bcc...  Though that has a slightly higher
probability of being labeled as spam.

 $count++;
 echo pNewsletter sent to  .  $member[0] .  at  . $member[1] .
 /p;
 }
 echo pA total of  .$count . emails were sent out./p\n;
 - - - -

 The script actually dies before it gets to the last echo which echoes
 the value of $count. It outputs about 50 lines of Newsletter sent to
 usersname at [EMAIL PROTECTED] and then the cursor is stuck in hourglass
 mode and the browser is continually waiting a response. It stays like
 that indefinitely, and the only way it stops is if I go to another
 page
 or shut down the browser.

 I have heard that the mail() function does have limitations on how
 many
 emails it sends out. But I thought it took hundreds, somewhere between
 500 and a thousand, of individual emails before it would die. And I
 also
 thought the set_time_limit(0) function would alleviate the problem of
 timing out.

 Where have I gone wrong 

php-general Digest 11 Jun 2006 00:22:39 -0000 Issue 4178

2006-06-10 Thread php-general-digest-help

php-general Digest 11 Jun 2006 00:22:39 - Issue 4178

Topics (messages 237733 through 237745):

Curio
237733 by: Dave Goodchild
237737 by: Jay Blanchard
237739 by: tedd

$B$$s$?!B;$7$F$k$h!#(B
237734 by: saki

$B#1#0?M$r?)$($?!$*$$$7$#%5%$%H!*!*!*(B
237735 by: rika

Re: Restrict uploaded scripts
237736 by: Mathias Bundgaard Svesson

Re: Mail sending program (beginner)
237738 by: tedd

Re: Session puzzle... / why no new session?
237740 by: Ryan A

HTML (php page) - PDF recommendation
237741 by: Ryan A
237743 by: Frank Arensmeier

Re: Tables vs. databases
237742 by: tedd

Re: order of elements in $_POST super global
237744 by: Ben Liu

Re: How to re-order an array
237745 by: Rafael

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
php-general@lists.php.net


--
---BeginMessage---

Just a question out of curiousity for the language lawyers out there. Why is
it illegal to begin a variable name with a number in php?

--
http://www.web-buddha.co.uk

dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css)

look out for project karma, our new venture, coming soon!
---End Message---
---BeginMessage---
[snip]
Just a question out of curiousity for the language lawyers out there.
Why is
it illegal to begin a variable name with a number in php?
[/snip]

This is fairly standard in programming languages. Years ago (sometime in
the 70's) the reasoning was given to me, but I have long since replaced
the data at that address with some other, probably trivial, fact. I
tried a quick Google, but no joy.
---End Message---
---BeginMessage---
At 11:31 AM +0100 6/10/06, Dave Goodchild wrote:
Just a question out of curiousity for the language lawyers out there. Why is
it illegal to begin a variable name with a number in php?


I don't know why in they do it in php, but I would guess that it's one of those 
legacy things.

Back when I was programming with rocks, a language called FORTRAN came along 
(before FORTRAN started having Roman Numerals after its name).

The rules of this new language was that integers could only start with the 
letters I, J, K, L ,M, N (hence our custom to use $i , $j, $k for loops) and 
all other real number could start with any other character but those, and could 
not start numbers -- however, both variables could contain numbers but were 
limited to just six letters total. (But note we didn't have to start variables 
with a $ ).

As far as strings were concerned -- what the hell were those? If you wanted to 
print something, you use a FORMAT statement and therein you might find syntax 
that could start with a number, such as 4F5.0, but that was just to format a 
number for print -- it had nothing to do with a variable name.

In defense of the decision of the time, I doubt that many of you remember IBM 
punch cards (one card for every line of code in your program) but it was a 
*great* deal easier to review and edit your stack of code if you kept numbers 
and letters separate with different meanings.

So, my guess is it's legacy.

My question to you is, what are you passing on that in 40 years some young 
programmer will ask Why is it illegal to...  :-)

tedd

-- 

http://sperling.com  http://ancientstones.com  http://earthstones.com
---End Message---
---BeginMessage---
最近セフレを探す女の子が増えました!
その響きだけ聞けば「なんだかなぁ」って思う人もいると思います。
でも、実際は大多数の人とセックスをしないようになるので衛生的ですし、
恋人だと少々重く感じる人がいるからこういう関係が成り立つわけで、
一緒に買い物にいったり、映画を見たり、恋愛相談をできたりする
「仲のいい友達感覚」でお付き合いしている方が多いみたいです。
お互いの欲望を満たしあえる友達 . . . 。
いけない事なんてなにもない!!
あなたもここで素敵なお相手を見つけてください!!
http://vqlh.com/?hy04







拒否
[EMAIL PROTECTED]




---End Message---
---BeginMessage---
ユーザー体験人気NO.1サイト!女性会員が日本最大級の圧巻サイトです。

恋人、不倫、セフレ、目的に沿って募集が可能。約60%程の女の子が写真を掲載している。

完全無料登録サイト
お試しあれ
http://vqlh.com/?hy03








拒否
[EMAIL PROTECTED]




---End Message---
---BeginMessage---
Would it then be posible to restrict it in some other way, for example
using chroot? Or do I just have to make sure that the modules come from
a source that I trust or look through the code?

fre, 09 06 2006 kl. 10:47 -0400, skrev Jim Moseby:
  
  Wouldn't it even be posible, if the script couldn't be run 
  directly, but
  had to be run through require or something like that?
  
 
 Require just includes the code inline.  It still runs on the webserver as
 the server user as if it were one big script.  I think you would have to
 sanitize the uploaded code before allowing it to run.  Writing the
 sanitation algorithm to perform such a task would be a nightmare.
 
 JM
---End Message---
---BeginMessage---
At 10:54 AM +0530 6/10/06, aci india wrote:
Dear group,

Description:

Following is the code which I tried