Database and HTML/PHP?

Thor

Honorary Master
Joined
Jun 5, 2014
Messages
44,413
Reaction score
7,522
Location
Bellville
Hello, may I ask a big favor?

Will someone please post the code to do the following I just want to see how most would do it and then compare it with mine and learn in the process.

Scenario I have a form I want to capture the data mail the data to both myself and the human that entered the data, then I want to be able to go to domain.com/backend and then be able to pull reports from the database with the captured data. Preferably in a date range so say 10 August 2015 till 5 December 2015 etc.

The data I will be able to adjust the code as I learn it so lets keep it simple:

Name
Surname
Email
Cellphone

I went with php since I just thought oh well MySQL and Php generally fits together like a glove. However you are free to use any language you think would work best.

Keep in mind I will like to do the /backend page in bootstrap to keep with the look etc.

Much Appreciated
 
Sounds like you are asking people to do your homework for you ;)
 
Sounds like you are asking people to do your homework for you ;)

Haha not the case, but I am learning a bit of coding in my spare time outside of work etc and I am much better at catching on when I see working examples hence my made up scenario above.
 
If you are not willing then ignore the thread and don't reply thanks :)

( I have googled I have a functioning one, but my reason for this is very clearly stated in my OP )
 
why would anyone want to spend time doing this?

why dont YOU post YOUR code instead, and then ask for specific advise. That is a much better learning mechanism.
 
why would anyone want to spend time doing this?

why dont YOU post YOUR code instead, and then ask for specific advise. That is a much better learning mechanism.

Because then I imprint an idea and would defeat the purpose of my original clearly stated motive behind this. I want to see how most would do it and then compare it with mine.

Simple and to answer your question "why"

Well I assume there are nice humans out there that won't mind assisting someone instead of encouraging others not to :)

Guess a good hearted individual(s) would fit the "why" part
 
Because then I imprint an idea and would defeat the purpose of my original clearly stated motive behind this. I want to see how most would do it and then compare it with mine.

Simple and to answer your question "why"

Well I assume there are nice humans out there that won't mind assisting someone instead of encouraging others not to :)

Guess a good hearted individual(s) would fit the "why" part

That's not how it works...
You give us your implementation and the guru's will advise you on some best practises.
 
Sjoe boys, this is getting worse than stack overflow.

So much for asking advice and wanting to explore different ways.
 
LOL

you arent asking for any advice.

if my juniors came to me and said "how do you do this?", without bring what they have done/tried already, I wouldnt help them either
 
LOL

you arent asking for any advice.

if my juniors came to me and said "how do you do this?", without bring what they have done/tried already, I wouldnt help them either

Read my previous reply again.

StackOverflow is awesome! Normally takes less than 5 minutes to get an answer.
Nah true I love it, but their users are normally a bit more vicious, that is more what I was referring too like this thread is basically being over run by people who could have rather just let it go and allowed the human who was willing to help out, but instead anyone who was interested would now refrain, thanks to the warm helping mybb folk. ( not referring to you. )
 
Here is what I suggest.

You have a php form that posts the data to your DB after completion.

Create a php class that will (after submitting) GET the info from the DB and send a mail (using a template and pulling in the info you want) to the user and yourself.

What reports are you talking about though?
Do you want to see all the entries for that capture form?

You can use a sql query to get all the results from a date range.

The code part you can figure out yourself :)
 
Here is what I suggest.

You have a php form that posts the data to your DB after completion.

Create a php class that will (after submitting) GET the info from the DB and send a mail (using a template and pulling in the info you want) to the user and yourself.

What reports are you talking about though?
Do you want to see all the entries for that capture form?

You can use a sql query to get all the results from a date range.

The code part you can figure out yourself :)

Better than nothing :)

I currently have it that the form data gets posted to the php page and the php page uses the mail function to send the mail and then a separate part writes it to the DB

Regarding the reports:

I want to be able to type in an date range and then receive a report of all the the captured data for that period ie

Name Surname Email Phone
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
 
Sjoe boys, this is getting worse than stack overflow.

So much for asking advice and wanting to explore different ways.

LOL

you arent asking for any advice.

if my juniors came to me and said "how do you do this?", without bring what they have done/tried already, I wouldnt help them either

Read my previous reply again.


Nah true I love it, but their users are normally a bit more vicious, that is more what I was referring too like this thread is basically being over run by people who could have rather just let it go and allowed the human who was willing to help out, but instead anyone who was interested would now refrain, thanks to the warm helping mybb folk. ( not referring to you. )

stackoverflow helps people who help themselves.

but yes, we are all monsters, and are scaring the poor "humans" away........
 
Read my previous reply again.


Nah true I love it, but their users are normally a bit more vicious, that is more what I was referring too like this thread is basically being over run by people who could have rather just let it go and allowed the human who was willing to help out, but instead anyone who was interested would now refrain, thanks to the warm helping mybb folk. ( not referring to you. )


StackOverflow is far from vicious :wtf:
 
Better than nothing :)

I currently have it that the form data gets posted to the php page and the php page uses the mail function to send the mail and then a separate part writes it to the DB

Regarding the reports:

I want to be able to type in an date range and then receive a report of all the the captured data for that period ie

Name Surname Email Phone
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx

Code:
SELECT * FROM TableName WHERE DateField BETWEEN :fromDate AND :toDate
 
Better than nothing :)

I currently have it that the form data gets posted to the php page and the php page uses the mail function to send the mail and then a separate part writes it to the DB

Regarding the reports:

I want to be able to type in an date range and then receive a report of all the the captured data for that period ie

Name Surname Email Phone
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx
xxxx xxxx xxxx xxxx

A simple SQL query would get that data out.

What date range would you be looking at though? - I would suggest having an extra column and storing the date that the entry was inserted into the DB...
 
Top
Sign up to the MyBroadband newsletter
X