PHP not working correctly in WordPress

I have made a plain PHP widget to be displayed on a WordPress sidebar. I have successfully made the widget post the data I am hoping to have filled in on the consecutive page. However where it is supposed to be will not fill in, instead it fills in with "<?php echo $_GET[" then after the text box " />". I am hoping that the email first submitted will fill in on the form on the next page. The code that I have for the registration form is part of a greater widget and looks like the following:

<p class="form-email'.$errorVar.'">
      <label for="email">'. __('E-mail', 'profilebuilder') .$errorMark.'</label>
      <input class="text-input" name="email" type="text" id="email" value="<?php echo $_GET["email"]; ?>" /> 
</p><!-- .form-email -->';

Here is a link to the page: http://universityoutfitters.com/testphp/ — the widget is on the bottom left hand side panel.

Read More

Additional information:
The code for the widget is as follows:

<form action="http://universityoutfitters.com/sign-up/" method="post">
    Please submit your email address
    Email: <input type="text" name="email" />
<input type="submit" />
</form> 

Related posts

Leave a Reply

2 comments

  1. As the comments told above, you have to wrap it correctly with PHP tags

    <?php
    echo '<p class="form-email'.$errorVar.'">
          <label for="email">'. __('E-mail', 'profilebuilder') .$errorMark.'</label>
          <input class="text-input" name="email" type="text" id="email" value="'.$_GET["email"].'" /> 
    </p><!-- .form-email -->';
    ?>