Missing Something simple in Form POST

Howdy! I’m missing something very simple in this code and I can’t see it. Can someone lend a quick pair of eyes. I know it’s something basic but my coffee isn’t working this morning. Thanks in advance.

<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
<label for="add_header_text_opt">Display Header Option</label>
<input type="checkbox" name="add_header_text_opt" value="Yes" />
<p><input type="submit" name="search" value="Create Options" class="button" /></p>
if(isset($_POST["submit"])) : ?>
	<form method="post" action="">
		<?php if(isset($_POST["add_header_text_opt"]) && $_POST["add_header_text_opt"] = "Yes") : ?>
			<label for="header_text">Enter text to display in header</label><br />
			<input type="text" name="header_text" value="Enter Header Text" />

		<?php endif; ?>
	<?php else : ?>
	<p>Submit form and your New element should show here</p>
	<?php endif; ?>

    <form method="post" action="">
      <label for="header_text_option">
        Display Header?
      <input type="checkbox" id="header_text_option" name="header_text_option" />
      <?php if(array_key_exists('header_text_option', $_POST)): ?>
        <label for="header_text">
          Enter text to display in header
        <input type="text" name="header_text" value="Enter Header Text" />
      <?php endif; ?>
      <input type="submit" value="Submit" />


Bah, too slow!

$_POST[“submit”] doesn’t exist. Your button is called ‘search’ not ‘submit’.

Never mind. Glad you found it yourself :slight_smile:

Thanks guido2004. With you asking that question I looked at my form again and the submit button had the wrong name in the name element. How frustrating!
Thanks again

Sorry 'bout that. When I select the check box and submit the form the label and input do not show in the new form.

Care to tell us what the problem is?