PHP and Form Data

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
camhabib
Forum Commoner
Posts: 37
Joined: Tue Aug 16, 2005 8:36 pm
Location: Boston, MA

PHP and Form Data

Post by camhabib »

Hey, I'm somewhat new to PHP and definitely new to the forums. I'm building a website for a client of mine. It is going to be hosted by a company, probably something like Yahoo!. She wants to collect opinions on certain things and analyze the data. She is somewhat technologically challenged so I'm trying to make this as easy as possible for her. What do you think would be the easiest way for her to receive the data? Is there anyway to create a PHP script to send an e-mail for every form submission? Would it be easier to use SQL and show her how to access that? Any opinions are welcomed and appreciated. Thanks.

-Cameron
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

"You'll have to hide the SQL from her, and create a page that allows her to view the collected data easily. Don't email it to her.
camhabib
Forum Commoner
Posts: 37
Joined: Tue Aug 16, 2005 8:36 pm
Location: Boston, MA

Post by camhabib »

How do you suggest doing that? I've only recently started working with SQL and PHP, I'm more used to programming and fixing computers. To get the form to dump to the SQL I would do something like a method=”post” and then how would I go about getting it from the SQL to a simple webpage?

-Cameron
User avatar
gurjit
Forum Contributor
Posts: 314
Joined: Thu May 15, 2003 11:53 am
Location: UK

Post by gurjit »

Hi camhabib,

what we normally do for data collection via forms is:

create a form which users fill out
store the information the user fills out into a database
make an administration panel with a username and password login and allow the client to view the information from this administration panel.


the administration panel:
in this admin panel you make a menu with a link to the information and can allow the user to do searches and sort the data if you are using drop downs to capture certain data like for example source, county or country, so the client can see how many responses they got from a certain country or county or source.

An admin panel with queries to your database is the way forward.
camhabib
Forum Commoner
Posts: 37
Joined: Tue Aug 16, 2005 8:36 pm
Location: Boston, MA

Post by camhabib »

Is there any example or such you can point me to? I've recently picked up a book "Beginning PHP5 and MySQL" and have so far made a good dent in the book. It doesn't seem like the book really specifically tells you how to get information out of a form into a database or visa-versa. From what I understand you do <FORM Method="post" action="something.php"> however it is that "something.php" I am having trouble writing as there is really not that much information thus far on how to write a script to post information. As for the recieving, I'm assuming a similar GET statement would be needed. I'm really completely lost, doesn't happen quite often when it comes to computers but it does happen on occasion. Sorry to bother you guys if this seems ridiculously simple to you.

-Cameron
User avatar
gurjit
Forum Contributor
Posts: 314
Joined: Thu May 15, 2003 11:53 am
Location: UK

Post by gurjit »

this tutorial will show you how to insert data into a database and how you can retrieve the data afterwards......

http://www.freewebmasterhelp.com/tutorials/phpmysql


for descriptions of the commands used in php, I have always found

http://www.php.net

a god send.

use google for good tutorials.......
Post Reply