Javascript Drupal如何为AJAX表单POST定义页面
我试图通过Ajax发送一个表单,但不知道如何将接收器设置为PHP脚本。当试图传递数据时,我得到404页未找到。我不知道如何定义希望将数据发送到的PHP脚本 我尝试在页面的开头定义脚本路径Javascript Drupal如何为AJAX表单POST定义页面,javascript,php,ajax,drupal,Javascript,Php,Ajax,Drupal,我试图通过Ajax发送一个表单,但不知道如何将接收器设置为PHP脚本。当试图传递数据时,我得到404页未找到。我不知道如何定义希望将数据发送到的PHP脚本 我尝试在页面的开头定义脚本路径 <?php module_load_include('php', 'mysite', 'modules/test/customer'); ?> HTML表单 <table> <tr><th align="LEFT"><b>
<?php
module_load_include('php', 'mysite', 'modules/test/customer');
?>
HTML表单
<table>
<tr><th align="LEFT"><b><i>Cu data</b></i></th></tr>
<form action="modules/test/customer.php" method="post">
<div class='cu'>
<tr><td>Mav ID: <input type="text" name="mav_id"></td>
<td>sku: <input type="text" name="sku1"></td>
<tr> <td><input type="submit" value="Submit"></td> </tr>
铜数据
Mav ID:
sku:
我仍然得到这个错误:
找不到您请求的站点“/node/modules/test/customer.php
如何删除节点部分并获取脚本以将数据发送到正确的地址?删除下面的代码表单页回调函数
module_load_include('php', 'mysite', 'modules/test/customer');
并将其添加到hook\u init
它会解决你的问题
module_load_include('php', 'mysite', 'modules/test/customer');