I have just been exposed to PHP for a short time, and I am a novice. Now I am stuck and I can’t find a solution online.
Now I want to implement a simple function: use ajax in Html to pass variables to the test2 method in PHP.
---
thinkphp 3.2.3, ajax submission, php function processing
Problem: Unable to read attributes in action
<div> ;
<form id="form1" method="post" action="{:U('Home/Test/Test2')}">
<br>Table Name:<br>
## </form>
</div>
##<script>
function login() {
var Tbname = $( '#Tbna').val();
alert(Tbname);
var url = $(this).attr('action'); //changePassword method under the Index controller
alert(url);
$.ajax({ type:"post", //Submission method
url:url, //Submit address
success ;// 000});// }
}
});
return false;
};
</script>
var url="{:U('Home/Test/Test2')}";
Isn’t this the end?