NameSilo

Mail Form Help

SpaceshipSpaceship
Watch
Impact
29
OK, stuck with mail forms again. This time, it should work. I debugged the code and no syntax errors were found. Here's the code:

PHP:
<?php

$to="[email protected]";
$subj="E-Mail From: ".$_POST['name']." \r \n at: ".$_POST['email'];
$msg="Name: ".$_POST['name']." \r \n E-Mail Address: ".$_POST['email']." \r \n Type of Query: ".$_POST['toq']." \r \n Message: ".$_POST['message'];
$header="From ".$_POST['name'];

if (mail($to, $subj, $msg, $header))
{
 header ("Location: quickcontact_thanks.htm");
} else {
  header ("Location: quickcontact_notsent.htm");
}

?>

But here's the error message that I get:

Notice: Undefined index: name in D:\Domains\wensleydale-galleries.co.uk\wwwroot\quickcontact.php on line 4

Notice: Undefined index: email in D:\Domains\wensleydale-galleries.co.uk\wwwroot\quickcontact.php on line 4

Notice: Undefined index: name in D:\Domains\wensleydale-galleries.co.uk\wwwroot\quickcontact.php on line 5

Notice: Undefined index: email in D:\Domains\wensleydale-galleries.co.uk\wwwroot\quickcontact.php on line 5

Notice: Undefined index: toq in D:\Domains\wensleydale-galleries.co.uk\wwwroot\quickcontact.php on line 5

Notice: Undefined index: message in D:\Domains\wensleydale-galleries.co.uk\wwwroot\quickcontact.php on line 5

Notice: Undefined index: name in D:\Domains\wensleydale-galleries.co.uk\wwwroot\quickcontact.php on line 6

Warning: Cannot modify header information - headers already sent by (output started at D:\Domains\wensleydale-galleries.co.uk\wwwroot\quickcontact.php:4) in D:\Domains\wensleydale-galleries.co.uk\wwwroot\quickcontact.php on line 10

Try it for yourself, go to www.wensleydale-galleries.co.uk. It's the Quick Contact, right hand side, near the bottom.

Thanks in advance for any help I may/will receive, will7.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains โ€” AI StorefrontUnstoppable Domains โ€” AI Storefront
1) Try writing a script that checks to see if the $_POST superglobal is actually being populated.

<?
print_r($_POST);
?>

2) If is isn't, try checking the $_REQUEST superglobal.

<?
print_r($_REQUEST);
?>

Odds are, the $_REQUEST superglobal will have them if the $_POST superglobal don't.
 
0
•••
$_POST works only if you used <FORM METHOD=post>. Did you use it?
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
CatchedCatched
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back