Jump to content

PHP Evaluation form HELP!


dennnnnnis

Recommended Posts

I've never used PHP before and I need to create a simple form, here's the idea:

1. Do you have trouble hearing in movie theaters?
( ) Always <-- value = 2
( ) Sometimes <-- value = 1
( ) Never <-- value = 0

and after a few questions they hit submit and it spits out a recommendation based on the amount of points that added up. Example:

8 points
You need to make an appointment for a hearing test ASAP, call 1-800... etc.

I'm going to be using Dreamweaver 8 to create this - can someone help me with it?

THANK YOU!!!

//d
Link to comment
Share on other sites

Creating the application - never done PHP before today.

//d

[!--quoteo(post=351038:date=Mar 2 2006, 12:24 PM:name=AV1611)--][div class=\'quotetop\']QUOTE(AV1611 @ Mar 2 2006, 12:24 PM) [snapback]351038[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Do you need help with the CONCEPT, or do you need help creating the application?
[/quote]
Link to comment
Share on other sites

[!--quoteo(post=351040:date=Mar 2 2006, 01:31 PM:name=dennnnnnis)--][div class=\'quotetop\']QUOTE(dennnnnnis @ Mar 2 2006, 01:31 PM) [snapback]351040[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Creating the application - never done PHP before today.

//d
[/quote]
Ok ...I am NOT going to code this for you....but I will help you learn.

I am assuming that the html you are ok with.

Basically your form action needs to target a php page....lets call it formprocess.php

In this script you need to extract the values set in the form

$question1=$_POST['formfield1']; So look up the $_POST procedure in the link below to understand what this does.

repeat for all questions.

Then you need to add the varialbles up

$result = $question1+$question2...and so on

Then you need to 'echo' a response. Echo means print to screen...Again look this up/

To do this you will also need to 'response'. To decide what the response is goint to be we need an 'if statement'

if ($response<>'somevalue') { do this } else { do this} Again look this up.

Link is www.php.net This is the official documentation.

Once you have processed some of this in your mind. Feel free to ask some specific questions and your code attempts. This way you are a) more likey to recieve specific answers and b) you will learn quicker.

Good Luck with this...

Will

PS ...forget Dreamweaver doing the work for you...It simply cant. By all means write you code in it, but it causes more problems than it solves.

Will
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.