PDA

View Full Version : noob...



jonybigude
02-16-2006, 09:26 AM
noob or nerd, whatever you like... i just don't get along with php very much...:(

So, i'm making this e-mail form here, with a flash base, and a php background. Intheory should work, but it's not working... i already spent eterneties trying to figure out what's wrong, but i just can't say what it is...

Can somebody help me???:confused:

Twey
02-16-2006, 12:19 PM
it's not working...Well, that's helpful. How does the behaviour differ from what's expected of it? Do you get any error messages?

jonybigude
02-16-2006, 12:49 PM
no, i don't recieve nothing at all... that's the problem, i should recieve a e-mail with the data from the fla file... but i have allmost 100% sure that there is no error on the fla file, although i may be wrong...

Twey
02-16-2006, 01:22 PM
The SMTP protocol uses CRLF (\r\n) to seperate headers.
$header = "From: " . $_POST['sender_nome'] . " <" . $_POST['sender_mail'] . ">\r\n";
$header .= "Reply-To: " . $_POST['sender_nome'] . " <" . $_POST['sender_mail'] . ">\r\n";
$header .= "X-Mailer: PHP/" . phpversion() . "\r\n";
$header .= "X-Priority: 1\r\n";

jonybigude
02-16-2006, 05:43 PM
Are you sure that it was the only mistake i made on the php code?... it's still not working... :(

Twey
02-16-2006, 07:37 PM
Set error reporting to strict:

<?php
error_reporting(E_STRICT);and add error checking on the mail() function. It returns false if the mail could not be sent.

jonybigude
02-17-2006, 12:49 PM
It just don't send any error... now, this is odd... =s maybe it's because it's linked with flash... or i'm doing it all wrong...

A friend of mine said to separate


mail("inesmarques@oninetspeed.pt,jonybigude@gmail.com,cscimoes@cne-escutismo.pt", "Inscricao 4 Ciclo - 2 Encontro", $body, $header);

from the


$header = "From: " . $_POST['sender_nome'] . " <" . $_POST['sender_mail'] . ">\r\n";
$header .= "Reply-To: " . $_POST['sender_nome'] . " <" . $_POST['sender_mail'] . ">\r\n";
$header .= "X-Mailer: PHP/" . phpversion() . "\r\n";
$header .= "X-Priority: 1\r\n";

and put it in the end, because it was sending the e-mail before the code put the data inside it... i changed, but although it still doesn't work...

:(

Is anyone here who can figure what's wrong with this inscription form????...

Twey
02-17-2006, 01:00 PM
Does mail() return true or false?

jonybigude
02-17-2006, 08:20 PM
It just doesn't... no feedback of any kind is sent... seriouslly i'm starting to dispair...

Twey
02-17-2006, 08:25 PM
It is listed as a boolean function. This means it must return either true or false. Please check its return value with an if statement.

djr33
03-03-2006, 04:56 AM
jony, twey is not talking about what is sent to you via email, but rather what you see when you view the page.

you are, obviously, getting some sort of error when sending. he's trying to find out what, if anything, is displayed telling you what went wrong.

you could do something like

if (mail(...))

or something to check that it worked.