R00miss
Guest
ОШИБКА...
Привет опять
У меня тут ошибку сервак кидает постоянно - Warning: Failed to Connect in c:\inetpub\rom\postcards\db\mysql.inc.php on line 35 -- и при этом добавляет инфу в ДБ
И еще пишет:
Your postcard was sent:
- Your postcard was sent, using the number: 40
Все делает, а письмо не посылает
Вот сам код, если найдете ошибку, подскажите please, а то я в этом деле не того самого
<?php
//file for inserting data to the mysql database
include("language.inc.php");
$conn = mysql_connect($dbhost,$user,$password);
if($conn){
//selecting table
$conn = mysql_select_db($db, $conn);
//checking email syntax
if(!ereg('.@.{5}', $email[to]) || !ereg('.@.{5}', $email[from])){$allow = "ok"; include("emailerror.inc.php");}else{$check = "ok";}
if(isset($check)){
$comment = eregi_replace("¦"," ",$comment);
$comment = eregi_replace("\n","<br>",htmlentities($comment));
}/*endif*/
//writing data into the table
$insert = "INSERT into $table (emailto, emailfrom, nameto, namefrom, picture, comment, sessionID, seencard)";
$insert .="VALUES ('$email[to]', '$email[from]', '$name[to]', '$name[from]', '$picture',";
$insert .="'$comment', '$sessionID', 'false')";
$result = mysql_query($insert);
if($result){
$cardnumber =mysql_insert_id();
//sending mail
include("language/$language.mail.inc.php");
mail("$name[to] <$email[to]>", "$mailsubject", $mailmessage,
"From:$name[from] <[email protected]>\nReply-To: $email[from]\nX-Mailer: PHP/" . phpversion());
$sendokcheck = "ok";
include("sendok.inc.php");
}else{
echo"<b>".mysql_error($conn);
}/*endif*/
}/*endif*/
mysql_close();
?>
Привет опять
У меня тут ошибку сервак кидает постоянно - Warning: Failed to Connect in c:\inetpub\rom\postcards\db\mysql.inc.php on line 35 -- и при этом добавляет инфу в ДБ
И еще пишет:
Your postcard was sent:
- Your postcard was sent, using the number: 40
Все делает, а письмо не посылает
Вот сам код, если найдете ошибку, подскажите please, а то я в этом деле не того самого
<?php
//file for inserting data to the mysql database
include("language.inc.php");
$conn = mysql_connect($dbhost,$user,$password);
if($conn){
//selecting table
$conn = mysql_select_db($db, $conn);
//checking email syntax
if(!ereg('.@.{5}', $email[to]) || !ereg('.@.{5}', $email[from])){$allow = "ok"; include("emailerror.inc.php");}else{$check = "ok";}
if(isset($check)){
$comment = eregi_replace("¦"," ",$comment);
$comment = eregi_replace("\n","<br>",htmlentities($comment));
}/*endif*/
//writing data into the table
$insert = "INSERT into $table (emailto, emailfrom, nameto, namefrom, picture, comment, sessionID, seencard)";
$insert .="VALUES ('$email[to]', '$email[from]', '$name[to]', '$name[from]', '$picture',";
$insert .="'$comment', '$sessionID', 'false')";
$result = mysql_query($insert);
if($result){
$cardnumber =mysql_insert_id();
//sending mail
include("language/$language.mail.inc.php");
mail("$name[to] <$email[to]>", "$mailsubject", $mailmessage,
"From:$name[from] <[email protected]>\nReply-To: $email[from]\nX-Mailer: PHP/" . phpversion());
$sendokcheck = "ok";
include("sendok.inc.php");
}else{
echo"<b>".mysql_error($conn);
}/*endif*/
}/*endif*/
mysql_close();
?>