Get $_POST from multiple checkboxes

Set the name in the form to check_list[] and you will be able to access all the checkboxes as an array($_POST[‘check_list’][]). Here’s a little sample as requested: <form action=”test.php” method=”post”> <input type=”checkbox” name=”check_list[]” value=”value 1″> <input type=”checkbox” name=”check_list[]” value=”value 2″> <input type=”checkbox” name=”check_list[]” value=”value 3″> <input type=”checkbox” name=”check_list[]” value=”value 4″> <input type=”checkbox” name=”check_list[]” value=”value 5″> … Read more

What is the default form HTTP method?

It’s GET. Take a look W3C Superceded Recommendation 17.3 The FORM element. Excerpt: <!ATTLIST FORM %attrs; — %coreattrs, %i18n, %events — action %URI; #REQUIRED — server-side form handler — method (GET|POST) GET — HTTP method used to submit the form– enctype %ContentType; “application/x-www-form-urlencoded” accept %ContentTypes; #IMPLIED — list of MIME types for file upload — … Read more

How can I listen to the form submit event in javascript?

Why do people always use jQuery when it isn’t necessary? Why can’t people just use simple JavaScript? var ele = /*Your Form Element*/; if(ele.addEventListener){ ele.addEventListener(“submit”, callback, false); //Modern browsers }else if(ele.attachEvent){ ele.attachEvent(‘onsubmit’, callback); //Old IE } callback is a function that you want to call when the form is being submitted. About EventTarget.addEventListener, check out … Read more

using href links inside tag

UPDATE 2022: This answer is fine but really in 2022 we shouldn’t be doing this anymore! UPDATE (May 2020): Someone asked in the comments why I wouldn’t advocate this solution. I guess it’s a question of semantics. I’d rather my users navigate using <a> and kept <select> for making form selections because HTML elements have … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)