Page 1 of 1

cant update through html table

Posted: Wed Mar 24, 2010 12:31 am
by hren
hi, my code is

Code: Select all

?php
include("/var/lib/content/www/dbcon.php");
mysql_select_db("tehnik", $con);
 
mysql_query("UPDATE 4asti SET partAmount = '36'
WHERE partName = 'kabel utp'");
 
mysql_close($con);
?>
 
and the table code is:

Code: Select all

<html>
<body>
 
<form action="sklad_zarejdane_un.php" method="get">
partName: <input type="text" name="partName" />
partAmount: <input type="text" name="partAmount" />
<input type="submit" />
</form>
 
</body>
</html>
 
and the problem is that after executing the table part Amount stays 36.

thanks in advanced

Re: cant update through html table

Posted: Wed Mar 24, 2010 1:29 am
by Christopher
You need to get the form values from the superglobal $_POST array.

Re: cant update through html table

Posted: Thu Mar 25, 2010 12:15 am
by hren
10x that worked.i all most new it,but when i tried as u told me and read a little beat more i understood that my php was with GlOBALS turned off from php.ini

Re: cant update through html table

Posted: Thu Mar 25, 2010 4:21 pm
by Christopher
hren wrote:... my php was with GlOBALS turned off from php.ini
That is good. Register globals is a possible security problem.