Jump to content

Recommended Posts

 

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

 

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

 

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

 

 

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.