Create a new table on the database and save parameters from a contact form

I have a wordpress function in functions.php which gets parameters from a form I made and gets parameters like IP addresses and UTM tags (from the URL) and sends them to me by email.

I want to get all these parameters I send and store them in a new table on my WP database.

How can I do such thing?

I researched it and found a lot of plugins that can do that for me (Which I really don't want to use external plugins). and I still want to keep wordpress security and not use a "flat" code of my own.

How do I plan this? Is this even possible?

Topic mysql database Wordpress

Category Web


I suggest for you some ideas :

  1. Before run functions from you make, you register table database store ( Example WP_IP and WP_UTM )
  2. After create 2 table that, you run function of you
  3. You need read on Codex some resource on WP working with parameters :

https://codex.wordpress.org/Class_Reference/wpdb https://codex.wordpress.org/Creating_Tables_with_Plugins

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.