home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Quick question for you!

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2544
Discussions: 200,996, Posts: 2,379,947, Members: 246,364
Old March 8th, 2005, 01:56 AM   Digg it!   #1 (permalink)
Member
 
Bluesguitar's Avatar
 
Join Date: Jan 2005
Location: NE
Posts: 201
Quick question for you!

Hey, I assume this will be an easy question for you. What I want is to have a form that a user can fill out, hit send, and it will send an email with the info to my email address. I have that all figured out and it works.
What I cannot figure out how to do is when they hit the submit button, I want them to be sent to a certain page on my site instead of the 'echo' command. I've spent hours searching for a quick answer to this but have been unsuccessful. Thank you for your help!

Here's my mailer.php code:

<?php

if(isset($_POST['submit'])) {
$to = "mywebsite@mydomain.net";
$subject = "Contact";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];

$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";

echo "Message sent!";
mail($to, $subject, $body);
} else {
echo "There was an error";
}
?>
Bluesguitar is offline   Reply With Quote
Old March 8th, 2005, 03:03 AM     #2 (permalink)
Ultimate Member
 
mazdarx7-64's Avatar
 
Join Date: Aug 2004
Location: Knoxville, TN
Posts: 2,044
I'm a little rusty on PHP, but this might work.

<?php

if(isset($_POST['submit'])) {
$to = "mywebsite@mydomain.net";
$subject = "Contact";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];

$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";

header("Location: http://www.successpage.com/");
mail($to, $subject, $body);
} else {
header("Location: http://www.errorpage.com/");
}
?>
__________________
BSOD.........
The reason why I'll be drunk tonight.
Are you a winner?
mazdarx7-64 is offline   Reply With Quote
Old March 8th, 2005, 01:29 PM     #3 (permalink)
Member
 
Bluesguitar's Avatar
 
Join Date: Jan 2005
Location: NE
Posts: 201
I just tried that and it gives me this error:

Warning: Cannot modify header information - headers already sent by (output started at /home/content/b/l/u/bluesguitar03/html/mailer.php:1) in /home/content/b/l/u/bluesguitar03/html/mailer.php on line 12
Bluesguitar is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cleaning Master Boot Record skybolt_1 Applications and Operating Systems 10 August 11th, 2004 08:25 AM
What's so good about Dreamweaver anyway? Michael Chiew Webmastering and Programming 22 November 21st, 2002 03:25 AM
Any Compaq experts out there? zen General Tech Discussion 46 October 29th, 2002 05:52 PM
Quick Question Linkin' Park General Tech Discussion 6 January 20th, 2002 02:44 PM
UD - Joined the team Saturday and have a question Marc04 Distributed Computing 5 December 5th, 2001 07:55 AM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (3092)
Charges against non-tippers dropped.. (22)
Foxconn Blackops x48 MoBo (5)
Health Care Rationing (16)
Nvidia GTX 260 problem (14)
Delete an OS (17)
Laptop with wireless problem. (13)
Wireless Televisions. (12)
windows vista security holes (19)
CPU fan stops spinning randomly (11)
Regular Build (11)
Point and Shoot Camera Suggestions. (9)
[F@H SPAM 11/16/09] ! 1/2 months to.. (41)
windows 7 problem (7)
Recent Discussions
add ram to existing (1)
Need help getting speakers to work (2)
Nvidia GTX 260 problem (14)
Laptop with wireless problem. (13)
Point and Shoot Camera Suggestions. (9)
Is the PSU I received dead? (16)
FreeAgent drive software not x64 comp.. (1)
Intel 5100 AGN issues fixed yet? (28)
Foxconn Blackops x48 MoBo (5)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (41)
Print spooler problem (17)
Q9650 vs. Q9550 (2)
Desktop Calendar Application (2)
Looking for new motherboard (1)
soundmon.exe (8)
Jedi Academy Problem (3)
Can a page file be "too big".. (1)
Size after cutting 700Mb file is 2.5 .. (0)
Delete an OS (17)
windows vista security holes (19)
updating BIOS via winflash, claims fi.. (1)
New Server Configuration Suggestions (0)
cheap gaming laptop? (12)
Unallocated Space (2)
help me pls laptop just stopped worki.. (1)


All times are GMT -4. The time now is 11:48 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28