Jump to content


Photo

PHP Evaluation form HELP!


  • Please log in to reply
3 replies to this topic

#1 dennnnnnis

dennnnnnis
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 02 March 2006 - 04:52 PM

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

#2 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 02 March 2006 - 06:24 PM

Do you need help with the CONCEPT, or do you need help creating the application?


#3 dennnnnnis

dennnnnnis
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 02 March 2006 - 06:31 PM

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) View Post[/div][div class=\'quotemain\'][!--quotec--]
Do you need help with the CONCEPT, or do you need help creating the application?
[/quote]


#4 willpower

willpower
  • Members
  • PipPipPip
  • Advanced Member
  • 296 posts
  • LocationWarrington, Cheshire, UK

Posted 02 March 2006 - 07:43 PM

[!--quoteo(post=351040:date=Mar 2 2006, 01:31 PM:name=dennnnnnis)--][div class=\'quotetop\']QUOTE(dennnnnnis @ Mar 2 2006, 01:31 PM) View Post[/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
Wait...I've got it...Bollocks, it's gone again!

If at first you don't succeed....stop using ASP and get onto PHP




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users