PHP not working, help needed.....

Status
Not open for further replies.

kaykim

New Member
Messages
29
Reaction score
0
Points
0
I'm quite new at all this and need some help with a script (called aximail), that as the name says is for sending mail. I have PHP version 2, so mail() is enabled, but I still don't receive mail when filling the simple form. I tested on a friend's paid hosting, and it works fine.

This is it.......

demo.html

<form method="post"
action="axiMail.php">
<p>
<input name="receptor" type="hidden" id="receptor"
value="admin@tudominio.com">
<input name="remitente" type="hidden" id="remitente"
value="info@formulariosdesdetudominio.com">
<input name="tema" type="hidden" id="tema"
value="Información desde el sitio web">
<input name="redireccion" type="hidden" id="redireccion"
value="http://tudominio/exito.html">
<br>
Nombre:
<input name="nombre" type=text id="nombre">
<input type="submit" name="Submit" value="Submit">
<br>
</p>
</form>

axiMail.php

<?

while(list($nombre_campo, $valor_campo ) = each($HTTP_POST_VARS )) {
strtolower ($nombre_campo);

if(is_array($valor_campo)){
$msg .= ucfirst($nombre_campo).": n";

while (list ($val) = each ($valor_campo)) {
$msg .= $val."n";
}
$msg .= "n";
}else{
if($nombre_campo != "submit" && $nombre_campo !="receptor" && $nombre_campo !="remitente" && $nombre_campo !="tema" && $nombre_campo !="redireccion"){
$msg .= ucfirst($nombre_campo).": ".$valor_campo."nn";}
}

}

$msg .= "----------------------------------------------n";
$msg .= "USER AGENT: ".$HTTP_USER_AGENT."n";
$msg .= "IP: ".$REMOTE_ADDR."n";

mail($receptor,$tema,$msg,"From: $remitente");

header("Location: $redireccion");

?>

What could be the problem???
 

Starshine

Legend Killer
Messages
14,423
Reaction score
0
Points
0
Please read the recent Announcments. You have to upgrade your Php version in the Account Management Panel. :)
 

kaykim

New Member
Messages
29
Reaction score
0
Points
0
I already have intermediate PHP and was denied advanced........... Reason: I should post in the forum to get my problem fixed.
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
I have verified mail() does work on the server you are on and your PHP version is correct. There is something wrong with your script, please seek support from the script creator.

-Corey
 

kaykim

New Member
Messages
29
Reaction score
0
Points
0
I don't think something is wrong with the script, I tested it myself on a friend's hosting and it worked perfectly. Maybe I should try another script, any idea for something simple that sends mail?? :)
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
Go to PHP.net and type in mail in the search, it will bring you to the function with some simple examples.
 
Status
Not open for further replies.
Top