[PHP] Php script for mail in a xhtml page

2007-09-07 Thread Mauro Sacchetto
I've to implement a php script in a web page to send mail.
If I use a .html form and a separate .php script, all works fine.
In the contrary, if I try to put the script into the .html file,
I've some troubles... Here's the code:

==
?php
?
xml version=1.0 encoding=utf-8
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;html
xmlns=http://www.w3.org/1999/xhtml;

head
meta name=generator content=Quanta Plus 
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
titleB#038;B #171;LA LOCANDA DI RE MANFREDI#187; - PALAZZO SAN
GERVASIO (PZ)/title
meta name=description content=Ora c'#232; un Bed#038;Breakfast
anche
a Palazzo San Gervasio (PZ) 
meta name=keywords content=b#038;b,bed#038;breakfast, Palazzo San
Gervasio, Potenza, Basilicata, Lucania 
link rel=stylesheet type=text/css href=layout.css 
/head
body

ul class=navbar
lia href=index.htmlHome Page/a/li
lia href=bed.htmlIl nostro Bed#038;Breakfast/a/li
lia href=paese.htmlIl paese/a/li
lia href=storia.htmlLa storia/a/li
lia href=tradizioni.htmlLe tradizioni/a/li
lia href=indirizzi.htmlIndirizzi utili/a/li
/ul

h2#200; possibile inviarci una comunicazione direttamente da questo
form/h1
h2Riempire i campi richiesti e premere il pulsante Invia/h2
br /br /

?
if (isset($_POST['action'])  ($_POST['action']=='invia')) {
$receiverMail = [EMAIL PROTECTED];
$name = ltrim(rtrim(strip_tags(stripslashes($_POST['name'];
$email = ltrim(rtrim(strip_tags(stripslashes($_POST['email'];
$subject = ltrim(rtrim(strip_tags(stripslashes($_POST['subject'];
$msg = ltrim(rtrim(strip_tags($_POST['msg'])));
$ip = getenv(REMOTE_ADDR);
$msgformat = Messaggio da: $name ($ip)\nEmail: $email\n\n$msg;
if(empty($name) || empty($email) || empty($subject) || empty($msg)) {
echo h3Il messaggio non e' stato inviato/h3
h3Si prega di compilare tutti i campi/h3;
?
form action=?php echo $_SERVER['PHP_SELF']; ? method=post
Nome:br br 
input name=name size=50 maxlength=40 
br br/br 
Indirizzo e-mail:br /br /
input name=email size=50 maxlength=40 
br br br 
Oggetto:br br 
input name=subject size=50 maxlength=40 
br br br 
Messaggio:br br 
textarea name=msg cols=50 rows=8/textarea
br br br 
input type=submit value=Invia 
#160; #160; #160; #160; #160; #160;
input type=reset value=Cancella 
/form
?
}

elseif(!ereg(^[_a-z0-9-]+(\.[_a-z0-9-]+)[EMAIL PROTECTED](\.[a-z0-9-]+)*(\.[a-z
{2,3})$, $email)) {
echo h3Il messaggio non e' stato inviato/h3
h3L'indirizzo e-mail indicato non e' valido/h3;
?
form action=?php echo $_SERVER['PHP_SELF']; ? method=post
Nome:br /br /
input name=name size=50 maxlength=40 value=? echo $name. ?
br /br /br /
Indirizzo e-mail:br /br /
input name=email size=50 maxlength=40 value=wrong! 
br /br /br /
Oggetto:br /br /
input name=subject size=50 maxlength=40 value=?echo $subject;?
br /br /br /
Messaggio:br /br /
textarea name=msg cols=50 rows=8? echo $message;?/textarea
br /br /br /
input type=submit value=Invia  #160; #160; #160; #160;
#160; #160;
input type=reset value=Cancella 
/form
?
}
else {
mail($receiverMail, $subject, $msgformat, From: $name $email);
echo h3Il messaggio e' stato inviato correttamenteh3
h3Risponderemo il piu' presto possibile/h3
h3Grazie di averci scritto/h3; }

}
?
/body
/html
==

When I try to open the page, I receive this error:

Parse error: syntax error, unexpected T_STRING 
in /var/www/netsons.org/samiel/form2.php on line 79

Do u see my error?
Thanx!
MS



-- 
linux user no.: 353546
public key at http://keyserver.linux.it

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



Re[2]: [PHP] Parsing mail file

2007-01-30 Thread Mauro Lorenzutti
Hi Pierre,

I have the same problem: I'm searching a function to parse an email
file. I found this one:

http://pear.php.net/package/Net_IMAP/

I think that you can extract the code you need from the function
getParsedHeaders.

Regards,
 Mauro Lorenzutti


e-mail:  [EMAIL PROTECTED]

-
WEBFORMAT srl | Corte Europa, 12 | I-33097 SPILIMBERGO PN
 Tel +39-0427-926.389  --  Fax +39-0427-927.653
   [EMAIL PROTECTED]  --  www.webformat.com
-

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



[PHP] REQUIRE_ONCE AND CLASSES

2002-12-16 Thread Mauro Romano Trajber
Hi all.
I got a problem.
When i include a external file using require_once('my_file.php'); in a class file i 
cant use my_fileĀ“s vars and functions.
Example:
?
require_once HTML/IT.php;
class Home{
  var $tpl_home= new IntegratedTemplate(../templates);
   function Home(){
 $this-tpl_home-loadTemplatefile(index.tpl.html, true, true);
 $this-tpl_home-setCurrentBlock(GEREN);
 $this-tpl_home-setVariable(GEREN,b);
 $this-tpl_home-parseCurrentBlock(GEREN);
 $this-tpl_home-setCurrentBlock(PRINCIPAL);
 $this-tpl_home-setVariable(DADOS,a);
 $this-tpl_home-parseCurrentBlock(PRINCIPAL);
   }
   function show(){
   $this-tpl_home-show();
   }
}
$alo=new Home();
$alo-show();
?

DONT WORK!!!
why?
im new in php.
i will thank any help.
sorry my english!!! :)
Mauro!


Re: [PHP] keep alive refresh

2002-06-06 Thread Mauro

It would help to know exactly what information you are gathering and for
what reason are you storing it.
-Kevin

Kevin, thanx for your reply.

Basically the data flow is the following:
. get the value from the web form
. pass the value to the program
. this program gathers data from a couple of remote databases
. then according to the values returned by this program I update a local
database.
. in the end I need to display the results.

The program that I have to use gets info regarding the users.
I need the info to update an internal db.
The program (a mix of C and shell) usually takes a very long time to end.

I've tryed to modify the php.ini and set_time_limit(time) but they don't
work.

I wonder if I have to use the HTTP headers... Ive tried but not sure it's
the right way to do it...

cheers
Mauro




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




[PHP] keep alive refresh

2002-06-03 Thread Mauro

Hello,

I looked for some old questions about my problem in the m.l. archive but
I did not find anything.

I'm writing a php script which takes a couple of values from the web
interface and then passes these values to a program which writes it's output
on a file.
Then the output of the file is published on the web page.

The problem is that this program may take 1 minute up to 1 hour to write all
the output on the file and the browser times out.

Any suggestion on how to solve this?

Many thanx
Mauro



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




[PHP] FTP without FTP module

2001-03-28 Thread Mauro Biraghi

How can I do FTP without FTP module?
Thanks.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]