Go Back   Novahq.net Forum > Computers > Web design and Programming
FAQ Community Calendar Today's Posts Search

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-23-2006, 06:27 PM
navysea| is offline navysea|
Registered User

Join Date: Jul 2004
Posts: 84

Send a message via ICQ to navysea| Send a message via AIM to navysea|
problem with contact form

Hey everyone sry i havent been round much been busy with school finals!
ok so im having trouble with a contact form in PHP

here is my contact form file:
PHP Code:
<form action="send_contact.php" method="POST">

Your Name:<br /><input type='text' name='name'><br />

Type of site:<br /><input type='text' name='type'><br />

Color Scheme:<br /><input type='text' name='colors'><br />

Email:<br /><input type='text' name='email'><br />

Message:<br /><textarea cols='50' rows='10' name='message'></textarea><br />

<
input type='submit' value='Send!'><input type="reset" name="reset" value="Reset"
ok and here is my sendcontact.php file
PHP Code:
<?php
// Contact subject
$subject ="$name";

// Details
$message="$type /n $colors /n $message";

// Mail of sender
$mail_from="$email";
// From
$header="from: $name <$mail_from>";

// Enter your email address
$to ='someone@somewhere.com';

$send_contact=mail($to,$subject,$message,$header);

// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo 
"We've recived your contact information";
}
else {
echo 
"There was a problem while trying to send the information. Please try again.";
}
?>
Ok now my problem is a few things it says that it sends the information but when i check my email nothing is there and yes ive sent fake emails from other email address and i refresh and they show up but the contact form does not.

OK and my next question...
How do i get the type of site, color scheme, and message all to be the acutal message when i read the email?
__________________

Reply With Quote
  #2  
Old 01-23-2006, 06:30 PM
Jeff is offline Jeff
Registered User

Join Date: Jun 2005
Posts: 1,602

Send a message via AIM to Jeff
I'm stumped, but hey i always cheat and just use the generator that comes with fantastico.
__________________
Exit 13 - Web design and development.
My Blog - Read up on what i'm up to.
Reply With Quote
  #3  
Old 01-23-2006, 06:33 PM
DevilDog#1 is offline DevilDog#1

Join Date: Jul 2002
Posts: 7,040

Try sending one email first:

PHP Code:
$send_contact=mail('mailto','subject','body','From:email@address.com'); 
From the manual

__________________








Quote:
If I don't do that doesn't mean I can't - DD#1

Last edited by DevilDog#1; 01-23-2006 at 06:48 PM.
Reply With Quote
  #4  
Old 01-23-2006, 07:14 PM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

Re: problem with contact form

Quote:
Originally posted by navysea|
Hey everyone sry i havent been round much been busy with school finals!
ok so im having trouble with a contact form in PHP

here is my contact form file:
PHP Code:
<form action="send_contact.php" method="POST">

Your Name:<br /><input type='text' name='name'><br />

Type of site:<br /><input type='text' name='type'><br />

Color Scheme:<br /><input type='text' name='colors'><br />

Email:<br /><input type='text' name='email'><br />

Message:<br /><textarea cols='50' rows='10' name='message'></textarea><br />

<
input type='submit' value='Send!'><input type="reset" name="reset" value="Reset"
ok and here is my sendcontact.php file
PHP Code:
<?php
// Contact subject
$subject ="$name";

// Details
$message="$type /n $colors /n $message";

// Mail of sender
$mail_from="$email";
// From
$header="from: $name <$mail_from>";

// Enter your email address
$to ='someone@somewhere.com';

$send_contact=mail($to,$subject,$message,$header);

// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo 
"We've recived your contact information";
}
else {
echo 
"There was a problem while trying to send the information. Please try again.";
}
?>
Ok now my problem is a few things it says that it sends the information but when i check my email nothing is there and yes ive sent fake emails from other email address and i refresh and they show up but the contact form does not.

OK and my next question...
How do i get the type of site, color scheme, and message all to be the acutal message when i read the email?
Heya.

Okay, here's a couple things that I would do to debug. (Do what DD said and then) also try rewriting and doing what the PHP Manual says in their examples. Shan't be to hard. If you still have troubles, panther has a great script @ http://phphq.net/ Download it, use it, or better yet, read and learn how to do it from panthers code.

Tell us how it goes

(PHP Code
PHP Code:
<?php
// Contact subject
$subject ="" $_POST['name'] . "";

// Details
$message="" $_POST['type'] . " /n $colors /n " $_POST['message'] . "";

// Mail of sender
$mail_from="" $_POST['email'] . "";
// From
$header="from: " $_POST['name'] . " <" $_POST['mail_from'] . ">";

// Enter your email address
$to ='someone@somewhere.com';

$send_contact=mail($to,$subject,$message,$header);

// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo 
"We've recived your contact information";
}
else {
echo 
"There was a problem while trying to send the information. Please try again.";
}
?>
Reply With Quote
  #5  
Old 01-23-2006, 07:40 PM
Webviper2006 is offline Webviper2006
Registered User

Join Date: Nov 2005
Posts: 495

Quote:
Originally posted by Jeff
I'm stumped, but hey i always cheat and just use the generator that comes with fantastico.
lol
__________________
Sorry bums, now I'm back! Now I know C++! I use Microsoft Visual C++!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem w/ multiple attachments making the whole form repeat savantmg phphq.Net Forums 3 03-23-2006 03:04 PM
.../?p=contact?p=email tommeh phphq.Net Forums 4 03-02-2005 04:45 PM
please contact me Sofaires Feedback / Novahq.net Support 6 07-02-2003 06:49 PM


All times are GMT -5. The time now is 01:45 PM.




Powered by vBulletin®