Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   Web design and Programming (https://novahq.net/forum/forumdisplay.php?f=32)
-   -   problem with contact form (https://novahq.net/forum/showthread.php?t=32743)

navysea| 01-23-2006 06:27 PM

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?

Jeff 01-23-2006 06:30 PM

I'm stumped, but hey i always cheat and just use the generator that comes with fantastico.

DevilDog#1 01-23-2006 06:33 PM

Try sending one email first:

PHP Code:

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

From the manual


JonM 01-23-2006 07:14 PM

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. :D

:gj: 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.";
}
?>


Webviper2006 01-23-2006 07:40 PM

Quote:

Originally posted by Jeff
I'm stumped, but hey i always cheat and just use the generator that comes with fantastico.
lol


All times are GMT -5. The time now is 06:05 PM.

Powered by vBulletin®