The web form with no name :-(

Web form shenanigans part deux…

This web form http://www.pauserefreshment.co.uk/coffee-machine-brochure-request.html has got a problem with the first name text box illustrated below:

The problem being it just does not record the first name field with the effect that the eMail recipient gets the first name filed missing despite the user entering it :frowning:

eg:

Name:
Surname: Honan
eMail: david.honan@
Address: Unit 3
Address line 2: 128 Thornes Lane
Post code: WF2 7RE
City / Town: Wakefield
La Spaziale: on
Koro:
Franke:
Vision 400: on
Darenth:
Mondo:
Marco qwickbrew: on
La Cimbali:

I just cant see why. Heres the offending code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="ROBOTS" CONTENT="NOINDEX,NOFOLLOW" />
<meta  name="Description" CONTENT="Request postal delivery of a coffee machine brochure for your office, hotel or pub" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Coffee machine brochure request form | pause... refreshment</title>
<link rel="stylesheet" type="text/css" href="css/brochure_form.css">
</head>
<body>
<form action="brochure.php" method="post">
  <h1>"Order a  brochure"</h1>
<fieldset>
    <div id="contact_details">
  <h2>Please enter your contact details</h2>
      <label for="name">First Name</label>
    <input type="text" name="name" id="name"/>
  </div>
  <div id="contact_details" >
    <label for="secondname">Second Name</label>
    <input type="text" name="secondname" id="secondname" />
  </div>
  <div id="contact_details">
    <label for="email">e Mail</label>
    <input type="text" name="email" id="email" />
  </div>
  <div id="contact_details">
    <label for="company">Company name</label>
    <input type="text" name="company" id="company"/>
  </div>
   <div id="contact_details">
    <label for="address">Address Line 1</label>
    <input type="text" name="address" id="address"/>
  </div>
  <div id="contact_details">
    <label for="address2">Address Line 2</label>
    <input type="text" name="address2" id="address2"/>
  </div>
  <div id="contact_details">
    <label for="city">City / Town</label>
    <input type="text" name="city" id="city"/>
  </div>
  <div id="contact_details">
    <label for="postcode">Postcode</label>
    <input type="text" name="postcode" id="postcode"/>
  </div>
    <div id="brochure_pick">
    <h2>Select the brochure(s) you want posted</h2>
    <h3>Traditional & bean to cup<br/>
      "Ideal for restaurants and cafes"</h3>
    <label for="laspaziale">La Spaziale</label>
    <input type="checkbox" name="laspaziale" id="laspaziale"  />
    <label for="lacimbali">La Cimabli M1</label>
    <input type="checkbox" name="lacimbali" id="lacimbali"  />
     <label for="Koro">Koro</label>
    <input type="checkbox" name="koro" id="koro" />
    <label for="franke">Franke Flair</label>
    <input type="checkbox" name="franke" id="franke" />
    <h3>Instant<br/>
    "Ideal for offices"</h3>
  <div id="brochure_pick">
    <label for="vision400">Vision 400</label>
    <input type="checkbox" name="vision400" id="vision400" />
    <label for="darenth">Darenth</label>
    <input type="checkbox" name="darenth" id="darenth" />
  </div>
  <h3>Filter<br/>
    "Ideal for most set ups"</h3>
  <label for="mondo">Mondo</label>
  <input type="checkbox" name="mondo" id="mondo" />
  <label for="marco">Marco qwikbrew</label>
  <input type="checkbox" name="marco" id="marco" />
  </div>
    <div id="send">
    <input type="submit" value="Order Brochure">
  </div>
  </fieldset>
</form>
</body>
</html>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Customer coffee machine brochure request</title>
</head>
<body> 
<h2>Your brochure request has been received and will be delivered shortly!</h2>
<?php
header('Location: http://www.pauserefreshment.co.uk');
ini_set("sendmail_from", "user@yourdomain.com"); 

if (empty($_SERVER['HTTP_REFERER']) || (
	(!strstr($_SERVER['HTTP_REFERER'], "http://dev.spookmedia.com/")) &&
	(!strstr($_SERVER['HTTP_REFERER'], "http://pause.zippy.sdev.net/")) &&
	(!strstr($_SERVER['HTTP_REFERER'], "http://www.pause.co.uk/"))&&
	(!strstr($_SERVER['HTTP_REFERER'], "http://www.pauserefreshment.co.uk/"))&&
	(!strstr($_SERVER['HTTP_REFERER'], "http://www.refreshments.co.uk/"))
   ))

  $name = $_POST['name'];
  $surname = $_POST['secondname'];
  $email = $_POST['email'];
  $company = $_POST['company'];
  $address = $_POST['address'];
  $address2 = $_POST['address2'];
  $city = $_POST['city'];
  $post_code = $_POST['postcode'];
  $spaz = $_POST ['laspaziale'];
  $lacimbali = $_POST ['lacimbali'];
  $koro = $_POST ['koro'];
  $vision400 = $_POST ['vision400'];
  $franke = $_POST ['franke'];
  $darenth = $_POST ['darenth'];
  $mondo = $_POST ['mondo'];
  $marco = $_POST ['marco'];
  $to = 'hello@pause.co.uk';
  $subject = 'Coffee machine brochure request';
  $msg = "Name: $name\
" .
    "Surname: $surname\
" .
    "eMail: $email\
" .
    "Address: $address\
" .
    "Address line 2: $address2\
" .
	"Post code: $post_code\
" . 
    "City / Town: $city\
" .
    "La Spaziale: $spaz\
" .
	"Koro: $koro\
" .
	"Franke: $franke\
" .
	"Vision 400: $vision400\
" .
	"Darenth: $darenth\
" .
	"Mondo: $mondo\
" .
	"Marco qwickbrew: $marco\
" .
	"La Cimbali: $lacimbali\
";
  mail($to, $subject, $msg, 'From:' . $email);
    ?>
</body>
</html>

Any insights welcome :slight_smile:

Thats it folks - problem fiexed :slight_smile:

Immerse thank you so much you fixed it :slight_smile: I was flying blind on this one never done a php form before and I’m going to go into a bit of training to get to grips with the basics. So Ive no idea why what you did worked but hope to soon :slight_smile:

Regarding your question - what would i like it to do once the form is filled…
I want it to direct to a thank you confirmation page but beacause I’ve ran out of time directing it to the home page will do at the mo.

I’m going to take a closer look at your Javascript idea and I pray the Rambo in me doesnt have to come out again but no promises :wink:

I went deep cover into www.phpbuilder.com and extracted the following intelligence. I aint got a clue what it means (But I have bought a php book so I dont go through this pain again) maybe somebody out in sitepoint land can…

Cant upload the latest solution until monday. Wait I here police sirens… need to go…

What your code really means (this is identical to yours, just more obvious to see what happens here)
PHP Code:
if (empty($_SERVER[‘HTTP_REFERER’]) || (
(!strstr($_SERVER[‘HTTP_REFERER’], “http://dev.spookmedia.com/”)) &&
(!strstr($_SERVER[‘HTTP_REFERER’], “http://pause.zippy.sdev.net/”)) &&
(!strstr($_SERVER[‘HTTP_REFERER’], “http://www.pause.co.uk/”))&&
(!strstr($_SERVER[‘HTTP_REFERER’], “http://www.pauserefreshment.co.uk/”))&&
(!strstr($_SERVER[‘HTTP_REFERER’], “http://www.refreshments.co.uk/”))
)) {
$first = $_POST[‘first’];
}

$surname = $_POST[‘secondname’];

and the rest of the script…

Originally Posted by Pingbat
So if I put the above in / make amends it will work?

No - you already have that. Your lack of {} braces means that the if() statement only applies to the first statement (e.g. the $first variable declaration) which is what johanafm tried to illustrate.

Taking out the referer stuff. Try this instead:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Customer coffee machine brochure request</title>
</head>
<body> 
<h2>Your brochure request has been received and will be delivered shortly!</h2>
<?php

ini_set("sendmail_from", "user@yourdomain.com");

  $first = $_POST['first'];
  $surname = $_POST['secondname'];
  $email = $_POST['email'];
  $company = $_POST['company'];
  $address = $_POST['address'];
  $address2 = $_POST['address2'];
  $city = $_POST['city'];
  $post_code = $_POST['postcode'];
  $spaz = $_POST ['laspaziale'];
  $lacimbali = $_POST ['lacimbali'];
  $koro = $_POST ['koro'];
  $vision400 = $_POST ['vision400'];
  $franke = $_POST ['franke'];
  $darenth = $_POST ['darenth'];
  $mondo = $_POST ['mondo'];
  $marco = $_POST ['marco'];
  $to = 'hello@pause.co.uk';
  $subject = 'Coffee machine brochure request';
  $msg = "First: $first\
" .
    "Surname: $surname\
" .
    "eMail: $email\
" .
    "Address: $address\
" .
    "Address line 2: $address2\
" .
	"Post code: $post_code\
" . 
    "City / Town: $city\
" .
    "La Spaziale: $spaz\
" .
	"Koro: $koro\
" .
	"Franke: $franke\
" .
	"Vision 400: $vision400\
" .
	"Darenth: $darenth\
" .
	"Mondo: $mondo\
" .
	"Marco qwickbrew: $marco\
" .
	"La Cimbali: $lacimbali\
";
  mail($to, $subject, $msg, 'From:' . $email);
  
  header('Location: http://www.pauserefreshment.co.uk');
    ?>
</body>
</html>

Before I post the code - check out what I did to the head of the IT call centre…

OK here is the code as is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Customer coffee machine brochure request</title>
</head>
<body> 
<h2>Your brochure request has been received and will be delivered shortly!</h2>
<?php

ini_set("sendmail_from", "user@yourdomain.com"); 

if (empty($_SERVER['HTTP_REFERER']) || (
	(!strstr($_SERVER['HTTP_REFERER'], "http://dev.spookmedia.com/")) &&
	(!strstr($_SERVER['HTTP_REFERER'], "http://pause.zippy.sdev.net/")) &&
	(!strstr($_SERVER['HTTP_REFERER'], "http://www.pause.co.uk/"))&&
	(!strstr($_SERVER['HTTP_REFERER'], "http://www.pauserefreshment.co.uk/"))&&
	(!strstr($_SERVER['HTTP_REFERER'], "http://www.refreshments.co.uk/"))
   ))

  $first = $_POST['first'];
  $surname = $_POST['secondname'];
  $email = $_POST['email'];
  $company = $_POST['company'];
  $address = $_POST['address'];
  $address2 = $_POST['address2'];
  $city = $_POST['city'];
  $post_code = $_POST['postcode'];
  $spaz = $_POST ['laspaziale'];
  $lacimbali = $_POST ['lacimbali'];
  $koro = $_POST ['koro'];
  $vision400 = $_POST ['vision400'];
  $franke = $_POST ['franke'];
  $darenth = $_POST ['darenth'];
  $mondo = $_POST ['mondo'];
  $marco = $_POST ['marco'];
  $to = 'hello@pause.co.uk';
  $subject = 'Coffee machine brochure request';
  $msg = "First: $first\
" .
    "Surname: $surname\
" .
    "eMail: $email\
" .
    "Address: $address\
" .
    "Address line 2: $address2\
" .
	"Post code: $post_code\
" . 
    "City / Town: $city\
" .
    "La Spaziale: $spaz\
" .
	"Koro: $koro\
" .
	"Franke: $franke\
" .
	"Vision 400: $vision400\
" .
	"Darenth: $darenth\
" .
	"Mondo: $mondo\
" .
	"Marco qwickbrew: $marco\
" .
	"La Cimbali: $lacimbali\
";
  mail($to, $subject, $msg, 'From:' . $email);
  
  header('Location: http://www.pauserefreshment.co.uk');
    ?>
</body>
</html>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="ROBOTS" CONTENT="NOINDEX,NOFOLLOW" />
<meta  name="Description" CONTENT="Request postal delivery of a coffee machine brochure for your office, hotel or pub" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Coffee machine brochure request form | pause... refreshment</title>
<link rel="stylesheet" type="text/css" href="css/brochure_form.css">
</head>
<body>
<form action="brochure.php" method="post">
  <h1>"Order a  brochure"</h1>
<fieldset>
    <div id="contact_details">
  <h2>Please enter your contact details</h2>
      <label for="first">First Name</label>
    <input type="text" name="first" id="first" />
  </div>
  <div id="contact_details" >
    <label for="secondname">Second Name</label>
    <input type="text" name="secondname" id="secondname" />
  </div>
  <div id="contact_details">
    <label for="email">e Mail</label>
    <input type="text" name="email" id="email" />
  </div>
  <div id="contact_details">
    <label for="company">Company name</label>
    <input type="text" name="company" id="company"/>
  </div>
   <div id="contact_details">
    <label for="address">Address Line 1</label>
    <input type="text" name="address" id="address"/>
  </div>
  <div id="contact_details">
    <label for="address2">Address Line 2</label>
    <input type="text" name="address2" id="address2"/>
  </div>
  <div id="contact_details">
    <label for="city">City / Town</label>
    <input type="text" name="city" id="city"/>
  </div>
  <div id="contact_details">
    <label for="postcode">Postcode</label>
    <input type="text" name="postcode" id="postcode"/>
  </div>
    <div id="brochure_pick">
    <h2>Select the brochure(s) you want posted</h2>
    <h3>Traditional & bean to cup<br/>
      "Ideal for restaurants and cafes"</h3>
    <label for="laspaziale">La Spaziale</label>
    <input type="checkbox" name="laspaziale" id="laspaziale"  />
    <label for="lacimbali">La Cimabli M1</label>
    <input type="checkbox" name="lacimbali" id="lacimbali"  />
     <label for="Koro">Koro</label>
    <input type="checkbox" name="koro" id="koro" />
    <label for="franke">Franke Flair</label>
    <input type="checkbox" name="franke" id="franke" />
    <h3>Instant<br/>
    "Ideal for offices"</h3>
  <div id="brochure_pick">
    <label for="vision400">Vision 400</label>
    <input type="checkbox" name="vision400" id="vision400" />
    <label for="darenth">Darenth</label>
    <input type="checkbox" name="darenth" id="darenth" />
  </div>
  <h3>Filter<br/>
    "Ideal for most set ups"</h3>
  <label for="mondo">Mondo</label>
  <input type="checkbox" name="mondo" id="mondo" />
  <label for="marco">Marco qwikbrew</label>
  <input type="checkbox" name="marco" id="marco" />
  </div>
    <div id="send">
    <input type="submit" value="Order Brochure">
  </div>
  </fieldset>
</form>
</body>
</html>

Good Luck :slight_smile:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Customer coffee machine brochure request</title>
</head>
<body> 
<h2>Your brochure request has been received and will be delivered shortly!</h2>
<?php

    ini_set("sendmail_from", "user@yourdomain.com"); 

    $first = $_POST['first'];
    $surname = $_POST['secondname'];
    $email = $_POST['email'];
    $company = $_POST['company'];
    $address = $_POST['address'];
    $address2 = $_POST['address2'];
    $city = $_POST['city'];
    $post_code = $_POST['postcode'];
    $spaz = $_POST ['laspaziale'];
    $lacimbali = $_POST ['lacimbali'];
    $koro = $_POST ['koro'];
    $vision400 = $_POST ['vision400'];
    $franke = $_POST ['franke'];
    $darenth = $_POST ['darenth'];
    $mondo = $_POST ['mondo'];
    $marco = $_POST ['marco'];
    
    $to = 'hello@pause.co.uk';
    
    $subject = 'Coffee machine brochure request';
    
    $msg = "First: $first\
" .
        "Surname: $surname\
" .
        "eMail: $email\
" .
        "Address: $address\
" .
        "Address line 2: $address2\
" .
        "Post code: $post_code\
" . 
        "City / Town: $city\
" .
        "La Spaziale: $spaz\
" .
        "Koro: $koro\
" .
        "Franke: $franke\
" .
        "Vision 400: $vision400\
" .
        "Darenth: $darenth\
" .
        "Mondo: $mondo\
" .
        "Marco qwickbrew: $marco\
" .
        "La Cimbali: $lacimbali\
";
        
    mail($to, $subject, $msg, 'From:' . $email);
      
    //header('Location: http://www.pauserefreshment.co.uk');
?>
</body>
</html>

OK, I haven’t changed much, but try this version.
The reason I’ve commented out the header command at the bottom of the PHP bit is because you cannot send headers there.

What should happen when the user has submitted the form? Should it display the ‘thank you’ message or should it redirect to the home page? It can’t do both at the same time. What you might do is to add a meta refresh HTML header, or some javascript to send people to the home page after a couple of seconds, but PHP can only output HTML or send a header, but not both in this case.

And are you sure that’s not what your IT guy did to you after you dropped the bomb? :slight_smile:

Edit>>
lol, Jaanboy beat me to it. I think we posted pretty much the same :slight_smile:

As you can see from the above picture Ive just visited my IT dept and left them with a ticking gift.

However whilst on the run I still will log onto sitepoint and see if any solution worked.

i knocked out the header stuff and the whole lot crashed. Regarding the other idea I’ll give that ago once I can find somewhere safe to hide from the authorities :eek:

Ah, I see what’s going wrong!

Can you remove (temporarily) this bit:


if (empty($_SERVER['HTTP_REFERER']) || (
	(!strstr($_SERVER['HTTP_REFERER'], "http://dev.spookmedia.com/")) &&
	(!strstr($_SERVER['HTTP_REFERER'], "http://pause.zippy.sdev.net/")) &&
	(!strstr($_SERVER['HTTP_REFERER'], "http://www.pause.co.uk/"))&&
	(!strstr($_SERVER['HTTP_REFERER'], "http://www.pauserefreshment.co.uk/"))&&
	(!strstr($_SERVER['HTTP_REFERER'], "http://www.refreshments.co.uk/"))
   ))

Because that if-statement evaluates to false, the first line of code after it is ignored. Hence, $first isn’t being set.

:slight_smile:

EDIT>>
What are you actually trying to do with the referrer stuff?
HTTP_REFERER can be easily spoofed/ removed or altered, so it has a usefullness value of aprroximately -3000%.

EDIT 2>>
I must say, I love the pictures you use to illustrate your frustration :wink:

I know older browsers puked on no-space-before-closing-slash, but not newer ones… yet HTML-wise that’s the only difference I see between first input the the rest.

As a freaky gamble test, does First start working if you put some other question in front if it (just for testing… make a field called “FRY PULLING HAIR!” : )

[ot]Your h2 should be a legend… your h1 should be above the form, not in it

Falling down is one of my fave movies and this form failing to work may be the trigger i pull to write part two beginning with a guy who flips by tacking 4 days just to get a web form to work

Are you gonna track down former wife and freak her out with ice cream?? : ) [/ot]

Falling down is one of my fave movies and this form failing to work may be the trigger i pull to write part two beginning with a guy who flips by tacking 4 days just to get a web form to work :mad:

Ok here is the situation now…

It still does not capture data entered in the first name box. Ive taken on board the name advice and changed the code bit for that potential prob but its still jinxed.

This is the form:
http://www.pauserefreshment.co.uk/coffee-machine-brochure-request.html

Every other filed pulls the data thru but not the first name box. Why? I just cant figure it out… sweet damnation :mad::mad::mad:

This is the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="ROBOTS" CONTENT="NOINDEX,NOFOLLOW" />
<meta  name="Description" CONTENT="Request postal delivery of a coffee machine brochure for your office, hotel or pub" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Coffee machine brochure request form | pause... refreshment</title>
<link rel="stylesheet" type="text/css" href="css/brochure_form.css">
</head>
<body>
<form action="brochure.php" method="post">
  <h1>"Order a  brochure"</h1>
<fieldset>
    <div id="contact_details">
  <h2>Please enter your contact details</h2>
      <label for="first">First Name</label>
    <input type="text" name="first" id="first"/>
  </div>
  <div id="contact_details" >
    <label for="secondname">Second Name</label>
    <input type="text" name="secondname" id="secondname" />
  </div>
  <div id="contact_details">
    <label for="email">e Mail</label>
    <input type="text" name="email" id="email" />
  </div>
  <div id="contact_details">
    <label for="company">Company name</label>
    <input type="text" name="company" id="company"/>
  </div>
   <div id="contact_details">
    <label for="address">Address Line 1</label>
    <input type="text" name="address" id="address"/>
  </div>
  <div id="contact_details">
    <label for="address2">Address Line 2</label>
    <input type="text" name="address2" id="address2"/>
  </div>
  <div id="contact_details">
    <label for="city">City / Town</label>
    <input type="text" name="city" id="city"/>
  </div>
  <div id="contact_details">
    <label for="postcode">Postcode</label>
    <input type="text" name="postcode" id="postcode"/>
  </div>
    <div id="brochure_pick">
    <h2>Select the brochure(s) you want posted</h2>
    <h3>Traditional & bean to cup<br/>
      "Ideal for restaurants and cafes"</h3>
    <label for="laspaziale">La Spaziale</label>
    <input type="checkbox" name="laspaziale" id="laspaziale"  />
    <label for="lacimbali">La Cimabli M1</label>
    <input type="checkbox" name="lacimbali" id="lacimbali"  />
     <label for="Koro">Koro</label>
    <input type="checkbox" name="koro" id="koro" />
    <label for="franke">Franke Flair</label>
    <input type="checkbox" name="franke" id="franke" />
    <h3>Instant<br/>
    "Ideal for offices"</h3>
  <div id="brochure_pick">
    <label for="vision400">Vision 400</label>
    <input type="checkbox" name="vision400" id="vision400" />
    <label for="darenth">Darenth</label>
    <input type="checkbox" name="darenth" id="darenth" />
  </div>
  <h3>Filter<br/>
    "Ideal for most set ups"</h3>
  <label for="mondo">Mondo</label>
  <input type="checkbox" name="mondo" id="mondo" />
  <label for="marco">Marco qwikbrew</label>
  <input type="checkbox" name="marco" id="marco" />
  </div>
    <div id="send">
    <input type="submit" value="Order Brochure">
  </div>
  </fieldset>
</form>
</body>
</html>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Customer coffee machine brochure request</title>
</head>
<body> 
<h2>Your brochure request has been received and will be delivered shortly!</h2>
<?php

ini_set("sendmail_from", "user@yourdomain.com"); 

if (empty($_SERVER['HTTP_REFERER']) || (
	(!strstr($_SERVER['HTTP_REFERER'], "http://dev.spookmedia.com/")) &&
	(!strstr($_SERVER['HTTP_REFERER'], "http://pause.zippy.sdev.net/")) &&
	(!strstr($_SERVER['HTTP_REFERER'], "http://www.pause.co.uk/"))&&
	(!strstr($_SERVER['HTTP_REFERER'], "http://www.pauserefreshment.co.uk/"))&&
	(!strstr($_SERVER['HTTP_REFERER'], "http://www.refreshments.co.uk/"))
   ))

  $first = $_POST['first'];
  $surname = $_POST['secondname'];
  $email = $_POST['email'];
  $company = $_POST['company'];
  $address = $_POST['address'];
  $address2 = $_POST['address2'];
  $city = $_POST['city'];
  $post_code = $_POST['postcode'];
  $spaz = $_POST ['laspaziale'];
  $lacimbali = $_POST ['lacimbali'];
  $koro = $_POST ['koro'];
  $vision400 = $_POST ['vision400'];
  $franke = $_POST ['franke'];
  $darenth = $_POST ['darenth'];
  $mondo = $_POST ['mondo'];
  $marco = $_POST ['marco'];
  $to = 'hello@pause.co.uk';
  $subject = 'Coffee machine brochure request';
  $msg = "First: $first\
" .
    "Surname: $surname\
" .
    "eMail: $email\
" .
    "Address: $address\
" .
    "Address line 2: $address2\
" .
	"Post code: $post_code\
" . 
    "City / Town: $city\
" .
    "La Spaziale: $spaz\
" .
	"Koro: $koro\
" .
	"Franke: $franke\
" .
	"Vision 400: $vision400\
" .
	"Darenth: $darenth\
" .
	"Mondo: $mondo\
" .
	"Marco qwickbrew: $marco\
" .
	"La Cimbali: $lacimbali\
";
  mail($to, $subject, $msg, 'From:' . $email);
  
  header('Location: http://www.pauserefreshment.co.uk');
    ?>
</body>
</html>

LOL!

Can you repost the code you have now? Perhaps we can defuse it :wink:

What browser are you using? I know that old version of IE didn’t like name=“name”

You can also try this to see what data is being submitted:


var_dump($_POST);

That will display all the data contained in $_POST.

Something else: in your PHP processor, the first bit of PHP is a redirect header. You should remove that, as you’ve already sent output (the HTML bits before the PHP bit) and the header function can only work if there no output has been sent to the browser.

Generally, you’d also send the header after processing the form, not before :wink: