Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

email contact page

$
0
0

it is sending me the email but sends $email, $subject, $message. not the actual values.

 

errors =

startpost startedlost1
Notice: Undefined index: email in /home/jayden1/public_html/contactusemail.php on line 10
spot = email
lost
Notice: Undefined index: email in /home/jayden1/public_html/contactusemail.php on line 20

Notice: Undefined index: subject in /home/jayden1/public_html/contactusemail.php on line 21

Notice: Undefined index: message in /home/jayden1/public_html/contactusemail.php on line 22

 

 

contactusemail.php

<?php

error_reporting(E_ALL);

$check = array('email','subject','message'); 
echo "lost1";
	$break = false;
	foreach ($check as $key => $postcheck) { 
		if (!$_POST[$postcheck] || strlen($_POST[$postcheck]) == 0) { 
			$break = true;
			break;
		} 
		echo 'not blank';
	}
	
if (isset($_POST)){
	$email1 =($_POST['email']);
	$subject1 =($_POST['subject']);
	$message1 =($_POST['message']);
	echo $email1;
	echo $subject1;
	echo $message1;
	


$to      = 'Administrator@website.com'; // Send email to Administrator
			$subject = '$subject1'; // posted subject 
			$message = '$message1'; // Their message								
			$headers = 'From:$email1' . "\r\n"; // Set from headers
			mail($to, $subject, $message, $headers); // Send our email
			
			$msg = 'Your message has been sent!';
			header ('contact.php');
	}
	else
	{
	echo 'not working';
	}		
			?>

contact.php

<?php

session_start();
if (!$_SESSION || !$_SESSION['login']) {
 //redirect to a login page
 header('Location: index.php');
 
  exit;
}
else {

include ("navigate.php");


}


?>


<html>
<head>
<title>
Contact Us
</title>

<link type="text/css" rel="stylesheet" href="style.css" />
	
	</head>
	
	<body>
		<div id="info_wrapper">
			
			<table align="center" width="1100px">
				<tr>
					
					<td width="220px" align="center">
						<a href="home.php">Home</a>
					</td>
						
					<td width="220px" align="center">
						<a href="myhome.php">My Home Page</a>
					</td>
						
					<td width="220px" align="center">
						<a href="profile.php">My Profile</a>
					</td>	
						
					<td width="220px" align="center">	
						<a href="msearch.php">Member Search</a>
					</td>
						
					<td width="220px" align="center">
						<a href="logout.php">Logout</a>
					</td>
				
				</tr>
			</table>
			
			<h1 align="center">
				Contact Us
			</h1>
		
			<table align="center" width="1100px">
			
				<tr>
					
					<td width="366px" align="center">
						<a href="missionstatement.php">Mission Statement</a>
					</td>
					
					<td width="366px" align="center">
						<a href="adviceblog.php">Advice Blog</a>
					</td>
					
					<td width="366px" align="center">
						<a href="storycorner.php">Story Corner</a>
					</td>	
					
					
				</tr>
			</table>
			
			<table align="center" width="1100px">
			</br>
				<tr>
					
					<td width="550px" align="center">
						<a href="newmembers.php">New Members</a>
					</td>
					
					<td width="550px" align="center">
						<a href="chat.php">Community Chat Rooms</a>
					</td>
					
				</tr>
				
			</table>
			</br></br></br>
			<table align="center" id="table2">
			<tr>			
			<form action="contactusemail.php" method="post" enctype="text/plain" align="center" >
			</tr>
			<tr>
			<td>	
			Your E-Mail:
			</td>
			<td>
			<input type="text" name="email" value=""><br>
			</td>
			</tr>
			<tr>
			<td>
			Subject:
			</td>
			<td>
			<input type="text" name="subject" value=""><br>
			</td>
			</tr>
			<tr>
			<td colspan="2">
			<br>
			<textarea name="message" rows="8" cols="50">
			</textarea><br><br>
			</td>
			</tr>
			<tr>
			<td>
			</td>
			<td>
			<input type="submit" value="Submit">
			</td>
			</tr>
			</form>
			</table>
			
			</br></br></br>
			<p chat>
				Instant Messages and Online friends here
			</p chat>
			</br></br></br>
			
			<table align="center" width="1100px">
				
				<tr>
					<td>
						<a href="tos.php">Terms of Service</a>
					</td>
					
					<td>
						<a href="suggestionbox.php">Suggestion Box</a>
					</td>	
				</tr>

				<tr>
					<td>
						<a href="privacy.php">Privacy Policy</a>
					</td>
					
					<td>
						<a href="problem.php">Report a Problem</a>
					</td>
				</tr>
				
				<tr>
					<td>
						<a href="contact.php">Contact Us</a>
					</td>
				</tr>
			</table>
		</div>	
  </body>
</html>

help???


Viewing all articles
Browse latest Browse all 13200

Trending Articles