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
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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.