...

View Full Version : Form help



smrpgx
02-13-2006, 10:10 PM
I have been having trouble with my form.

Here is what I have for my contact page...

<h3>Contact</h3><p>
<form action="admin/action.php" method="post">
Your e-mail:
<input type="text" name="email">
<p>Type of message:<br>
<input type="radio" name="type" value="comment"> Comment
<br>
<input type="radio" name="type" value="question"> Question
<br>
<input type="radio" name="type" value="complaint"> Complaint<p>
<textarea name="message" rows="10" cols="30">
</textarea><br>
<INPUT type="submit" value="Send"> <INPUT type="reset">

</form>


Here is what I have for admin/action.php...

<?php
$type = $_POST["type"];
$message = $_POST["message"];
$email = $_POST["email"];
mail("smrpgx@gmail.com", "$type", "$message $REMOTE_ADDR $email")
?>

Can someone tell me what I am doing wrong? I'm new at this stuff so please don't point and laugh at me.

vinyl-junkie
02-14-2006, 02:53 AM
Are you getting an error or what? Please provide a little more detail about the problem you're having.

Bio2hazard
02-14-2006, 09:27 AM
Not sure if that helps but $REMOTE_ADDR only works with register_globals on, since you however use $_POST I assume it is off :)

To get the sender's IP address, use $_SERVER['REMOTE_ADDR'] :)

I doubt it'd do much but perhaps try:


<?php
$target = "smrpgx@gmail.com";
$type = $_POST["type"];
$message = $_POST["message"]."\n\n".$_SERVER['REMOTE_ADDR']."\n\n".$_POST["email"];
mail($target, $type, $message, "From: Scriptmailer <noreply@none.com>\nX-Mailer: PHP/" . phpversion());)
?>


:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum