Php Form won't send?

Status
Not open for further replies.

evan99

New Member
Messages
3
Reaction score
0
Points
0
I just signed up for free hosting, my domain is livinginsomeoneelsesdream.elementfx.com.
I have a php form on that page but I cant get it to work.
I even created an email at my domain and changed the address in the form to that email, because
most hosting companies these days will only let u send a form from your own domain.
I thought that would fix the problem but it didn't. help??
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
Could you post the code here? Remove any sensitive information. This will help us diagnostic the problem.
 
Last edited:

evan99

New Member
Messages
3
Reaction score
0
Points
0
Code:
<html>

<head>

<script type="text/javascript" src="buypoem.js"></script>

</head>

<body>

<br /><br />

<form name="requestForm" action="email.php" method="post" onsubmit="return checkRequired();"> 
 
<p>Email address to send your poem: <input type="text" name="email" value="" size="30" /></p> 
 
<p>Choose a poem: 
 
<select name="interest" id="select_interest"> 
 
<option value = "">Select</option> 
 
(all option values listed here correctly)
 
</select></p>

Each poem cost $2.<br/>
(All poems have been copyrighted.)<br /><br />
 
<input type="submit" style="width:74px;" name="submit" id="submit" value="Submit" /> 
 
</form>

</body>

</html>





Code:
<html>

<head>

</head>

<body>

<?php

$email = trim(htmlentities($_POST['email'],ENT_QUOTES,'utf-8'));

$interest = trim(htmlentities($_POST['interest'],ENT_QUOTES,'utf-8'));


if($name != '' && $email != '' && $interest != ''){

$to = "evan@livinginsomeoneelsesdream.elementfx.com";

$subject = "Poem Request";

$message.="\r\nEmail: ".$email;

$message.="\r\nInterest: ".$interest;

$headers = "From: evan@livinginsomeoneelsesdream.elementfx.com";

$headers .="\r\nReply-To: evan@livinginsomeoneelsesdream.elementfx.com";


$success = mail($to, $subject, $message, $headers);


if ($success) {

	print ("<b>Thank you. That worked.</b>");

} else {

	print ("<b>I'm sorry, there was a technical glitch, please send your poem request to myemail@gmail.com directly.</b>");

}

} else {

print ("<b>This form did not send. Please press the BACK button and submit again. Thank you.</b>");

}

?>




</p>

</body>

</html>
 
Status
Not open for further replies.
Top