Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 12-23-2006, 01:21 AM   #21
Daemon Poster
 
Captain Pooka's Avatar
 
Join Date: Oct 2006
Posts: 1,108
Default Re: 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[email];
$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
__________________

Captain Pooka is offline   Reply With Quote
Old 12-23-2006, 07:04 AM   #22
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: action=mailto:

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?
__________________

j03 is offline   Reply With Quote
Old 12-23-2006, 07:13 AM   #23
In Runtime
 
jamieoliver22's Avatar
 
Join Date: Apr 2004
Posts: 245
Default Re: action=mailto:

The PHP script needs to be on another page (like I said above). It needs going on 'contact2.php'.
__________________
Desktop: AMD Athlon XP 2000+ - 1.6ghz | MSI KT4-Ultra Motherboard |ATI Radeon Powercolor x850 XT 256mb DDR3 | 400gb HDD space |1gb PC2700 DDR SDRAM.
---
Laptop: AMD Sempron 3200+ - 1.6ghz | ATI Radeon Xpress 1100 - 128mb | 100gb PATA HDD | 1gb DDR2 RAM.
jamieoliver22 is offline   Reply With Quote
Old 12-23-2006, 07:28 AM   #24
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: action=mailto:

OK, http://www.techtime.co.uk/hosted/captain/ - I have uploaded them there. Enjoy
j03 is offline   Reply With Quote
Old 12-23-2006, 01:00 PM   #25
Daemon Poster
 
Captain Pooka's Avatar
 
Join Date: Oct 2006
Posts: 1,108
Default Re: action=mailto:

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
Captain Pooka is offline   Reply With Quote
Old 12-23-2006, 04:51 PM   #26
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: action=mailto:

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>
j03 is offline   Reply With Quote
Old 12-23-2006, 07:34 PM   #27
Daemon Poster
 
Captain Pooka's Avatar
 
Join Date: Oct 2006
Posts: 1,108
Default Re: action=mailto:

wow thanks! now.. how did you do that? 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?
Captain Pooka is offline   Reply With Quote
Old 12-24-2006, 05:39 AM   #28
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: action=mailto:

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
j03 is offline   Reply With Quote
Old 12-24-2006, 07:24 AM   #29
In Runtime
 
jamieoliver22's Avatar
 
Join Date: Apr 2004
Posts: 245
Default Re: action=mailto:

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 Code:
$name htmlentities($_POST['name']);
$email htmlentities($_POST['email']);
$phone htmlentities($_POST['phone]);
$message = htmlentities($_POST['
message']); 
And edit:
PHP Code:
$mailsubj "$subject\n"
to:
PHP Code:
$mailsubj "From: $name\n"
__________________
Desktop: AMD Athlon XP 2000+ - 1.6ghz | MSI KT4-Ultra Motherboard |ATI Radeon Powercolor x850 XT 256mb DDR3 | 400gb HDD space |1gb PC2700 DDR SDRAM.
---
Laptop: AMD Sempron 3200+ - 1.6ghz | ATI Radeon Xpress 1100 - 128mb | 100gb PATA HDD | 1gb DDR2 RAM.
jamieoliver22 is offline   Reply With Quote
Old 12-24-2006, 08:25 AM   #30
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: action=mailto:

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.
__________________

j03 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 09:14 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0