<form enctype="multipart/form-data" method="post" name="settingsForm" id="settingsForm">
Admin Name: <input type="text" value="Vipul Sharma" name="admin[admin_name]" id="admin_name"><br>
Admin Email: <input type="text" value="vsharma1@seasiaconsulting.com" name="admin[admin_email]" id="admin_email"><br>
Site Logo: <input type="file" name="site[logo]" id="site_logo"><img width="150px" height="100px" src="http://localhost/grublies/public/images/Atomic-Bomb-Explosion-600x450.jpg"><br>
Records Per Page in user side: <input type="text" value="12" name="admin[rpp_user]" id="rpp_user"><br>
Records Per Page in admin side: <input type="text" value="15" name="admin[rpp_admin]" id="rpp_admin"><br>
Site Address: <textarea name="admin[site_address]" id="site_address">C 136</textarea><br> <input type="submit" value="Submit" id="" name=""> </form>
如果我在 php 中提交表单后使用 post 方法,那么它会创建一个像这样的数组
Array
(
[admin] => Array
(
[admin_name] => Vipul Sharma
[admin_email] => vsharma1@seasiaconsulting.com
[rpp_user] => 12
[rpp_admin] => 15
[site_address] => C 136
)
)
但我希望通过 jQuery ajax 发布相同的数组,但不幸的是它考虑 admin[admin_name] 作为变量。我使用了 jQuery 序列化,它不起作用?