Tip: you can modify some code before running
Js dynamic modification from form action method<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>Js dynamic modification from form action method</title></head><body><form action="" name="myform"><input name="a" type="button" value="设置post方法" onclick="doSubmit('?aa=1','get');"/><input name="b" type="button" value="设置get方法" onclick="doSubmit('?aa=2','post');"/></form></body><script language="javascript">Function doSubmit (url, method) {document. myform. method = method; document. myform. action = url; document. myform. submit ();}</script><?phpif( $_GET){echo '调整为get方法';}else{echo '调整为post';}?></html>The first station of the Chinese WEB site is original.
Tip: you can modify some code before running