action=mailto:

ok, this is what I have.. you can paste into notepad...

---------------------------------

<form method="POST" action="contact2.php">
<input name="name" type="text" id="name" size="40">
<br>
Your Name
<br><br>
<input name="email" type="text" id="email" size="40">
<br>
Your Street Address
<br>
<br>
<input name="phone" type="text" id="subject" size="40">
<br>
Your Phone Number
<br>
<br>
<input name="subject" type="text" id="subject" size="40">
<br>
Your Email Address
<br>
<br>
<br>

<textarea name="message" cols="40" rows="7"></textarea>
<br>
Please Explain your problem here in as much detail as possible,
<br>
as it will help to know your problem before I get there.
<br>
<input name="Submit" type="submit" value="Send Message" />

<?php
$email = $HTTP_POST_VARS;
$mailto = "qqsnare@gmail.com";
$mailsubj = "$subject\n";
$mailhead = "<b>From:</b> $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Message body:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
$mailbody .= "$key : $val\n"; }
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>

-----------------------------------------

I dont know how to do the <php> part though.. and when I put junk in the boxes I get "page cannot be displayed"

? lol

-Q
 
OK - I will host it for you, for free. Just send me the files through email, or MSN (joseph.redfern@gmail.com) You will need to out it in an iframe though.

edit:

I have just noticed somthing about that script... im not sure if this is correct, but wont a blank email be sent, everytime somone goes on that page?
 
alright, Im kind of a noob. Do you want me to call those files? or what lol..

^_^ Im scared ^_^

lol

I dont know what to do

-Q
 
OK, The file "contact.php" is the contact form. When you click submit, it sends ot over to contact2.php, which will email you. You will need to put the contact page as an iframe in your website. Just insert this

Code:
 <iframe width = "600" height = "500" src = "http://www.techtime.co.uk/hosted/captain/contact.php"></iframe>
 
wow thanks! now.. how did you do that? :D do I have to buy my own web page or what?
other than that, it works perfect!

edit*

ok, so I got it not to be spam in my inbox, but is there a way where I can change the name of the email from "no body" to something like "Computer Repair"?

------------------
can you be keeping track of all the information that is beinjg sent to me?
 
errm... Well, i suppose what you could do is make it submit the data into a mysql database, then email it to you. And about the "no body" thing.. im not too sure what you mean :D
 
The subject should be what is inputted into the subject text box. You will get the no body error if nothing is entered, I think.

This isn't the most foolproof method btw, the mySQL method is a lot better IMO. But that takes lots more coding and stuff.

Also, for a better method, add this to the top of that php on contact2.php:

PHP:
$name = htmlentities($_POST['name']);
$email = htmlentities($_POST['email']);
$phone = htmlentities($_POST['phone]);
$message = htmlentities($_POST['message']);

And edit:
PHP:
$mailsubj = "$subject\n";
to:
PHP:
$mailsubj = "From: $name\n";
 
Captain, i am starting to make a version that adds it to a mySQL Database, so even if you delete the email, it will have a copy saved in the database.
 
Back
Top Bottom