Jump to content

email contact page


Go to solution Solved by cyberRobot,

Recommended Posts

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

Edited by Jayden_Blade
Link to comment
https://forums.phpfreaks.com/topic/284439-email-contact-page/
Share on other sites

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

 

 

 

changed quotes no difference

Link to comment
https://forums.phpfreaks.com/topic/284439-email-contact-page/#findComment-1460958
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.