Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'login functions'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. I'm working through Larry's PhP 6 and MySqL 5 book which so far has been excellent but I've hit a snag I can't get past. On Chapter 11 'Cookies & Sessions' I've completed page 327 - 339 and when I test my pages on my MacOSX running Xampp I get errors shown below. Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/php/mysqli_connect.php:4) in /Applications/XAMPP/xamppfiles/htdocs/php/ch11/login.php on line 23 Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/php/mysqli_connect.php:4) in /Applications/XAMPP/xamppfiles/htdocs/php/ch11/login.php on line 24 Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/php/mysqli_connect.php:4) in /Applications/XAMPP/xamppfiles/htdocs/php/ch11/login.php on line 28 I've checked the code and removed all the spaces after the final ?> php tag but I still get the error. Could you help please, many thanks in advance. Below is the code on 'Login.php' Line 23/24 is the setcookie function Line 28 is the header function <?php # Script 9.3 - login.php // This page processes the login form submission. // Upon successful login, the user is redirected. // Two included files are necessary. // Send NOTHING to the Web browser prior to the setcookie() lines! // Check if the form has been submitted: if (isset($_POST['submitted'])) { // For processing the login: require_once ('includes/login_functions.inc.php'); // Need the database connection: require_once ('../mysqli_connect.php'); // Check the login: list ($check, $data) = check_login($dbc, $_POST['email'], $_POST['pass']); if ($check) { // OK! // Set the cookies: setcookie ('user_id', $data['user_id']); setcookie ('first_name', $data['first_name']); // Redirect: $url = absolute_url ('loggedin.php'); header("Location:$url"); exit(); // Quit the script. } else { // Unsuccessful! // Assign $data to $errors for error reporting // in the login_page.inc.php file. $errors = $data; } mysqli_close($dbc); // Close the database connection. } // End of the main submit conditional. // Create the page: include ('includes/login_page.inc.php'); ?>
×
×
  • Create New...