Jump to content

[SOLVED] Help with a form


rodn29

Recommended Posts

Hi,

 

I am having trouble with a form. I would like someone to enter their name and email (that info is then sent to my e-mail address). Also, after entering their information the user should be taken to a new page (test.html). My ISP wrote a quick PHP script but when run it generates hundreds of blank e-mails and the page does not forward to test.html. This is the script:

<?php

  $headers = 'From: webmaster@mg-interactive.com';

  $recipient = 'rodn29@gmail.com';

  $name = $_POST['required-Name'];

  $email = stripslashes($_POST['required-e-mail']);

  mail($recipient, $name, $email, $headers, '-fwebmaster@mg-interactive.com');

?>

<h1> <meta http-equiv="Refresh" content="1; http://www.mg-interactive.com/test.html"> </h1>

 

Any ideas?  Thanks in advance

Link to comment
Share on other sites

maybe you can try:

 

<?php
   $headers = 'From: webmaster@mg-interactive.com';
   $recipient = 'rodn29@gmail.com';
   $name = $_POST['required-Name'];
   $email = stripslashes($_POST['required-e-mail']);
   mail($recipient, $name, $email, $headers, '-fwebmaster@mg-interactive.com');
   header("location: test.html");
?>

and drop the html at the end.

 

im assuming this isn't test.html?

Link to comment
Share on other sites

here you go

 

<?

$to = "";//your email add

$sub = "Message from you website";

$msg = "The users name ".$_POST['required-Name']." <br />The users email ".$_POST['required-e-mail']."";

 

mail($to, $subject, $msg,"Content-Type: text/html\r\nFrom: webform@yourdomain.com");

header("Location: ENTER HERE");//REPLACE ENTER HERE WITH THE PAGE YOU WANT THE USER TO BE REDIRECTED TO

?>

regards

Mark

Link to comment
Share on other sites

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.