Form value field is visable in localhost but not on live site-how to hide?

Posted by Joel on Stack Overflow See other posts from Stack Overflow or by Joel
Published on 2010-05-17T22:52:28Z Indexed on 2010/05/17 23:20 UTC
Read the original article Hit count: 155

Filed under:
|
|

Hi guys, I'm almost completed moving my first live site to my new xampp setup on localhost.

I have a form that uses jquery in the header of the site.

It's a bit verbose, but here it is:

<div class="outeremailcontainer">
    <div id="emailcontainer">
  <?php include('verify.php'); ?>
      <form action="index_success.php" method="post" id="sendEmail" class="email">
        <h3 class="register2">Newsletter Signup:</h3>
        <ul class="forms email">
         <li class="name"><label for="yourName">Name: </label>
     <input type="text" name="yourName" class="info" id="yourName" value="<?= $_POST['yourName']; ?>" /><br />
    </li>

    <li class="city"><label for="yourCity">City: </label>
     <input type="text" name="yourCity" class="info" id="yourCity" value="<?= $_POST['yourCity']; ?>" /><br />
    </li>

          <li class="email"><label for="emailFrom">Email: </label>
             <input type="text" name="emailFrom" class="info" id="emailFrom" value="<?= $_POST['emailFrom']; ?>" />
             <?php if(isset($emailFromError)) echo '<span class="error">'.$emailFromError.'</span>';
             ?>
          </li>

           <li class="buttons email">
             <button type="submit" id="submit">Send</button>
             <input type="hidden" name="submitted" id="submitted" value="true" />
           </li>

        </ul>
      </form>
    <div class="clearing">
  </div>
  </div>
</div>

So I am using jQuery (I can include the function if need-be) and it hides fields, etc.

The problem is that on the localhost site, the values of the fields are populating the fields.

IE: first field has this in the box, etc

<?= $_POST['yourName']; ?>

It works great in the live site though.

Any idea how to fix this? Thanks!

© Stack Overflow or respective owner

Related posts about localhost

Related posts about forms