Jump to content

Recommended Posts

Hi again, back so soon! I put a else die on the end of my connecting to DB.. so I am 99% sure that isn't my problem here. No information is being placed in the database and no email is being sent out. Any ideas on why not?

 

<?php
session_start();
header("Cache-control: private");

if (isset ($_POST['submit'])) {
$problem = FALSE;



if (empty ($_POST['plantloc'])) {
$problem = TRUE;
$error .= 'Must enter a plant location<br />';
}







mysql_connect("*","*","*");
mysql_select_db("*");


if (!$problem) {

$plantloc  = $_POST['plantloc'];

$length = 6;
$password = "";
$possible = "0123456789bcdfghjkmnpqrstvwxyz"; 
$i = 0; 
    
while ($i < $length) { 
    $char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
    if (!strstr($password, $char)) { 
      $password .= $char;
      $i++;
    }

  }

$password2 = md5($_POST['password1']);
$address = $_POST['address'];


$result = MYSQL_QUERY("INSERT INTO plants (plantloc,password,address)".
"VALUES ('$plantloc, '$password2', '$address,')");


$sendmail = "
$password2
";

mail ('tcantwell@berryequipment.net', 'Thank You', $sendmail, 'From: aebstract@gmail.com');



} else {
$content .= "$error";
}
}
?>

Put a mysql_error after your Query

 

$result = MYSQL_QUERY("INSERT INTO plants (plantloc,password,address)".

"VALUES ('$plantloc, '$password2', '$address,')") or die (mysql_error());

 

It should reveal a error since you forgot a ' after $plantloc and you have a comma after $address

Alright I called in because I looked at my error log and had nothing dealing with mail in it. Couldn't find my php.ini file so he placed one in my html directory. I don't know anything about the php.ini file so I have no clue how to find what I need or check what it should be. He did a simple one line mail function test and said it was working so it may be my syntax?

I didn't get connected to the same tech. but the guy I talked to had me go run a command line: "telnet berryequipment.net 25" which showed the result of:

 

220 hs25.order-vault.net ESMTP Sendmail 8.11.6/8.11.6; Thu, 17 Jan 2008 12:27:00

-0500

I'm back on the phone right now, will ask and I found this in my php.ini:

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = me@localhost.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i

 

I'm thinking it may be wrong "me@localhost.com" and I'm on a .net domain. So maybe it isn't sending out correctly? I'll come back with another update soon.

Got this problem solved. It turns out that the fact that we have our email server and web server set up on two different servers/accounts I had to get him to fix some settings on their end for it to actually send out. Thanks for the help and sorry for the bother!

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.