Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

Mail Form Help

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch

will7

VIP Member
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.
GoDaddyGoDaddy
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
•••
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

Watched threads: your alert now keeps up with new replies
When you watch a thread, each new reply now updates your alert. Before, you got one alert and then nothing until you read the thread...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back