HTML fill-in and submit form

Miscellaneous Forums/General Discussion/HTML fill-in and submit form

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

If you wanted to do it in PHP you can use the built in Mail() function.

You need to configure the settings for Mail in php.ini - instructions here.

Quick example PHP/HTML code (should work but I haven't tested it). Sorry the form is ugly. I couldn't be arsed to format it properly.
<?php
	if (!$_POST['submit'])
		{
			?>		
			<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
				Address: <input type="text" name="address" size="50"><br>
				Subject: <input type="text" name="subject" size="50"><br>
				Message: <input type="text" name="message" size="50"><br>
				<input type="submit" name="submit" value="Send">
			</form>
			<?php
		} else {
			$addr = $_POST['address'];
			$subj = $_POST['subject'];
			$msg = $_POST['message'];
			$result = mail($addr, $subj, $msg);
			if ($result)
				{
					echo "Mail sent!";
				} else {
					echo "Unable to send!";
				}
		}
?>


[edit] Just tested it and it works fine.