PHP/mySQL based technical evaluation question webform/database

Hello,

I am somewhat new to PHP and I am looking to create a technical evaluation web site & database.

  • Set of questions, with a comments box for each question
  • Each question has a specific % or weighting to it
  • Would like to have the results of the evaluation emailed to a specific email address
  • would like the evaluation stored in a mySQL database (currently have xampp installed) and users to be able to access this data upon permissions/logins, if users want access to a previous evaluation they can call it from the website and have it displayed and or exported to excel file.

That’s the base of the evaluation/database that i would like to setup. I have been looking online for scripts but they all seem to lead me to surveys (which are helpful, but don’t have the right kind of calculations and comments that I would like to add to each question).

Any help would be greatly appreciated.

I should also mention I would like for the site or the questions to be in a webform if possible.

Well, by a webform, I will assume you mean a webpage with a form on it.
So, that is very easy to set up with HTML and FORM tags. Text fields for word inputs and RADIO buttons for option inputs. Just post the form out to a second file which would be PHP to do the percentage calculations and saving of the data into the database. Very easy to do these days. Pulling the data back out of the database is very easy too.

Writing to Excel formats are nearly impossible without an addon package. (Hard to convert data to MS’s format!) But, a great work-around for that section is to output it in CSV format. This is very easy to do with PHP and the user’s can import it into EXCEL with ease.

Now, you mentioned your are somewhat new to PHP… So, have you started your project? Have you put it down on paper yet to lay it out at all? Do you know the database structure yet? What fields you need, etc.?

Lots of questions for us to be able to help you. I would say the first step is to study your questions and answer layout. Draw a page up that has the general setup of this. Create your database tables and fields. Once this is complete, then you can start developing the project. Steps might include some of the following, but, most likely several other steps will be needed…

Login-pages with userids and passwords
database to hold tables for users, questions, results
website page for actual questions and answers, including design of flow of page from one question to next and backing up, etc
php code to save data from a user into the database after error-checked and validated
php code to display records to users from database
security code to keep out riff-raft…

Well, lots for you to think about. When you get further along, please come back for more help…
Good luck…

Thank you very much for the advice and info.

I do have a spreadsheet that I have been using to host the questions using borrowed excel formulas.

I can come up with something more on paper or perhaps in a visio document which may help with the layout of things.

I’ll repost when I have a solid plan and outline.

I am quite proficient with the computer and o have some HTML experience…quick learner.
Thanks vm again!!

Great! Sounds like you have a good start. I was giving you a simple overview to get you started.

But, if you have it in a spreadsheet and it is currently working you are all set to start programming!

Get the HTML FORM layout going first. Then, add some simple sections that allow for the form’s inputs to be read and used in a PHP program. Add the complicated formula’s last along with security, and all. Getting the database set up can be created just by looking at the spreadsheet and seeing all the data needed to be stored for future use…

Once you get the form in place and database setup, next would be getting the data posted from users into the database. After all that, I am sure you will be back… And, we will be waiting…

Have a nice fun time figuring out your programming puzzle project… LOL… CYA in the bitstream…

Well ErnieAlex, I have the form created now, which submits to a mysql database just beautifully. The problem is, I would like to use this setup for work and we use Microsoft SQL. How difficult would it be to convert the syntax/code to use or submit to?

I can provide a copy of the code that I borrowed online (with all the tweaks for my setup).
Thanks!!

There are a few other things that I am interested doing as well which I need some help with (which i am hoping you can help with). :slight_smile:

Very little difference in SQL and MySQL. the actual SQL queries are nearly the same with some minor differences. Nothing to worry about there. The only main item that will be needed to change is the
connection strings. You connect to a SQL database with a different connection string. There are TONS
of example on Google if you ask correctly. Try “PHP MS SQL connection string sample”… (no quotes)
The trick to Google is using the main item first. So, start with PHP and then MS SQL or MySQL then the
actual question… You will find gold that way!

So, yes we can help you here. Just ask your questions and one of us will help… Good luck…

Well, after a bit of digging around, I came across a site that will build a php based form with mysql backend. “Machform” is the site. Pretty powerful and easy to install/setup.

I can create forms, have them submit and add to the database fine. My next thing is creating either a new form or site, where I am pulling or fetching the data that has been saved.

Here is the page that I have created to pull a full list of data that has been submitted. Its looks really ugly right now. Looking for some advise on how to make it a bit more UI friendly, adding better looking tables or a better way to output this data to a webpage?

Here is the code:

<?php mysql_connect("localhost", "root", "password") or die(mysql_error()); mysql_select_db("techeval_db") or die(mysql_error()); $data = mysql_query("SELECT `date_created` , `ip_address` , `element_1_1` , `element_1_2` , `element_2` , `element_3` , `element_4` , `element_5` , `element_14` FROM `ap_form_2`") or die(mysql_error()); Print ""; while($info = mysql_fetch_array( $data )) { Print ""; Print " "; Print " "; Print " "; Print " "; Print " "; Print " "; Print " "; Print " "; Print " "; } Print "
Submitted Date: ".$info['date_created'] . "IP Address: ".$info['ip_address'] . "First: ".$info['element_1_1'] . "Last: ".$info['element_1_2'] . "BSR Reviewed: ".$info['element_2'] . "BSR Summary: ".$info['element_3'] . "BSR Created Date: ".$info['element_4'] . "Email Address: ".$info['element_5'] . "Did the prime answer this question properly?: ".$info['element_14'] . "
"; ?>

The other thing, is I would like to create a page wherein after I submit the form, I can provide a direct link to a similar looking page which would display only that particular form/data.

Thanks,

Well, your “Machform” site is for an application you purchase and have to learn it’s code and how it works. So, to maintain it, or make changes would have to be done with their software. So, debugging that code, you should look at their site for help.

But, the code you posted is a start for your own version. We can help you with questions. So, what is your actual question for us on the code you posted? It’s a basic table. One thing you did not do is close your row in the table! ( ) Also, you are printing one large row in the table. Usually, you would have one row that would be your headings, followed by one row per record in the database. So, you may want to print your headings first, then, read the database and print one row per record and lastly close the database and table.

Hope that helps…

Sponsor our Newsletter | Privacy Policy | Terms of Service