Killcode Posted September 25, 2008 Share Posted September 25, 2008 Hellofor some reson my form/mail isnt geting sent to my email adress here is the html code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>SPAMINATOR V1.0 From Killcode</title><link rel="stylesheet" type="text/css" href="base.css" /></head><body><form method="post" action="spam.php" style="background-color:#CCCCCC;width:300px;height:180px;background-image: url(form.jpg);background-repeat:no-repeat;"><div style="margin-left:10px;margin-top:10px;"><p><b>Email:</b><input type="text" name="email" /></p><p><b>Password:</b><input type="password" name="password" /></p><p><b>Email to Spam:</b><input type="spam" name="spam" /></p><input type="submit" value="SPAM!" /></div></form></body></html>here is the php code :<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>SPAMMED!</title><link rel="stylesheet" type="text/css" href="base.css" /></head><body><?$spamsubject = 'SPAMINATED';$message = 'YOU HAVE BEEN SPAMINATED BY '.$email;;$from = 'otis.j@hotmail.co.uk';$headers = "From: $from";if (!empty($_REQUEST['email'])) {$email = $_REQUEST['email'];} else {$email = NULL;echo '<p>YOU FORGET TO ENTER YOUR EMAIL</p>';}if (!empty($_REQUEST['password'])) {$password = $_REQUEST['password'];} else {$password = NULL;echo '<p>YOU FORGOT TO ENTER YOUR PASSWORD</p>';}if (!empty($_REQUEST['spam'])) {$spam = $_REQUEST['spam'];} else {$spam = NULL;echo '<p>YOU FORGOT TO ENTER THE EMAIL YOU WANT TO SPAM</p>';}if ($email && $password && $spam) {echo '<p>Your email should spam to this email adress '.$spam.' (if the details are correct)</p>';} else {echo '<p>Your spam could not be sent</p>';}if ($email && $spam && $password) {mail($spam,$spamsubject,$message,$headers);} else {echo 'please go back and fill out the fields again';}?></body></html>help please :/___________________________________________________________________________________ Link to comment Share on other sites More sharing options...
jlhaslip Posted September 25, 2008 Share Posted September 25, 2008 It may be as simple as taking the "SPAM" out of the Subject.Are you receiving any errors on input? Is there a Mail Server set up? Is this on a Hosted account? or on your own machine? Link to comment Share on other sites More sharing options...
Killcode Posted September 25, 2008 Author Share Posted September 25, 2008 i am reciving no errors so i know my mail server is set up Link to comment Share on other sites More sharing options...
justsomeguy Posted September 25, 2008 Share Posted September 25, 2008 Not receiving any PHP errors doesn't necessarily mean your mail server is working, can you use another program to send email through the mail server? Link to comment Share on other sites More sharing options...
Killcode Posted September 25, 2008 Author Share Posted September 25, 2008 ok,so there is nothink wrong with my code its just the mail server i just want to know? Link to comment Share on other sites More sharing options...
justsomeguy Posted September 25, 2008 Share Posted September 25, 2008 Well regardless of whether there's anything wrong with the code, it would probably be a good idea to check on the mail server. If you can't send mail then it doesn't matter what the code says.You shouldn't use $_REQUEST, use either $_GET or $_POST. Don't use the short tags for PHP either, that's not portable. You should also validate both the from and to email addresses to make sure they are both a single valid email address and nothing else. If not, someone could exploit your mail form to send whatever mail they want to however many people they want. You should also make sure that error messages are enabled and being reported.ini_set("display_errors", 1);error_reporting(E_ALL); Link to comment Share on other sites More sharing options...
Killcode Posted September 26, 2008 Author Share Posted September 26, 2008 ahhhh,nvm,it was to do with my mail server,it was a free hosting anyway but now i got premium hosting which is even beter and now the mail works , thank you guys anyway Link to comment Share on other sites More sharing options...
Lulzim Posted September 26, 2008 Share Posted September 26, 2008 it's good that it is working now, but don't ignore justsomeguy's recommendationsyou have some serious security holes Link to comment Share on other sites More sharing options...
Killcode Posted December 22, 2008 Author Share Posted December 22, 2008 I wont Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.