Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Will there be any issues with creating a custom form in the index page? Will I be able to get and post requests? It's a simple email validation form and once validated, the user will be able to download a file.

Thanks

share|improve this question

1 Answer 1

In theory, this should work just fine if you are putting the code directly into a theme file, and not into a post body or something. However, it is very dependent on your site's setup. Here are some things to watch out for:

  • Permalink structure: if using GET requests to process the form, test to make sure they aren't getting overwritten or trashed by the .htaccess rules.
  • Reserved words: be careful not to use some variable names/terms that WordPress uses internally. See the Codex reference for a mostly complete list, and this forum post that gives some experiences with it. The best way to resolve it? Preface all of your form elements with a custom prefix, like my_email_validation_xxxxx where xxxxx is the field you want.
  • Processing page: you may need to be creative on where the processing occurs to handle the form. It will be easiest to send this to a standalone PHP file not associated with WordPress to do the validation, and have that redirect to a normal WordPress page to continue the process.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.