Submitting XHTML forms

Trip

Registered
I'm trying to do a project where a user submits a form that's rittled with private information. I'm using XHTML and CSS but I can't figure out how to actually have the form submit. I tried get="whatever" and post="whatever" I even tried "<form method="post"action="document.clientlogin.submit()">" but none of those are working correctly.

Not only that but I would like it to somehow, secretly, submit the form to my e-mail. It'd make things easier for me to run the website if somehow the form would just send the data straight to my e-mail address instead of writing it to a page or something.

Can anyone help me with this?
 
..,and then in doStuff.php...

(oh, and make sure you add name='submit' to the submit button for it to work.)

PHP:
<?

if (isset($_POST['submit'])) {

$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];

$body = 'The user '.$name.' has sent the message '. $message;

mail ('your@address.com', 'Subject', $body, 'From: '.$email);

}else{

echo '<p>Error: Form not submitted</p>';
}

?>

so you'd just store whatever info you need sent to you in the $body variable and the user's email (if needed) in the $email. The names used inside the $_POST code, of course , corresponds with the names you have give your fields in the form.

I'm no PHP genious, so there may be a better way -- but that's the way I do it,. If you need to encrypt it for security reasons, then it's probably a lot more complicated.

how's your site going btw? I noticed you removed your blog. Have you uploaded your portfolio yet? The designs I've seen of yours have impressed me so far -- I was looking forward to seeing your work.
 
Back
Top