dịch -  Việt làm thế nào để nói

0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
session_start();include_once("connect.php");//add product to session or create new oneif(isset($_POST["type"]) && $_POST["type"]=='add' && $_POST["product_qty"]>0){ foreach($_POST as $key => $value){ //add all post vars to new_product array $new_product[$key] = filter_var($value, FILTER_SANITIZE_STRING); } //remove unecessary vars unset($new_product['type']); unset($new_product['return_url']); //we need to get product name and price from database. $product_code = $new_product["product_code"]; $query = "SELECT product_name, price FROM products WHERE product_code='$product_code' LIMIT 1"; //echo $query; $result = mysqli_query($con,$query) or die("LOI: ".mysqli_error($con)); while($row=mysqli_fetch_array($result,MYSQLI_ASSOC)){ //fetch product name, price from db and add to new_product array $new_product["product_name"] = $row["product_name"]; $new_product["product_price"] = $row["price"]; if(isset($_SESSION["cart_products"])){ //if session var already exist //check item exist in products array if(isset($_SESSION["cart_products"][$new_product['product_code']])) { //unset old array item unset($_SESSION["cart_products"][$new_product['product_code']]); } } $_SESSION["cart_products"][$new_product['product_code']] = $new_product; //update or create product session with new item } //var_dump($_SESSION["cart_products"]) ; }//update or remove items if(isset($_POST["product_qty"]) || isset($_POST["remove_code"])){ //update item quantity in product session if(isset($_POST["product_qty"]) && is_array($_POST["product_qty"])){ foreach($_POST["product_qty"] as $key => $value){ if(is_numeric($value)){ $_SESSION["cart_products"][$key]["product_qty"] = $value; } } } //remove an item from product session if(isset($_POST["remove_code"]) && is_array($_POST["remove_code"])){ foreach($_POST["remove_code"] as $key){ unset($_SESSION["cart_products"][$key]); } }}//back to return url$return_url = (isset($_POST["return_url"]))?urldecode($_POST["return_url"]):''; //return urlheader('Location:'.$return_url);?>
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
session_start ();
include_once ("connect.php"); // thêm sản phẩm cho phiên hoặc tạo mới nếu (isset ($ _ POST ["loại"]) && $ _POST ["loại"] == 'thêm' && $ _POST ["product_qty"]> 0) {foreach ($ _ POST là $ key => $ value) {// thêm tất cả các bài vars để new_product mảng $ new_product [$ key] = filter_var ($ value, FILTER_SANITIZE_STRING);} // loại bỏ hưởng ứng nhiệt liệt vars unset ($ new_product ['type']); unset ($ new_product ['return_url']); //. chúng ta cần phải có được tên sản phẩm và giá cả từ cơ sở dữ liệu $ product_code = $ new_product ["product_code"]; $ query = "SELECT product_name, giá TỪ sản phẩm ĐÂU product_code = '$ product_code' LIMIT 1"; // echo $ query; $ result = mysqli_query ($ con, $ query) or die ("LOI:" .mysqli_error ($ con) ); while ($ row = mysqli_fetch_array ($ result, MYSQLI_ASSOC)) {// lấy tên sản phẩm, giá từ db và thêm vào new_product mảng $ new_product ["product_name"] = $ row ["product_name"]; $ new_product [" product_price "] = $ row [" giá "]; if (isset ($ _ SESSION [" cart_products "])) {// nếu phiên var đã tồn tại // kiểm tra hàng tồn tại trong mảng sản phẩm if (isset ($ _ SESSION [" cart_products "] [$ new_product ['product_code']])) {// mảng cũ unset = $ New_product; // cập nhật hoặc tạo ra sản phẩm với phiên item mới} // var_dump ($ _ SESSION ["cart_products"]);} // cập nhật hoặc xoá các mục if (isset ($ _ POST ["product_qty"]) || isset ($ _ POST [ "remove_code"])) {// số lượng mục cập nhật trong phiên giao dịch sản phẩm if (isset ($ _ POST ["product_qty"]) && is_array ($ _ POST ["product_qty"])) {foreach ($ _ POST ["product_qty"] như $ key => $ value) {if (is_numeric ($ value)) {$ _SESSION ["cart_products"] [$ key] ["product_qty"] = $ value;}}} // loại bỏ một mục từ phiên sản phẩm if ( isset ($ _ POST ["remove_code"]) && is_array ($ _ POST ["remove_code"])) {foreach ($ _ POST ["remove_code"] là $ key) {unset ($ _ SESSION ["cart_products"] [$ key] );}}} // quay lại để trở url $ return_url = (isset ($ _ POST ["return_url"])) urldecode ($ _ POST ["return_url"]): ''; // trả về url header ('Vị trí:'. $ return_url);?>



























































đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2025 I Love Translation. All reserved.

E-mail: