0

I can't understand why this simple mailing php function I wrote doesn't work. It's installed inside a Wordpress page (that's why I used REQUEST_URI and not PHP_SELF). I'm just a php beginner, have I forgot something?

<?php
echo '<form method="post" action="';
echo $_SERVER['REQUEST_URI'];
echo '"><input type="image" name="blabla" src="/image-path/image.png"></form>';
    if ($_POST['blabla'])
    { 
        $to = 'email@emailadress.com';
    $subject = 'Test mail';
    $message = 'Test.';
    mail($to,$subject,$message);
    echo "Email sent.";
    }
?>
She Hulk
  • 39
  • 11
  • Similar problem to this Question http://stackoverflow.com/questions/7935456/input-type-image-submit-form-value – Cups Jan 25 '13 at 08:58

1 Answers1

0

try if(isset($_POST['blabla_x']) or isset($_POST['blabla']))

because, when you POST image, some browsers sends point where you pressed.

Andrej Bestuzhev
  • 674
  • 6
  • 10