| | |
survey for school grads... Another question
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Dec 2007
Posts: 63
Reputation:
Solved Threads: 0
Hey Sorry to bug you guys again. I had one more question. As i am developing this program now i realize that i have no clue how to save the data to the database.
basically the whole point in making this program was to be able to export a table in my database that would store all the submitted data from the survey.
I will have like 30 questions and almost 400 grads. all that data needs to be recorded.
What is going to be the easiest table structure to do that type of thing?
Or is e-mail just going to end up being easier?
basically the whole point in making this program was to be able to export a table in my database that would store all the submitted data from the survey.
I will have like 30 questions and almost 400 grads. all that data needs to be recorded.
What is going to be the easiest table structure to do that type of thing?
Or is e-mail just going to end up being easier?
php Syntax (Toggle Plain Text)
CREATE TABLE test ( id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , name VARCHAR( 100 ) NOT NULL , address VARCHAR( 100 ) NOT NULL ) ENGINE = InnoDB
php Syntax (Toggle Plain Text)
<?php if(isset($_POST['submit'])){ $conn=mysql_connect("localhost","root"); mysql_select_db("exact"); $name=$_POST['name']; $address=$_POST['address']; $query="INSERT INTO TEST (ID,NAME,ADDRESS) VALUES ('','$name','$address')"; mysql_query($query); } ?> <html> <body> <form method="post" action="insert_example.php"> Enter Name: <input type="text" name="name"><br /> Enter Address: <textarea rows="10" cols="20" name="address"></textarea> <br /> <input type="submit" name="submit" value="submit"> </form> </body> </html>
Cheers,
Nav
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Dec 2007
Posts: 63
Reputation:
Solved Threads: 0
so if i wanted to send all the results via e-mail i would do something similar? i am going to search on that site you gave me and that book lets see if i can get it....
I found out how to mail it i just need some help with the security now.
I want to stop people from just going to the page vote.php, i want them going through the login how is that done?
I found out how to mail it i just need some help with the security now.
I want to stop people from just going to the page vote.php, i want them going through the login how is that done?
Last edited by dani190; Jan 14th, 2008 at 2:35 pm.
You can use mail function.
Eg.
Eg.
mail("to address","subject","message contents","from: from address"); Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
Well, you can have a condition to check if the submit button was pressed.
you can send all the data in the message part of the mail.
php Syntax (Toggle Plain Text)
if(isset($_POST['submit'])){ $message="This is the body of this mail. blah blah blah..........some more text... "; mail("test@gmail.com","test mail",$message,"from: someone@gmail.com"); }
Last edited by nav33n; Jan 14th, 2008 at 2:58 pm.
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Dec 2007
Posts: 63
Reputation:
Solved Threads: 0
k so 1 more thing
In the email part i dont know how to retrieve the persons answers from the folllowing...
...
Thanks, Dani
In the email part i dont know how to retrieve the persons answers from the folllowing...
PHP Syntax (Toggle Plain Text)
<label>40. Funniest</label><br /> <select name="funniest"> <option value="">Please Choose One Person</option> <option value="">Not Voting</option> <?php echo $option; ?> </select> <br />
...
Thanks, Dani
![]() |
Similar Threads
Other Threads in the PHP Forum
- Previous Thread: My sql image links in table
- Next Thread: parse error, unexpected '<' in /data/www/tppine/camo/data/data.php
| Thread Tools | Search this Thread |
apache api array beginner binary broken cache cakephp checkbox class cms code confirm cron curl customizableitems database date display dynamic echo email error external fcc file files folder form forms forum freelancing function functions google header headmethod howtowriteathesis href htaccess html iframe image include insert ip javascript joomla limit link login mail malfunction menu method mlm mod_rewrite multiple mysql neutrality oop pageing pagerank paypal pdf php phpmysql play problem query question radio random recursion remote root script search select server sessions sms soap source space sql support! syntax system table template tutorial update upload url validator variable video web youtube






