I am trying to get the tutorial "Challenge/Response Secure Login Process" to work on my shared hosting on php5/mysql but get the following error when filling out the login form on the index page with userid: devnetwork & password:
Code: Select all
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/XXXXXXXX/html/login/login.php:1) in /home/content/XXXXXXX/html/login/login.php on line 5
Warning: Cannot modify header information - headers already sent by (output started at /home/content/XXXXXXX/html/login/login.php:1) in /home/content/XXXXXXXX/html/login/login.php on line 103Code: Select all
1 <?php
2/*
3 Start the PHP Session
4*/
5session_start();
6/*
7 Connect to database, and some table (say mytestdatabase)
8 Edit for your own credentials...
9*/
10$conn = mysql_connect('hostname', 'username', 'password') or die('Database is down for maintenance at the moment');
11mysql_select_db('database', $conn) or die ('Can\'t access any tables at the moment : ' . mysql_error());
...
...
99if($_POST['response'] == $expected_response)
100{
101 $_SESSION['authenticated'] = 1;
102 $_SESSION['userid'] = $user['userid'];
103 header('Location: hello.php');Thanks!
I see that my host also supports sha512/php5 - where do I change the code to just use the build in php function instead of the SHA256 static class for PHP4 - which maybe also the reason why it's not working under php5 although I have read somewhere here I think that it should work ... anyway I see a record being added to the challenge database every time I "login"