Results 1 to 10 of 10
  1. #1
    Animal Lover
    Join Date
    January 18th, 2005
    Location
    oz
    Posts
    1,210
    I've been looking at this for hours and can't figure out why it's not working for me - the code seems okay. It's to send passwords back to people who've forgotten.

    <?php

    $id=$HTTP_POST_VARS['id'];

    $dbh=mysql_connect ("localhost", "user", "password") or die ('I cannot connect to the database because: ' . mysql_error());
    mysql_select_db ("database");

    $sqllost="SELECT * FROM details WHERE id='$id'";
    $querylost=mysql_query($sqllost);
    $fetchlost=mysql_fetch_array($querylost);

    $email=$fetchlost['email'];
    $password=$fetchlost['password'];

    $to=$email;
    $subject='password retrieval';
    $mailcontent='Your unique id number : '.$id."\n"
    .'Your password : '.$password."\n";
    $fromaddress='From: webmaster@mydomain.com';
    mail ($to,$subject,$mailcontent,$fromaddress);

    echo "<p align='center'><font face='Verdana' color='black' size='2'>Your password has been sent</font></p>";

    ?>

    Can anyone shed light on this?

    Oscar
    My DataFeed Scripts - php datafeed scripts for your site
    Shareasale datafeed scripts - to display Shareasale datafeeds
    Linkshare datafeed scripts - for multiple Linkshare merchants

  2. #2
    Animal Lover
    Join Date
    January 18th, 2005
    Location
    oz
    Posts
    1,210
    PS I get this error and the email bounces back

    This message was created automatically by mail delivery software.

    A message that you sent could not be delivered to one or more of its
    recipients. This is a permanent error. The following address(es) failed:

    me@anotherdomain.com
    unrouteable mail domain "anotherdomain.com"

    ------ This is a copy of the message, including all the headers. ------
    My DataFeed Scripts - php datafeed scripts for your site
    Shareasale datafeed scripts - to display Shareasale datafeeds
    Linkshare datafeed scripts - for multiple Linkshare merchants

  3. #3
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    I looks like you're trying to send email to an invalid email address. The server's just telling you that me@anotherdomain.com is invalid. Are you using real email addresses?
    Hatred stirs up strife, But love covers all transgressions.

  4. #4
    Animal Lover
    Join Date
    January 18th, 2005
    Location
    oz
    Posts
    1,210
    Yes. The to email address is to me at another site (the email address exists) - I'm in testing mode at the moment...so I don't know why it doesn't work...This site is on a new host though. I've tried the script on my old server and it works fine...I am trying to see if tech support will help me out...they keep telling me that the script should run fine. The thing is - I tried using the support email button on my cpanel and that email to them bounced too, so something isn't right.

    I just don't know what it is.

    Oscar
    My DataFeed Scripts - php datafeed scripts for your site
    Shareasale datafeed scripts - to display Shareasale datafeeds
    Linkshare datafeed scripts - for multiple Linkshare merchants

  5. #5
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    Must be a server problem then, let tech support handle it.
    Hatred stirs up strife, But love covers all transgressions.

  6. #6
    Animal Lover
    Join Date
    January 18th, 2005
    Location
    oz
    Posts
    1,210
    Thanks for the support anyway Snib - I've been banging my head on this all afternoon (and night) - doesn't help when tech support keep telling me it's my problem.

    Oscar
    My DataFeed Scripts - php datafeed scripts for your site
    Shareasale datafeed scripts - to display Shareasale datafeeds
    Linkshare datafeed scripts - for multiple Linkshare merchants

  7. #7
    ABW Ambassador Jane's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,350
    Don't know if it applies in your case but many hosts do not allow use of the standard formmail script anymore for security reasons.

  8. #8
    Animal Lover
    Join Date
    January 18th, 2005
    Location
    oz
    Posts
    1,210
    Hi Jane,

    No it's not a standard formmail script - it's my own.

    According to the host it could be a domain propagation thing - I've only just joined up with them and it's been about 3 days...I can get into the site okay from my browser so I would've thought that it had propagated okay...

    still working with them.

    Oscar
    My DataFeed Scripts - php datafeed scripts for your site
    Shareasale datafeed scripts - to display Shareasale datafeeds
    Linkshare datafeed scripts - for multiple Linkshare merchants

  9. #9
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    One good way to test this would be to log into your new hosts shell account and type "host newdomain.com" to see if it resolves correctly. If you don't have shell access, maybe try running a php server("host newdomain") command.

    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  10. #10
    Animal Lover
    Join Date
    January 18th, 2005
    Location
    oz
    Posts
    1,210
    It's working now - so I'm assuming that it was a propagating thing that needed time to resolve - I haven't changed the script at all. I came in too late to try your suggestion Snib - thanks anyway.

    Oscar
    My DataFeed Scripts - php datafeed scripts for your site
    Shareasale datafeed scripts - to display Shareasale datafeeds
    Linkshare datafeed scripts - for multiple Linkshare merchants

  11. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. PHP Function
    By Doug247 in forum Programming / Datafeeds / Tools
    Replies: 31
    Last Post: May 23rd, 2008, 03:53 AM
  2. Email address ina SQL database... How to send out mass email?
    By jackson_media in forum Programming / Datafeeds / Tools
    Replies: 4
    Last Post: February 12th, 2006, 04:54 PM
  3. PHP search function help
    By Affiliate Ian in forum Programming / Datafeeds / Tools
    Replies: 8
    Last Post: December 16th, 2003, 09:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •