Http headers already sent

JerryClask

New Member
So I am making a webpage where users login using facebook. If the user is already logged in the page redirects to another page. But recently I encountered the famous http headers already sent error. Now usually I know how to solve this, but I just cant find the error in my files. Here are the pages:Index.php\[code\]<?php include 'scripts/fb/fbaccess.php'; ?><!DOCTYPE HTML><html> <head> <title>Streetstash - Streetwear, Accessories & Skateboarding, samlet p? et sted</title> <link rel="stylesheet" type="text/css" href="http://stackoverflow.com/questions/15877022/stylesheet.css"> <script src="http://stackoverflow.com//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script> <meta name='description' content='Alle dine yndlings butikker, t?j, accessories og skateboarding samlet p? et sted.' /> <meta charset="utf-8"> <?php if($_GET['welcome']=='no'){?> <script language="javascript"> window.location.href = "http://stackoverflow.com/questions/15877022/scripts/log_user.php" </headersalreadscript> <?php } ?> <script> $(document).ready(function() { $('h1.title').fadeIn(1500); $('h3.subtitle').delay(1500).fadeIn(2000); setTimeout(function() { $('html, body').animate({ scrollTop: $('div.sub-body').offset().top }, 2000); }, 4000); }); </script> </head> <body> <div class='content'> <div class='head'> </div> <div class='body'> <h1 class='title'>Streetstash</h1><br> <h3 class='subtitle'>Streetwear, Accessories & Skateboarding</h3> <div class='sub-body'> <div class='title'><h2 class='title'>Streetstash</h2><br><h3 class='subsubtitle'>Streetwear, Accessories & Skateboarding</h3></div> <div class='table'> <div class='table_left'> <h2>Hvad er det?</h2> <p>Streetstash er en ny m?de at handle t?j, accessories og skateboarding varer p? internettet.<br><br>Streetstash samler alle de butikker du normalt handler p? over internettet p? et sted og tilbyder en platform, hvor du nemt og hurtigt kan finde de bedste tilbud p? dine favorit varer.</p> </div> <div class='table_right'> <h2>Tilmeld</h2> <p>St?t projektet, tilmeld dig forud og modtag nyheder, opdateringer og v?r klar til at shoppe de fedeste varer s? snart vi ?bner.</p><br> <?php if($user_info == null){ echo '<a href="'.$loginUrl.'"><img src="http://stackoverflow.com/questions/15877022/resources/img/fb_button.png"></a>'; }else{ echo '<p class="success">Tak for tilmeldingen '.$user_info['first_name'].'!</p>'; } ?> </div> </div> <div class='vertline'> </div> </div> </div> </div> </body></html>\[/code\]/scripts/log_user.php\[code\]<?php include 'fb/fbaccess.php'; include 'db_connect.php'; $check_query = mysql_query('SELECT * FROM users WHERE user_id = '.$user_info['id'].''); $check_user_existence = mysql_num_rows($check_query); echo $check_user_existence; if($check_user_existence == 1){ echo 'User already exists'; }else{ mysql_query("INSERT INTO users (id, first_name, last_name, user_id, email) VALUES (NULL, '$user_info[first_name]', '$user_info[last_name]', '$user_info[id]', '$user_info')") or die(mysql_error); } echo " <script type='text/javascript'> <!-- window.location = '../../index.php' //--> </script> ";?>\[/code\]/scripts/fb/fbaccess.php\[code\]<?php//Application Configurations$app_id = "265869100216640";$app_secret = "47a0c95c974f6bab011824549e196bd2";$site_url = "http://streetstash.dk/index.php?welcome=no";try{ include_once "src/facebook.php";}catch(Exception $e){ error_log($e);}// Create our application instance$facebook = new Facebook(array( 'appId' => $app_id, 'secret' => $app_secret, ));// Get User ID$user = $facebook->getUser();// We may or may not have this data based// on whether the user is logged in.// If we have a $user id here, it means we know// the user is logged into// Facebook, but we don
 
Back
Top