Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Server errors, please help
Old 10-21-2008, 11:41 AM Server errors, please help
Skilled Talker

Posts: 60
Trades: 0
I wonder if somebody can help me please. I've got a database were people add their email addresses and a random number. I've got a cron (to run every minute while I'm testing it) to email the email addresses depending on what number they're entered. In general it works but I keep on getting this email from the server log:

Quote:
This is the mail system at host localhost.mydomain.com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to <postmaster>

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<1@localhost. mydomain.com> (expanded from <1>): unknown user: "1"
Section: 2 Keywords: 7bit - 1 k

Reporting-MTA: dns; localhost.mydomain.com
X-Postfix-Queue-ID: 9105E101D73
X-Postfix-Sender: rfc822; root@localhost.mydomain.com
Arrival-Date: Tue, 21 Oct 2008 16:26:01 +0100 (BST)

Final-Recipient: rfc822; 1@localhost.mydomain.com
Original-Recipient: rfc822; 1
Action: failed
Status: 5.1.1
Diagnostic-Code: X-Postfix; unknown user: "1"


Section: 3.1 Keywords: plain 7bit - 1 k

The number you selected is shared with at least one other person.
The cron file is:

PHP Code:
<?php
error_reporting
(E_ALL E_NOTICE);

$headers 'From:  info@mydomain.com' "\r\n" .
    
'Reply-To:  info@ mydomain.com';

$con mysql_connect("hostname","username","password");
$first TRUE;

mysql_select_db("dbname"$con);
$result mysql_query("SELECT * FROM table");
while (
$row mysql_fetch_row($result))
{
  
$email $row['1']; 
  
$number $row['2']; 
  
$resultnr mysql_query("SELECT * FROM table WHERE number= " .$number);
 
$count mysql_num_rows($resultnr);

if (
$count == 1
    {
      
mail($email"Your number is unique""Congratulations the number you have entered is unquie number"$headers); 

     if (
$first)
      {
        
$lowest $number;
        
$first FALSE;
      }
    else
     {
        if (
$number $lowest)
          {
            
$lowest $number;
          } 
     }
  }
   else
  {
     
mail($email"You share your number""The number you selected is shared with at least one other person."$headers); 
  }

}

$result mysql_query("SELECT * FROM table WHERE number =".$lowest);
$row mysql_fetch_row($result);
$email $row['1'];
mail($email"You have the lowest unquie number""Congratulations you have entered the lowest unquie number"$headers);
mysql_close($con);
?>
The only fields in the database are ID, email and number, but I'm not sure why. I keep on getting these emails (every minute) so would be grateful for any help please.

Thanks
thehappyappy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-21-2008, 02:19 PM Re: Server errors, please help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You are sending emails to non-existent users
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-22-2008, 05:05 AM Re: Server errors, please help
Skilled Talker

Posts: 60
Trades: 0
Sorry there's nothing wrong with the code and if I remove:
PHP Code:
error_reporting(E_ALL E_NOTICE); 
I'll stop getting the emails?
thehappyappy is offline
Reply With Quote
View Public Profile
 
Old 10-23-2008, 04:28 AM Re: Server errors, please help
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
No you won't.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 10-23-2008, 06:16 AM Re: Server errors, please help
Skilled Talker

Posts: 60
Trades: 0
So the server will just send them anyway? Should I leave that bit in then? Also is the code okay then (ie it'll work okay) or does it contain errors?
thehappyappy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Server errors, please help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20981 seconds with 12 queries