This is a discussion on "Form" within the PHP Forum section. This forum, and the thread "Form are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Form
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
Form
If you do an online questionnaire, you answer the questions, tick boxes, drop down list etc and at the end it tells you you score on a new page, how do I do that?
My online example: http://test.lightex.co.uk/wf.html |
|
|
|
||||
|
Re: Form
Install PHP on your system if you are hosting the site or check if your host uses php.
then learn how to use PHP. For what your doing I recommend: http://www.tizag.com/phpT/postget.php this is what takes the users input then this: http://www.tizag.com/phpT/if.php if you combine the two, you get: The form sends the variables(question answers in your case) to php, php then checks the variables, something like this:
$answer = $_POST['answer'] get the answer from the form and make a variable, the variables value will be that from the form. This is example, the possible values/answers would be yes or no. if ($answer == "yes") { The correct answer to the question is yes. If the variable is equal to yes then: echo "correct!"; which just means, the page will say correct. else statement. If the variable isn't yes then say it's wrong: else { echo "wrong!"; } You can't copy and paste this and get it to work. It requires basic understanding of forms, variables and if/else statements. If you don't want to learn all this, look around for a custom questionnaire on google, or ask someone, I'd be happy to do it in my spare time (which is a lot). Hope that helps! (if it does Rep me
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
![]() |
| Tags |
| form |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hiding / Showing form fields based on previous form input | John Alexander Hopper | PHP Forum | 1 | Mar 10th, 2008 11:30 |
| form variable within an iframe component of a form | kissfreaque | PHP Forum | 3 | Feb 29th, 2008 13:06 |
| form variable within an iframe component of a form | kissfreaque | JavaScript Forum | 5 | Feb 29th, 2008 11:57 |
| [SOLVED] PHP contact form redirect to same form | Posie | PHP Forum | 14 | Jan 29th, 2008 20:28 |
| ASP form to check weather a form value is already in the database | Andrew1986 | Classic ASP | 3 | Oct 25th, 2007 08:23 |