Jump to content

Recommended Posts

Hi,

 

I am having a problem with this simple form and I can't see why the email is not showing the name and email fields.

The email goes through fine and is recieved but just does not show the name and email field.

 

Any thoughts?

 

Thanks

<?php
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];


$mail_to = '';
$subject = 'Email List Subscription from Toycraft visitor -  '.$field_name;


$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";


$headers = 'From: '.$field_name."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";


$mail_status = mail($mail_to, $subject, $body_message, $headers);


if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for your subscription.');
window.location = 'index.php';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to studio@');
window.location = 'index.php';
</script>
<?php
}
?>

post-148463-0-71850200-1371641690_thumb.png

Sorry for the late reply. Yes that is what I thought. My form code looks ok as far as I know though:

<form action="http:///contact.php" method="post"> <div align="left"> <p><span class="style3">Your name</span>:<span style="text-align: right"></span><br> <input name="cf_name" type="text" style="width:160px" value="" size="25"> <br> <span class="style3">Your e-mail</span>:<br> <input name="cf_email" type="text" style="width:160px" size="25"> </p> <p><br><input name="submit" type="submit" value="Send"> <span style="text-align: right"></span></p> </div> </form>

The contact.php is in the correct place as well otherwise I wouldn't get the emails coming through just no values which is very annoying.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.