title: How to combine php send mail forms with a list of image click?
body: <p>I'm creating 4 button on a webpage for a building entrance. I'm using 'awesome menu' as the page layout like the demo <a href="http://line25.com/wp-content/uploads/2009/css-menu/demo/demo.html" rel="nofollow">http://line25.com/wp-content/uploads/2009/css-menu/demo/demo.html</a> </p>
  
  <p>So each menu button is clicked, an email is sent to an appropriate department automatically.  Eg Ninja button is clicked, an email is sent to ninja@example.com </p>
  
  <p>I've got my php form I'm thinking of using to send emails, my question is that how can combine my php form with this menu list code? I'm a bit lost so any help is appreciated.</p>
  
  <p>Here is my code for the page layout, an image is attached to each button using css like the <a href="http://line25.com/wp-content/uploads/2009/css-menu/demo/demo.html" rel="nofollow">awesome menu</a> demo download code.</p>
  
  <pre><code>&lt;body&gt;
  &lt;ul id="awesome-menu"&gt;
  &lt;li&gt;&lt;a href="#ninja" class="ninja"&gt;Ninja&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#zombie" class="zombie"&gt;Zombie&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>And here is the php form code I'm thinking of using to send emails </p>
  
  <pre><code>&lt;form action="" method="post"&gt;  //for first list
  &lt;input type="submit" value="Send details" /&gt;
  &lt;input type="hidden" name="button_a" value="1" /&gt;
  &lt;/form&gt;
  
  &lt;?php
  if(isset($_POST['button_a']))
  {
  $to      = 'ninja@example.com';
  $subject = 'You have a visitor';
  $message = 'hello I am here to see ninja';
  $headers = 'From: webmaster@site.com' . "\r\n" .
      'Reply-To: webmaster@site.com' . "\r\n" .
      'X-Mailer: PHP/' . phpversion();
  
  mail($to, $subject, $message, $headers);
  echo 'Email Sent A.';
  }
  ?&gt;
  
  
  //for second list 
  &lt;form action="" method="post"&gt;
  &lt;input type="submit" value="Send details to b" /&gt;
  &lt;input type="hidden" name="button_b" value="1" /&gt;
  &lt;/form&gt;
  
  &lt;?php
  if(isset($_POST['button_b']))
  {
  $to      = 'zombie@example.com';
  $subject = 'You have a visitor';
  $message = 'hello I am here to see zombie';
  $headers = 'From: webmaster@site.com' . "\r\n" .
      'Reply-To: webmaster@site.com' . "\r\n" .
      'X-Mailer: PHP/' . phpversion();
  
  mail($to, $subject, $message, $headers);
  echo 'Email Sent.';
  }
  ?&gt;
  </code></pre>