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: [email protected]';

  $recipient = '[email protected]';

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

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

  mail($recipient, $name, $email, $headers, '[email protected]');

?>

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

 

Any ideas?  Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/60781-solved-help-with-a-form/
Share on other sites

maybe you can try:

 

<?php
   $headers = 'From: [email protected]';
   $recipient = '[email protected]';
   $name = $_POST['required-Name'];
   $email = stripslashes($_POST['required-e-mail']);
   mail($recipient, $name, $email, $headers, '[email protected]');
   header("location: test.html");
?>

and drop the html at the end.

 

im assuming this isn't test.html?

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: [email protected]");

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

?>

regards

Mark

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.