PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I seem to be having big problems with my login page. I am able to authenticate a user, but when i try to redirect to another page i.e. mainsession.php nothing happens. I am trying to use
Is there away to reset data that is being held temporarily by the browser, as it keeps on going into the if statement if it has being previously ran in the last few minutes.
it solved my problems of previously enter data being stored in the browser.
Still seem to be having problems redirecting. I can redirect with the following code.
if (isset($_POST['txtUserName']) && isset($_POST['txtPassword'])) {
include("db.inc.php");
mysql_connect($databaseServer,$user,$passwd) or die("Could not connect to the database.<br>".mysql_error());
mysql_select_db($database) or die("Could not select your database.<br>".mysql_error());
header('Location: readback.php');
mysql_close();
}
It doesnt matter if i put mysql_close(); before header('Location: readback.php');
Any Ideas really appreciated.
it solved my problems of previously enter data being stored in the browser.
Still seem to be having problems redirecting. I can redirect with the following code.
if (isset($_POST['txtUserName']) && isset($_POST['txtPassword'])) {
include("db.inc.php");
mysql_connect($databaseServer,$user,$passwd) or die("Could not connect to the database.<br>".mysql_error());
mysql_select_db($database) or die("Could not select your database.<br>".mysql_error());
header('Location: readback.php');
mysql_close();
}
It doesnt matter if i put mysql_close(); before header('Location: readback.php');
Any Ideas really appreciated.
I think the problem is, you can't connect to the database so mysql_connect or mysql_select_db generates error and outputs the error. so you can't redirect because headers have been sent.
And hardcoding the values in it works . I was only using the file to declare global variables for connecting to the database.
Anyway thanks for your help lads/lassies.