Jump to content

[SOLVED] problem with $_POST['Submit']


croakingtoad

Recommended Posts

I have a page that submits to itself and I'm trying to detect the submit post but it's not working.  I'm not sure what's going on here...can someone help?

 

Here's the code--

 

<?

if ($_POST['Submit']) {
$thanks = "Thank you for your inquiry.  We will be in touch.  If you have any questions in the interim, please feel free to contact us.";
}

//HTML head removed

<body>

<? echo $thanks; ?>

<form action="bedside-manner.php" name="form1">
//form contents

<input type="submit" value="Submit" name="Submit" />

</form>

</body>
</html>

 

You can view this in action here--  http://www.ourhealthswva.com/bedside-manner.php

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/57651-solved-problem-with-_postsubmit/
Share on other sites

looks like you're missing a ?> closing tag after the if.. probably just a typo for the example though.

 

Try adding post as your form method. I cannot remember really, but forms might default to GET otherwise. Good to get into this habit anyway.

 

<form action="..." method="post" >

</form>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.