Hi guys, i have a very big problem. i'm a database and an upload form from which yuo can insert new rows into the database, but i want only my friends to be able to do that so i though about a general password and creating a simple login form taht only has one textfield for the password. that login page echoes to itself when you click the submit button and through a hidden field i assign a value that is checked at the begining, if that value is already set, then the pagesends via post the password to the row-insertion page and through a
i redirected to the row-insertion-page. at the beginig of the body of that page i check the post variable and if it's the same passowrd i coded there, then continues displaying the page, but if the pass is different then it redirects to the login form again. the code i used:
Code: Select all
function check() {
if($_POST[contrasena]=='apollonia'){
}else{
header("Location: loginform.php");
}
}
it worked excelent on my machine using apache. then i uploeaded those file to the internet and the headers at the row-insertion page don't work. it seays a message like "header info cannot be changed once sent" or something like it. the headers at the login form do work and redirect me to the register.php when i click the button, if the password is correct then the register page opens perfectly, but if it is not, then it appears the strange message above and displays the page still.
i am kind of new to php so if you could please help me, i don't know much about php