Make a form with a secret code field?

I am attempting to make a form with just 3 fields. The first 2 fields are of course quite simple, Name, and Email, but the third one is a code field. A secret code that I would generate would be necessary for the form to be validated, and send the user to the page they want to see or whatever other action I impose. Since this is going to be run on a wordpress site, I will be using this form on multiple pages, all requiring a different code to validate, the code of which the private user(s) will be provided with. I was told that all I needed to do was create a MySql table with the list of codes, the php form, and the validation code necessary for the specific page the user is on, so that the user may not just enter any code from another one of my pages and get the form action. The form would of course be called to wordpress pages/post with a shortcode like [cform p:001] the p:# indicating the respective name/number of the code I created to pull of the mysql table.

The biggest problem I have is that I have is lack of understanding towards these two languages (PHP & MySql). Could anyone offer any sort of help or where I should get started? Thank you so much!

We need way more info. Do you have a localhost that supports PHP? Have you downloaded MySQL? Have you built any tables yet? Do you need to save the data from this form? What do you need to be able to do with this data in other parts of the website? Is this all the data you plan on collecting in the entire site? Have you ever written anything in PHP? These are just a few questions that I can think of in a matter of one minute.

Thanks!

I have xampp installed, so that rules out all the first questions. I however am not sure what tables I need to build, and the only ones I have so far are from my wordpress installation. I do in fact need to save the data from this form in the (no pun intended) form of an email delivered to me. The data will only be sent to me, and thus I won’t need to put it into use in other parts of the website. The site’s purpose is to collect such data from the user, so you could say that. And I have not in fact done much php besides basic wordpress theme building and copy/paste related actions.

Sorry if I wasn’t clear. Thank you very much!

Sponsor our Newsletter | Privacy Policy | Terms of Service