Hello there. I used this code for user and it works but when I use and alter a bit for admin side system, there is no data inside of the text field and the username keep on changing to 0 eventhough I type in other username. This is the code.
can you give your table structure? and as what arti18 posted..there is a form as you save the username and password cause from your code there is no form..
from the savepassword.php file
this line $sql = "UPDATE admin SET admin_id='$admin_id', admin_password='$admin_password' WHERE admin_id='$admin' "; $admin_id should contain post or get variable like $admin_id = $_POST['admin_id']; and $admin as well
heres the process
1. <form method="post" action="savepassword.php"></form>
2. redirect from savepassword.php
3. get all $_POST value (as youve seen from 1 you used post method)
$_POST - is an array that contains the input element from the form(see #1)
$_POST['<name of the element>']
for example <input type="text" name="student_id"> so you could get the value of the posted student id by $_POST['student_id']
4. then you can use them to the preceeding code.