ali586
پنج شنبه 17 مهر 1399, 17:52 عصر
سلام به تمام اعضای فروم
من یه چند روزی هست با مشکل عجب بر خوردم و کلی سرچ کردم و کلی هم با کد کار کردم ولی باز مشکل حل نشده .
مشکل این هست که نام و نام خانوادگی درست ذخیره میشه ولی آدرس و ایمیل و نوع پرداخت 0 ذخیره میشه با اینکه نوع فیلد رو هم varchar قرار دادم. utf-8 در دیتابیس و کد رعایت کردم.
کد های بخش php را براتون میذارم اگه متوجه مشکل شدین لطفا راهنمایی کنید
کد های php
if ($_SERVER["REQUEST_METHOD"] == "POST"){
$malicode = test_input($_POST["malicode"]);
$sabtenam = "1";
$noez = test_input($_POST["noez"]);
$shsh = test_input($_POST["shsh"]);
$comtyear = test_input($_POST["comtyear"]);
$comtmonth = test_input($_POST["comtmonth"]);
$comtday = test_input($_POST["comtday"]);
$fname = test_input($_POST["fname"]);
$lname = test_input($_POST["lname"]);
$faname = test_input($_POST["faname"]);
$statee = test_input($_POST["statee"]);
$sarbaz = test_input($_POST["sarbaz"]);
$comayear = test_input($_POST["comayear"]);
$comamonth = test_input($_POST["comamonth"]);
$comaday = test_input($_POST["comaday"]);
$isar = test_input($_POST["isar"]);
$adres = test_input($_POST["adres"]);
$state = test_input($_POST["state"]);
$city = test_input($_POST["city"]);
$codepost = test_input($_POST["codepost"]);
$malifcode = test_input($_POST["malifcode"]);
$tell = test_input($_POST["tell"]);
$mobi = test_input($_POST["mobi"]);
$email = test_input($_POST["email"]);
$pay = test_input($_POST["pay"]);
$bank1 = test_input($_POST["bank1"]);
$bank2 = test_input($_POST["bank2"]);
$bank3 = test_input($_POST["bank3"]);
$bank4 = test_input($_POST["bank4"]);
$bank5 = test_input($_POST["bank5"]);
$shobe1 = test_input($_POST["shobe1"]);
$shobe2 = test_input($_POST["shobe2"]);
$shobe3 = test_input($_POST["shobe3"]);
$shobe4 = test_input($_POST["shobe4"]);
$shobe5 = test_input($_POST["shobe5"]);
$tpay = test_input($_POST["tpay"]);
$mpay = test_input($_POST["mpay"]);
$dpay = test_input($_POST["dpay"]);
$TTpayy = test_input($_POST["TTpayy"]);
$ddpayy = test_input($_POST["ddpayy"]);
$shkart = test_input($_POST["shkart"]);
if(empty($malicode) || empty($shsh) || empty($comtyear) || empty($comtmonth) || empty($comtday) || empty($fname) || empty($lname) || empty($faname) || empty($comayear) || empty($comamonth) || empty($comaday) || empty($adres) || empty($state) || empty($city) || empty($mobi)){
$msg = "لطفا گزینه های الزامی را پر کنید";
} else {
if(!empty($_POST["pay"])){
try{
if($_POST["pay"] == "پرداخت آنلاین"){
$stmt=$conn->prepare("INSERT INTO tbl_register (malicode,sabtenam,noez,shsh,comtyear,comtmonth,co mtday,fname,lname,faname,statee,sarbaz,comayear,co mamonth,comaday,isar,adres,state,city,codepost,mal ifcode,tell,mobi,email,pay) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param('ssssssssssssiiiiiiiiiiiii',$malicode,$ sabtenam,$noez,$shsh,$comtyear,$comtmonth,$comtday ,$fname,$lname,$faname,$statee,$sarbaz,$comayear,$ comamonth,$comaday,$isar,$adres,$state,$city,$code post,$malifcode,$tell,$mobi,$email,$pay);
if ($stmt->execute()){
echo $pay;
echo $adres;
echo $email;
echo "sabt shod";
}else{
echo "nooooooo";
}
$stmt->close();
//header("location:/Panel/pay-ir/send.php");
} else {
echo "کارت به کارت";
}
} catch (Exception $ex) {
print_r($ex);
}
}
}
}
عکس از دیتابیس
152306
من یه چند روزی هست با مشکل عجب بر خوردم و کلی سرچ کردم و کلی هم با کد کار کردم ولی باز مشکل حل نشده .
مشکل این هست که نام و نام خانوادگی درست ذخیره میشه ولی آدرس و ایمیل و نوع پرداخت 0 ذخیره میشه با اینکه نوع فیلد رو هم varchar قرار دادم. utf-8 در دیتابیس و کد رعایت کردم.
کد های بخش php را براتون میذارم اگه متوجه مشکل شدین لطفا راهنمایی کنید
کد های php
if ($_SERVER["REQUEST_METHOD"] == "POST"){
$malicode = test_input($_POST["malicode"]);
$sabtenam = "1";
$noez = test_input($_POST["noez"]);
$shsh = test_input($_POST["shsh"]);
$comtyear = test_input($_POST["comtyear"]);
$comtmonth = test_input($_POST["comtmonth"]);
$comtday = test_input($_POST["comtday"]);
$fname = test_input($_POST["fname"]);
$lname = test_input($_POST["lname"]);
$faname = test_input($_POST["faname"]);
$statee = test_input($_POST["statee"]);
$sarbaz = test_input($_POST["sarbaz"]);
$comayear = test_input($_POST["comayear"]);
$comamonth = test_input($_POST["comamonth"]);
$comaday = test_input($_POST["comaday"]);
$isar = test_input($_POST["isar"]);
$adres = test_input($_POST["adres"]);
$state = test_input($_POST["state"]);
$city = test_input($_POST["city"]);
$codepost = test_input($_POST["codepost"]);
$malifcode = test_input($_POST["malifcode"]);
$tell = test_input($_POST["tell"]);
$mobi = test_input($_POST["mobi"]);
$email = test_input($_POST["email"]);
$pay = test_input($_POST["pay"]);
$bank1 = test_input($_POST["bank1"]);
$bank2 = test_input($_POST["bank2"]);
$bank3 = test_input($_POST["bank3"]);
$bank4 = test_input($_POST["bank4"]);
$bank5 = test_input($_POST["bank5"]);
$shobe1 = test_input($_POST["shobe1"]);
$shobe2 = test_input($_POST["shobe2"]);
$shobe3 = test_input($_POST["shobe3"]);
$shobe4 = test_input($_POST["shobe4"]);
$shobe5 = test_input($_POST["shobe5"]);
$tpay = test_input($_POST["tpay"]);
$mpay = test_input($_POST["mpay"]);
$dpay = test_input($_POST["dpay"]);
$TTpayy = test_input($_POST["TTpayy"]);
$ddpayy = test_input($_POST["ddpayy"]);
$shkart = test_input($_POST["shkart"]);
if(empty($malicode) || empty($shsh) || empty($comtyear) || empty($comtmonth) || empty($comtday) || empty($fname) || empty($lname) || empty($faname) || empty($comayear) || empty($comamonth) || empty($comaday) || empty($adres) || empty($state) || empty($city) || empty($mobi)){
$msg = "لطفا گزینه های الزامی را پر کنید";
} else {
if(!empty($_POST["pay"])){
try{
if($_POST["pay"] == "پرداخت آنلاین"){
$stmt=$conn->prepare("INSERT INTO tbl_register (malicode,sabtenam,noez,shsh,comtyear,comtmonth,co mtday,fname,lname,faname,statee,sarbaz,comayear,co mamonth,comaday,isar,adres,state,city,codepost,mal ifcode,tell,mobi,email,pay) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param('ssssssssssssiiiiiiiiiiiii',$malicode,$ sabtenam,$noez,$shsh,$comtyear,$comtmonth,$comtday ,$fname,$lname,$faname,$statee,$sarbaz,$comayear,$ comamonth,$comaday,$isar,$adres,$state,$city,$code post,$malifcode,$tell,$mobi,$email,$pay);
if ($stmt->execute()){
echo $pay;
echo $adres;
echo $email;
echo "sabt shod";
}else{
echo "nooooooo";
}
$stmt->close();
//header("location:/Panel/pay-ir/send.php");
} else {
echo "کارت به کارت";
}
} catch (Exception $ex) {
print_r($ex);
}
}
}
}
عکس از دیتابیس
152306