Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Track form submission

I want to make a function that counts each time a form is being submitted.

I want to make a control panel where I can have many domains together and see how many form submit is for each. Do I need database access to get this information?

6 Answers

Chris Malcolm
Chris Malcolm
2,909 Points

if you truly only want to incrementing a counter, you could just save as a text file. Personally I think database would be overkill for this.

Yes it would be an option, but I will do it in more than 1,000 domain at once.

Chris Malcolm
Chris Malcolm
2,909 Points

1000 http requests for each single text file might be annoying. maybe consider a BaaS solution. For a database, you would have to make it publicly accessible, unless they are all on same hosting.

Parse or something to store a simple backend.

Is it possible to insert data from domain-a.com to the MySQL database on domain-b.com?

Chris Malcolm
Chris Malcolm
2,909 Points

It's possible but you have to check if your domain-b hosting provider allows for it. Alternatively, if you're not allowe you can write a little api to handle setting/getting values from the database..but this would mean you would need to deploy your api to each unique host every time you make a change. thats why i recommended a simpler solution like letting parse handle this stuff.

Okay Thank you Chris. I will try and look in to that.