mattm1712 Posted April 27, 2010 Share Posted April 27, 2010 this is my script, <?php include 'connect.inc'; $result4 = mysql_query("SELECT * FROM comments JOIN users on comments.submittedby=users.name WHERE comments.id=$t"); while($row = mysql_fetch_assoc($result4)); { $to = $row['email']; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); } ?> and my tables are users ------------------------------------------------------ name | email | pass | location and comments ------------------------------------------------------ submittedby | title | id | comment i cant see y its wrong Quote Link to comment https://forums.phpfreaks.com/topic/199948-i-cant-understand-y-this-is-not-working-can-any1-help-plz/ Share on other sites More sharing options...
de.monkeyz Posted April 27, 2010 Share Posted April 27, 2010 Where's $t defined? Quote Link to comment https://forums.phpfreaks.com/topic/199948-i-cant-understand-y-this-is-not-working-can-any1-help-plz/#findComment-1049450 Share on other sites More sharing options...
mikesta707 Posted April 27, 2010 Share Posted April 27, 2010 A little advice when asking questions: You need to clearly state the problem. Saying "OMG SOMETHINGS WRONG" won't get your question answered. You need to think about whats happening, and actual say what's going wrong. What is actually happening, and how is that different from what you expect to/want to happen? Were there any errors? Was the page completely blank? Do you have error reporting turned on? if not adding error_reporting(E_ALL); ini_set("display_errors", 1); to the top of your script will turn it on. also, put code in code tags Quote Link to comment https://forums.phpfreaks.com/topic/199948-i-cant-understand-y-this-is-not-working-can-any1-help-plz/#findComment-1049453 Share on other sites More sharing options...
mattm1712 Posted April 27, 2010 Author Share Posted April 27, 2010 $t is defined in my index page will try the error thing Quote Link to comment https://forums.phpfreaks.com/topic/199948-i-cant-understand-y-this-is-not-working-can-any1-help-plz/#findComment-1049455 Share on other sites More sharing options...
mattm1712 Posted April 27, 2010 Author Share Posted April 27, 2010 i have switched error reporting on it says, Use of undefined constant localhost - assumed 'localhost' in /home/sites/moseleyengineering.co.uk/public_html/matt/connect.inc on line 6 No recipient addresses found in header Quote Link to comment https://forums.phpfreaks.com/topic/199948-i-cant-understand-y-this-is-not-working-can-any1-help-plz/#findComment-1049472 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.