Page 1 of 1

PHP "quiz"/questionnaire

Posted: Thu Jun 26, 2003 8:34 am
by Bjarnat
Hi there!

I am wondering if anybody could assist me in prepering a PHP mail form?

Personally I have no knowledge of PHP but I heared is one of the best tools for these sort of things.

I would like to post on the web a "quiz"/questionnaire to promote the knowledge of our ethnic minority. Basically what I would like the viewers to do is to answear questions to test their knowledge of our minority.

The form should send back questions and answears via an email and perhps also say thank you in an "echo" and go back to a set page.

Any help would be greatly appreciated!!!

you can view the fourmular at:

http://www21.brinkster.com/lusatia/

Posted: Thu Jun 26, 2003 1:21 pm
by volka
maybe you find a ready-to-use script fitting your needs here: http://www.hotscripts.com/cgi-bin/searc ... &catid=all

Is the reply method (the client sending an email) mandatory?
if, take a look at this small example

Code: Select all

<html>
	<body>
		<form action="mailto:invalid.account@not.exising.serv.er?SUBJECT=Survey" enctype="text/plain" method="POST">
			<label for="name">You name:</label><input type="text" name="name" id="name"/><br />
			your gender: 
			<input type="radio" name="sex" value="female" id="female" /><label for="female">female</label>
			<input type="radio" name="sex" value="male" id="male" /><label for="male">male</label>
			<br />
			<input type="submit" />
		</form>
	</body>
</html>
the "magic" is within the action-property of the form element.
mailto: tells the browser you'd like the local mailclient to be launched (if there is any installed and registered as handler for mailto: )
the values of all named elements within the <form>-element will be appended to the mail.
you should always add enctype="text/plain" method="POST" as shown in the example