php-general Digest 5 May 2007 14:13:17 -0000 Issue 4774

2007-05-05 Thread php-general-digest-help

php-general Digest 5 May 2007 14:13:17 - Issue 4774

Topics (messages 254452 through 254468):

Re: parse error
254452 by: Brad Sumrall
254453 by: Brad Sumrall
254454 by: Brad Sumrall

Re: Parse error  (the long version)
254455 by: Brad Sumrall

Re: Parse error (I see my major problem)
254456 by: Brad Sumrall

Re: parse error  (point me where)
254457 by: Brad Sumrall

Newbie Question - Form To Email Needed
254458 by: revDAVE
254460 by: revDAVE
254462 by: revDAVE
254463 by: Jim Lucas
254466 by: itoctopus

Re: parse error (close this one)
254459 by: Brad Sumrall

Why create_element function always return false?
254461 by: Victor

Re: Problem with timeout
254464 by: Frank Arensmeier

PEAR MIME Construct
254465 by: Feris Thia C

Re: Getting multitple select values on PHP side
254467 by: itoctopus

Mailbox @php.net
254468 by: Shadow

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:
[EMAIL PROTECTED]


--
---BeginMessage---
Parse error: parse error, unexpected '}' in
/home/content/c/u/t/cuteirka/html/commonlogin_new.php on line 37

Because I am not starting the brackets anywhere else.
My only php function is between line 37 and 39





-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 04, 2007 9:43 PM
To: Brad Sumrall
Subject: Re: [PHP] parse error

}else{
Brad Sumrall wrote:
 Hi folk, I am writing a login in script and get the following:

 Parse error: parse error, unexpected T_ELSE in
 /home/content/c/u/t/cuteirka/html/commonlogin_new.php on line 37

 I am basically pulling this straight out the php for dummies manual.

  

 Can someone kindly point me in the right direction on this one!

  

 Brad

  

  

 1  form action=/phpBB/login.php method=post target=_top

 2  table width=200 cellpadding=4 cellspacing=1 border=0
 class=forumline align=center

 3  tr

 4  th background=images/login_top2.jpg
 height=30 class=thHead nowrap=nowrap/th

 5  /tr

 6  tr

 7  td class=row1table border=0
 cellpadding=3 cellspacing=1 width=100%

 8  tr

 9  td width=11% align=rightdiv
 align=leftspan class=genUsername:/span/div/td

 10 /tr

 11 tr

 12 td align=rightinput type=text
 class=post name=username size=25 maxlength=40 value= //td

 13 /tr

 14 tr

 15 td align=rightdiv
align=leftspan
 class=genPassword/span/div/td

 16 /tr

 17 tr

 18 td align=rightspan class=gen

 19 input type=password class=post name=password size=25
 maxlength=32 /

 20 :/span/td

 21 /tr

 22 tr align=center

 23 td colspan=2span class=genLog
me
 on automatically: 

 24 input type=checkbox name=autologin //span/td

 25 /tr

 26 tr align=center

 27 td colspan=2input type=hidden
 name=redirect value= /input type=submit name=login
 class=mainoption value=Log in //td

 28 /tr

 29 tr align=center

 30 td colspan=2span
class=gensmalla
 href=forgot_password.php class=gensmallI forgot my
 password/a/span/td

 31 /tr

 32 /table

 33 /td

 34

 25   /tr

 36 ?php

 37 {else}

 38 ?

 tr

   td width=207 height=32
background=images/login_top2.jpg
 class=headerlogout align=center

 table width=100%

 tr

 td width=30 height=27/td

 td align=lefta
 href=javascript:logout() class=link1Log out/a/td

 /tr

 /table

 /td

 /tr

 tr  

 td align=center
 class=logincenterbg

 table width=88% border=0 cellspacing=0 cellpadding=0

 tr

 td height=10 align=left
 class=bluetext/td

 /tr

 tr

 td align=left class=link2Welcome
:
 ?php echo $_SESSION[userid] ?/td

 /tr

 tr

 td 

Re: [PHP] Newbie Question - Form To Email Needed

2007-05-05 Thread Jim Lucas

Q: is there some kind of mail command like this for PHP?


yes, it is called mail()

check out this example, it is short but to the point.

http://us.php.net/mail#57473

Jim Lucas

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



Re: [PHP] Problem with timeout

2007-05-05 Thread Frank Arensmeier

4 maj 2007 kl. 23.48 skrev Richard Lynch:


On Fri, May 4, 2007 3:42 pm, Frank Arensmeier wrote:

I still think that the best way to go is to not involve Apache at all
when running the script. Because the script already has functions for
output logging etc. it is no big deal to change the code so that it
can be run from PHP CLI.


Once you said it was something you did weekly, it's pretty much a
given that you ought to use a cron job with PHP CLI and take Apache
out of the picture entirely...


You are absolutely right. I might also mention that running the  
script under PHP CLI did two things:


1) No problems with timeout settings anymore.
2) The script takes 10 minutes less time to finish

However, I realized that PHP CLI is version 4.4.4 whereas the Apache  
module PHP is version 5.something. After some modifications to the  
script, it is running flawlessly now.



Actually, even if it's for surfer interaction, anything taking that
long should probably be turned into a jobs oriented architecture,
and queue up the work for a cron job later, with user email
notification when it's done.

NOBODY wants to sit that long watching the browser do nothing.


I totally agree. The script was never ment to be user-triggered.  
Instead, the archiving process takes place weekly.


Thanks you all! Have a nice weekend.

//frank


--
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?



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



[PHP] PEAR MIME Construct

2007-05-05 Thread Feris Thia C

Hi All,

I've read my mail through php://stdin and then decode email message 
using MIME package. How can I change the To header field and then 
reconstruct and send it again through sendmail ?


Regards,

Feris

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



[PHP] Re: Newbie Question - Form To Email Needed

2007-05-05 Thread itoctopus
1st page:

form
textarea name='thebody'/texarea
/form

2nd page:

$str_body = $_POST['thebody'];
mail('[EMAIL PROTECTED]', 'This is the 
subject', $str_body);

Of course you can have the email and the subject fields come also from the 
1st page.

Hope that helps!

-- 
itoctopus - http://www.itoctopus.com
revDAVE [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi folks,

 I have a form on page one - and would like to submit to a second page in 
 PHP
 that could grab the fields and send it out as an e-mail.

 Are there any links that show how do this?


 Thanks in advance - Dave


 --
 Thanks - RevDave
 [EMAIL PROTECTED]
 [db-lists] 

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



Re: [PHP] Getting multitple select values on PHP side

2007-05-05 Thread itoctopus
Totally agree, generates a lot of support.

-- 
itoctopus - http://www.itoctopus.com
Richard Lynch [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 On Fri, May 4, 2007 3:56 pm, Skip Evans wrote:
 I have a requirement for a select on a form that
 has to be able to get multiple values in the form
 processing PHP side.

 You just multiple to the select... tag to be
 able to select multiple values, but on the PHP
 side the $_POST value for the form only has the
 last one selected.

 PS
 WARNING:
 Most surfers have NO IDEA how to work a MULTIPLE select...

 You need instructions right next to it, if it's important that they
 pick more than one.

 If it's only a nifty feature to choose more than one, let the smart
 ones revel in their edumacation and the not-so-swift will never
 realize what they are missing.


 -- 
 Some people have a gift link here.
 Know what I want?
 I want you to buy a CD from some indie artist.
 http://cdbaby.com/browse/from/lynch
 Yeah, I get a buck. So? 

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



[PHP] Mailbox @php.net

2007-05-05 Thread Shadow
Hi, All.

Does anybody know how someone can get an email @php.net?


Thanks.

 
-
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.

[PHP] Re: Mailbox @php.net

2007-05-05 Thread M.Sokolewicz
Get a php.net CVS account and you get an @php.net email adress with it. 
It's an extra for the work you do, not just to be able to show off your 
new email.


- tul

Shadow wrote:

Hi, All.

Does anybody know how someone can get an email @php.net?


Thanks.

 
-

Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.


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



[PHP] mail() only working with php-cli

2007-05-05 Thread Andy B.
Is there any way to debug the mail() function within PHP4 or PHP5?

The following code is not working when called from a browser, but it does
work from the command line:

?php
$to  = '[EMAIL PROTECTED]';
$subject = 'the subject';
$message = 'hello...';
$headers = 'From: [EMAIL PROTECTED]' . \r\n .
'Reply-To: [EMAIL PROTECTED]' . \r\n .
'X-Mailer: PHP/' . phpversion();

if(mail($to, $subject, $message, $headers))
echo IT WORKED;
else
echo DAMN!!!;
?


php and php-cli use the same php.ini file. Php via Apache is launched as a
module, NOT as CGI!

sendmail_path is correctly set to /usr/sbin/sendmail -t -i

the /var/log/mail.log only shows activity when I try my code via command
line, so my best guess is that sendmail is never reached when run from the
browser.

I went a little deeper and modified the sendmail_path to /tmp/test.sh, which
contains:

#!/bin/bash
echo I was used!!  /tmp/test.log

(chmod 777 /tmp/test.sh)

Again I tried my script from the web and from the command line. Same
result... command line is fine and generates the test.log file. In the
browser no log file is created.

I have already made numerous LAMP installations, but I never had this kind
of mail() issue. This installation is quite simple: standard Apache 2.0 with
php5, php5-mysql, php5-gd, ... This makes it even more frustrating :-(

What am I missing?

Thanks a lot!!


Andy

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



[PHP] Feisty Fawn and apt-get

2007-05-05 Thread Skip Evans

Hey all,

I've installed Feisty Fawn on the curmudgeon 
barber's machine, but it won't get any of the 
outside packages I've tried to get. I've tried an


apt-get install {package}

...on digikam, kate, gftp, and others. All stuff I 
had no trouble getting with Edgy.


I checked the sources.list file and it has both 
universe and multiverse enabled.


Is there something with the FF repositories or 
something I'm missing?


Thanks,
Skip
--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240

=-=-=-=-=-=-=-=-=-=-=

Check out PHPenguin, a lightweight and versatile 
PHP/MySQL development framework.


http://phpenguin.bigskypenguin.com

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



Re: [PHP] Feisty Fawn and apt-get

2007-05-05 Thread Travis Doherty
Skip Evans wrote:

 Hey all,

 I've installed Feisty Fawn on the curmudgeon barber's machine, but it
 won't get any of the outside packages I've tried to get. I've tried an

 apt-get install {package}

 ...on digikam, kate, gftp, and others. All stuff I had no trouble
 getting with Edgy.

 I checked the sources.list file and it has both universe and
 multiverse enabled.

 Is there something with the FF repositories or something I'm missing?

 Thanks,
 Skip

Wrong list?
T

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



Re: [PHP] Feisty Fawn and apt-get

2007-05-05 Thread Davi
Em Sábado 05 Maio 2007 18:01, Skip Evans escreveu:
 Hey all,

 I've installed Feisty Fawn on the curmudgeon
 barber's machine, but it won't get any of the
 outside packages I've tried to get. I've tried an

 apt-get install {package}

 ...on digikam, kate, gftp, and others. All stuff I
 had no trouble getting with Edgy.

 I checked the sources.list file and it has both
 universe and multiverse enabled.

 Is there something with the FF repositories or
 something I'm missing?

 Thanks,
 Skip

First: use aptitude instead apt-get... =]
Second: use an debian-list to debian's questions instead an php-list... =]

HTH

-- 
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. 


pgp5RWUxpURPp.pgp
Description: PGP signature


Re: [PHP] mail() only working with php-cli

2007-05-05 Thread Tijnema !

On 5/5/07, Andy B. [EMAIL PROTECTED] wrote:

Is there any way to debug the mail() function within PHP4 or PHP5?

The following code is not working when called from a browser, but it does
work from the command line:

?php
$to  = '[EMAIL PROTECTED]';
$subject = 'the subject';
$message = 'hello...';
$headers = 'From: [EMAIL PROTECTED]' . \r\n .
   'Reply-To: [EMAIL PROTECTED]' . \r\n .
   'X-Mailer: PHP/' . phpversion();

if(mail($to, $subject, $message, $headers))
   echo IT WORKED;
else
   echo DAMN!!!;
?


php and php-cli use the same php.ini file. Php via Apache is launched as a
module, NOT as CGI!

sendmail_path is correctly set to /usr/sbin/sendmail -t -i

the /var/log/mail.log only shows activity when I try my code via command
line, so my best guess is that sendmail is never reached when run from the
browser.

I went a little deeper and modified the sendmail_path to /tmp/test.sh, which
contains:

#!/bin/bash
echo I was used!!  /tmp/test.log

(chmod 777 /tmp/test.sh)

Again I tried my script from the web and from the command line. Same
result... command line is fine and generates the test.log file. In the
browser no log file is created.

I have already made numerous LAMP installations, but I never had this kind
of mail() issue. This installation is quite simple: standard Apache 2.0 with
php5, php5-mysql, php5-gd, ... This makes it even more frustrating :-(

What am I missing?

Thanks a lot!!


Andy



Are you sure that the PHP CLI and PHP-module are exactly the same build?
And you could try to set error reporting level to E_ALL, maybe there's
a warning generated that's hidden now because of a lower reporting
level.

Tijnema

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



RE: [PHP] mail() only working with php-cli

2007-05-05 Thread Andy B.
Yes, it's the same build.

I am running php5 on a debian distribution that has been installed via
apt-get.

Details:

--
CLI php.ini = /etc/php5/cli/php.ini

PHP 5.2.0-8+etch3 (cli) (built: Apr 29 2007 10:42:07) 
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
--

--
APACHE php.ini = = /etc/php5/apache2/php.ini

PHP Version 5.2.0-8+etch3 

System  Linux A011 2.6.21 #1 SMP Fri Apr 27 22:50:50 CEST 2007 i686  
Build Date  Apr 29 2007 10:24:27  
Server API  Apache 2.0 Handler  
Virtual Directory Support  disabled  
Configuration File (php.ini) Path  /etc/php5/apache2/php.ini  
--


Both are exactly the same, as I copied the CLI version into the Apache
Version. Of course I first tested with the original Apache php.ini before
overwriting it with the CLI version.

Unfortunately error Reporting does not help. I've already tested with E_ALL
and also dumping errors/warnings into log files...



Andy

-Original Message-
From: Tijnema ! [mailto:[EMAIL PROTECTED] 
Sent: Saturday, May 05, 2007 23:58
To: Andy B.
Cc: php-general@lists.php.net
Subject: Re: [PHP] mail() only working with php-cli


Are you sure that the PHP CLI and PHP-module are exactly the same build?
And you could try to set error reporting level to E_ALL, maybe there's
a warning generated that's hidden now because of a lower reporting
level.

Tijnema

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



Re: [PHP] Why create_element function always return false?

2007-05-05 Thread Tijnema !

On 5/5/07, Victor [EMAIL PROTECTED] wrote:

?php
$doc = domxml_new_doc(1.0);
$node = $doc-create_element(para);
$newnode = $doc-append_child($node);
$newnode-set_attribute(align, left);
?

I just run the example that is from php manual. But there is some error

--
Warning: domnode::append_child() expects parameter 1 to be object, null
given in C:\AppServ\www\tutorial\test.php on line 4

Fatal error: Call to a member function set_attribute() on a non-object
in C:\AppServ\www\tutorial\test.php on line 5
--


It is very strangeI found that create_element always return
falsenomatter what I dowhat example I tried...
Not only create_element return false but also create_coment do so...
Why???

I run php 5.2.2 with AppServ . The version of docmxl is 20626 (I just
call domxml_version() ). OS is Windows XP.

Would someone help me ,please?
Thanks a lot.

Victor.



AFAIK, append_child and create_element are decprecated, they are only
used in PHP4.
You should use appendchild and createelement instead.

try example 498 located here:
http://www.php.net/manual/en/function.dom-domdocument-createelement.php

Tijnema

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



Re: [PHP] mail() only working with php-cli

2007-05-05 Thread Oliver Block
Hello Andy,

did you take a look into the apache log files?

Regards,

Oliver


Am Samstag, 5. Mai 2007 22:53 schrieb Andy B.:
 Is there any way to debug the mail() function within PHP4 or PHP5?

 The following code is not working when called from a browser, but it does
 work from the command line:

 ?php
 $to  = '[EMAIL PROTECTED]';
 $subject = 'the subject';
 $message = 'hello...';
 $headers = 'From: [EMAIL PROTECTED]' . \r\n .
 'Reply-To: [EMAIL PROTECTED]' . \r\n .
 'X-Mailer: PHP/' . phpversion();

 if(mail($to, $subject, $message, $headers))
 echo IT WORKED;
 else
 echo DAMN!!!;
 ?


 php and php-cli use the same php.ini file. Php via Apache is launched as a
 module, NOT as CGI!

 sendmail_path is correctly set to /usr/sbin/sendmail -t -i

 the /var/log/mail.log only shows activity when I try my code via command
 line, so my best guess is that sendmail is never reached when run from the
 browser.

 I went a little deeper and modified the sendmail_path to /tmp/test.sh,
 which contains:

 #!/bin/bash
 echo I was used!!  /tmp/test.log

 (chmod 777 /tmp/test.sh)

 Again I tried my script from the web and from the command line. Same
 result... command line is fine and generates the test.log file. In the
 browser no log file is created.

 I have already made numerous LAMP installations, but I never had this kind
 of mail() issue. This installation is quite simple: standard Apache 2.0
 with php5, php5-mysql, php5-gd, ... This makes it even more frustrating :-(

 What am I missing?

 Thanks a lot!!

 
 Andy

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



Re: [PHP] Feisty Fawn and apt-get

2007-05-05 Thread Mike Shanley


Davi wrote:

First: use aptitude instead apt-get... =]
Second: use an debian-list to debian's questions instead an php-list... =]
  

Third: Go Feisty!!!

--
   ~Mike Shanley~

   ~you are almost there~

 ~no, wait. you are there!~

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



[PHP] Re: cURL: multipart/form-data POST request with empty file part

2007-05-05 Thread Manuel Lemos
Hello,

on 05/04/2007 09:44 AM Emmanuel Raulo-Kumagai said the following:
 Hello
 
 I'm writting a client in PHP for some CMS.
 I need to send an HTTP POST request with a multipart/form-data content.
 One of the parts is a file which must look like the request was issued
 after submitting a web form with a input type=file ... field left
 empty, which is *NOT* the same as sending an empty file.
 This means the part should look like this in the request:
 
 -8179530329826\r\n
 Content-Disposition: form-data; name=file; filename=\r\n
 Content-Type: application/octet-stream\r\n
 \r\n
 \r\n
 -8179530329826\r\n
 
 Is there a way to do so with cURL ?

I use this HTTP client class that implicitly composes HTTP requests like
that when it is used to upload files emulating Web forms.

http://www.phpclasses.org/httpclient


-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Best way to format double as money?

2007-05-05 Thread Todd Cary
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

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