una vez solucionado el que al cliente le llegue el correo diciendo que lo envio [email protected] ahora veo que el propietario de la tienda le llega el mismo correo pero con la direccion del servidor unos numeros y claves ¿como podria solucionarlo? he probado muchas cosas pero nada se estropea todo de php ni papa.
gracias de antemano
Código PHP:
<?php
session_start();
$memid=$_SESSION['memid'];
include("conn.php");
$link = @mysql_connect($dbHost, $dbUser, $dbPass);
//if connection unsuccessful...
if (!$link){
//output error info and exit
print "errorText=" . urlencode("Error connecting to database server.");
exit;
} else {
//After connecting, we need to select the DB.
if (@mysql_select_db($dbName)){
?>
Código PHP:
<?php
$query3 = "SELECT * FROM cat ORDER BY cunt ASC;";
$result3 = @mysql_query($query3);
while ($row3 = mysql_fetch_array($result3)){
$cat=$row3['cat'];
$cat = str_replace(chr(192), 'À', $cat);
$cat = str_replace(chr(193), 'Á', $cat);
$cat = str_replace(chr(225), 'à', $cat);
$cat = str_replace(chr(226), 'á', $cat);
// é É
$cat = str_replace(chr(200), 'È', $cat);
$cat = str_replace(chr(201), 'É', $cat);
$cat = str_replace(chr(232), 'è', $cat);
$cat = str_replace(chr(233), 'é', $cat);
// í Í
$cat = str_replace(chr(204), 'Ì', $cat);
$cat = str_replace(chr(205), 'Í', $cat);
$cat = str_replace(chr(236), 'ì', $cat);
$cat = str_replace(chr(237), 'í', $cat);
// ñ Ñ
$cat = str_replace(chr(209), 'Ñ', $cat);
$cat = str_replace(chr(241), 'ñ', $cat);
//ó Ó
$cat = str_replace(chr(242), 'ò', $cat);
$cat = str_replace(chr(243), 'ó', $cat);
$cat = str_replace(chr(210), 'Ò', $cat);
$cat = str_replace(chr(211), 'Ó', $cat);
$cat_id=$row3['id'];
echo "<a href=http://www.rosastiendaonline.com/tiendas.php?cat_id=".$cat_id."><span class='style8'>".$cat."</span></a><br>";
$query3a = "SELECT * FROM sub_cat WHERE cat_id='".$cat_id."' ORDER BY cunt ASC;";
$result3a = @mysql_query($query3a);
echo "<ul class='style2'>";
while ($row3a = mysql_fetch_array($result3a)){
$sub_cat=$row3a['sub_cat'];
// á Á
$sub_cat = str_replace(chr(192), 'À', $sub_cat);
$sub_cat = str_replace(chr(193), 'Á', $sub_cat);
$sub_cat = str_replace(chr(225), 'à', $sub_cat);
$sub_cat = str_replace(chr(226), 'á', $sub_cat);
// é É
$sub_cat = str_replace(chr(200), 'È', $sub_cat);
$sub_cat = str_replace(chr(201), 'É', $sub_cat);
$sub_cat = str_replace(chr(232), 'è', $sub_cat);
$sub_cat = str_replace(chr(233), 'é', $sub_cat);
// í Í
$sub_cat = str_replace(chr(204), 'Ì', $sub_cat);
$sub_cat = str_replace(chr(205), 'Í', $sub_cat);
$sub_cat = str_replace(chr(236), 'ì', $sub_cat);
$sub_cat = str_replace(chr(237), 'í', $sub_cat);
// ñ Ñ
$sub_cat = str_replace(chr(209), 'Ñ', $sub_cat);
$sub_cat = str_replace(chr(241), 'ñ', $sub_cat);
//ó Ó
$sub_cat = str_replace(chr(242), 'ò', $sub_cat);
$sub_cat = str_replace(chr(243), 'ó', $sub_cat);
$sub_cat = str_replace(chr(210), 'Ò', $sub_cat);
$sub_cat = str_replace(chr(211), 'Ó', $sub_cat);
$sub_id=$row3a['id'];
echo "<li><a href=http://www.rosastiendaonline.com/tiendas.php?cat_id=".$cat_id."&&sub_id=".$sub_id." >".$sub_cat."</a></li>";
}
echo "</ul>";
}
?>
Código PHP:
<?=$fname." ".$sname;?></p>
<p>
<?php
$memid=$_POST["memid"];
$query = "SELECT * FROM members WHERE id='".$memid."';";
//execute query.
$result = @mysql_query($query);
//loop through result
$row = mysql_fetch_array($result);
$Sex = $row["Sex"];
$fname = $row["fname"];
$sname = $row["sname"];
$dob = $row["dob"];
$cemail = $row["cemail"];
$addr = $row["addr"];
$pocode = $row["pocode"];
$town = $row["town"];
$province = $row["province"];
$country = $row["country"];
$htel = $row["htel"];
$fax = $row["fax"];
$newsletter = $row["newsletter"];
//invoice number creation
if ($country!="ES") {
}else{
$country="España";
}
$query_prov = "SELECT * FROM provs WHERE id='".$province."';";
//execute query.
$result_prov = @mysql_query($query_prov);
//loop through result
$row_prov = mysql_fetch_array($result_prov);
$province = $row_prov["cprov"];
$query_inv = "SELECT * FROM ros_orders ORDER BY inv_no ASC;";
$result_inv = @mysql_query($query_inv);
while ($row_inv = mysql_fetch_array($result_inv)){
$inv_no=$row_inv["inv_no"];
}
$inv_no=$inv_no+1;
//email client
$query_shopv = "SELECT * FROM ros_orders WHERE mem_id='".$memid."' AND order_status='1';";
$result_shopv = @mysql_query($query_shopv);
while ($row_shopv = mysql_fetch_array($result_shopv)){
$ord_id=$row_shopv["id"];
mysql_query("UPDATE ros_orders SET inv_no='".$inv_no."', order_status='3' WHERE id='".$ord_id."';" , $link);
}
// $to="[email protected]";
$to="[email protected]";
//list order
$message = "";
$message .= "Número de pedido:".$inv_no;
$message .= "\n";
$tot_price=0;
$query_shop = "SELECT * FROM ros_orders WHERE mem_id='".$memid."' AND inv_no='".$inv_no."';";
$result_shop = @mysql_query($query_shop);
while ($row_shop = mysql_fetch_array($result_shop)){
$item_size=$row_shop["item_size"];
$it_price1=$row_shop["it_price"];
$it_amount=$row_shop["it_amount"];
$it_price=$it_price1*$it_amount;
$it_id=$row_shop["it_id"];
$ord_id=$row_shop["id"];
$query_shop2 = "SELECT * FROM cat_items WHERE id='".$it_id."';";
$result_shop2 = @mysql_query($query_shop2);
$row_shop2 = mysql_fetch_array($result_shop2);
$item_name=$row_shop2["item_name"];
$item_id=$row_shop2["id"];
$code=$row_shop2["code"];
$cat_id=$row_shop2["cat_id"];
// $query33ii = "SELECT * FROM item_pics WHERE item_id='".$item_id."' ORDER BY id ASC;";
// $result33ii = @mysql_query($query33ii);
// $row33ii = mysql_fetch_array($result33ii);
// $pic=$row33ii['pic'];
// $message .= "<tr><td><table width='315' border='0' cellspacing='2' cellpadding='2'><tr><td width='145' align='left' valign='top'><img src='http://www.rosastiendaonline.com/media/webpics/thumb/".$pic."' border='0' /></td>";
//$message .= " <td width='170' align='left' valign='top'><span class='style7'><a href='http://www.rosastiendaonline.com/tiendas.php?cat_id=".$cat_id."&&item_id=".$it_id." ' style='text-decoration:none; color:#000000;'><strong>";
$message .= $item_name." ".$code;
// $message .= "</strong></a></span></td></tr></table></td>";
$message .= " x ".$it_amount." Talla ".$item_size." = ".$it_price." Euros\n";
$tot_price=$tot_price+$it_price;
}
// delivery charges
if ($province!=33) {
$charge=10;
}else{
$charge=12;
}
$message .= "Gastos de envio:".$charge." Euros\n";
$tot_price=$charge+$tot_price;
$message .= "Total:".$tot_price." Euros\n";
$message .= $addr;
if ($country!="ES") {
}else{
$country="España";
}
$query_prov = "SELECT * FROM provs WHERE id='".$province."';";
//execute query.
$result_prov = @mysql_query($query_prov);
//loop through result
$row_prov = mysql_fetch_array($result_prov);
$province = $row_prov["cprov"];
$message .= "\n";
$message .= $pocode;
$message .= "\n";
$message .= $town;
$message .= "\n";
$message .= $province;
$message .= "\n";
$message .= $country;
$message .= "\n";
$message .= $htel;
//$message .= "\nCuando hayamos confirmado la transferencia su pedido será enviado";
$subject="Contra reembolsa por ".$fname." ".$sname." Tel:".$htel;
$headers = "From: " . $cemail . "\r\n";
$headers .= "Reply-To: ". strip_tags($to) . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
mail($to, $subject, $message);
$subject2="Rosas Tiendas Online pedido #".$inv_no;
$message .= "\nGracias por compra en Rosastiendas online.";
$headers = "From: Tu nombre aqui <[email protected]>\r\n";
mail($cemail, $subject2, $message, $headers);
//echo $message;
echo "Número de pedido:".$inv_no;
//echo "<br> Cuando hayamos confirmado la transferencia su pedido será enviado.";
?>
Código PHP:
<?php
} else {
//inform of db selection failure
print "errorText=" . "Couldn't select database.";
exit;
}
//close the connection
mysql_close($link);
}
?>
gracias de antemano y un salu2.