cuốn sách gpt4 ai đã làm

php - 在脚本中使用 php

In lại Tác giả: Walker 123 更新时间:2023-11-28 15:59:26 hai mươi bốn 4
mua khóa gpt4 Nike

我正在编写一个程序,需要在脚本中添加 php 代码

html 有一个表格,其中有 2 个选择框,我想在用户更改第一个选择框时更新第二个选择框

$('.chzn-select').chosen().change(function() {
var a = $(this).attr('data-id');
var ord = $(this).val();

if (a == 'ord') //Check if first select box is changed
{
var itemcode = $(this).parent().parent().find('[data-id="item"]'); //find second select from same row

//add items from order
$ord = ''; //javascript variable to php variable

//This code is not working, if I update the php variable from javascript variable
mysql_query('select * from ords where ord_id = '.$ord.');
?>
$(itemcode).append('');


$(".chzn-select").trigger("liszt:updated");
}

});

Có ý tưởng gì không?

câu trả lời hay nhất

您可以尝试使用 jQuery 加载函数发送变量。

page1.html:




page2.php:

    $ord = $_GET['ord'];
mysql_query('select * from ords where ord_id = '.$ord);
?>

关于php - 在脚本中使用 php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17501125/

hai mươi bốn 4 0
Xem sitemap của VNExpress