Re: How to update all re-sortable values of a form in a database
Posted: Tue Dec 16, 2008 5:31 am
You should not use array keys in this form. If you take a look at you error log you will see warning notices about using itemid and ordervalue:Sindarin wrote:Code: Select all
//re-sort homepage news $array_id=$_POST[itemid]; $array_value=$_POST[ordervalue];
Notice: Use of undefined constant itemid - assumed 'itemid' ....
Also, this "usage style" is vulnerable to variable-value pollution (in fact, it could be considered using global variables) - if you've previously defined
Code: Select all
define('itemid', 'my_value')So, you should rewrite it in its strict form:
Code: Select all
//re-sort homepage news
$array_id=$_POST['itemid'];
$array_value=$_POST['ordervalue'];