Znajdź zawartość
Wyświetlanie wyników dla tagów 'php.' .
-
Witam. Mam problem, z którym męczę się od godziny. Na stronie u góry pojawia się taki o to błąd : Warning: Cannot modify header information - headers already sent by (output started at /home/nazwa/domains/nazwastrony.pl/public_html/index.php:35) in/home/nazwa/domains/nazwastronyr.pl/public_html/index.php on line 54 Szukałem w googlach, próbowałem cos dodawać w kodzie i zmieniać jednak bezskutecznie. Może ktoś coś wymyśli ? Tutaj kod : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>tekst</title> <link href="script/oneColFixCtrHdr.css" rel="stylesheet" type="text/css" /> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script>window.jQuery || document.write(unescape('%3Cscript src="http://api.jquery.com/jquery-wp-content/themes/jquery/js/jquery-1.9.1.min.js"%3E%3C/script%3E'))</script> <script src="http://api.jquery.com/jquery-wp-content/themes/jquery/js/jquery-migrate-1.1.1.min.js"></script> <link rel="stylesheet" type="text/css" href="script/progressbar.css" /> <script type="text/javascript" src="script/progressbar.js"></script> </head> <script> nr=1; function onClick() { $("#generate").show(); if(nr==1) { loadProgressBar(); nr=nr+1; } } </script> <body> <?php include('settings.php'); function generateRandomString($length = 10) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, strlen($characters) - 1)]; } return $randomString; } $ip = $_SERVER['REMOTE_ADDR']; //Checking cookie if(!isset($_COOKIE['refcode'])) { $refcode = generateRandomString(10); setcookie('refcode', $refcode); $insert = mysql_query("INSERT INTO `users` (`ip`, `refcode`) VALUES ('$ip', '$refcode')"); } else { $refcode = $_COOKIE['refcode']; } //Insert referral if(isset($_GET['code'])) { $sql = mysql_query("SELECT * FROM `hits` WHERE `ip` = '$ip' AND `refcode` = '".$_GET['code']."'"); if(mysql_num_rows($sql) == 0) { $update = mysql_query("INSERT INTO `hits` (`ip`, `refcode`) VALUES ('$ip', '".$_GET['code']."')"); } } //Check hits $check = mysql_query("SELECT * FROM `hits` WHERE `refcode` = '".$_COOKIE['refcode']."'"); $refs = mysql_num_rows($check); ?> <img alt="full screen background image" src="script/background.png" id="full-screen-background-image" /> <div class="container"> <div class="header" style="margin-top: 7px;"><!-- end .header --></div> <div class="content"> <h1>tekst</h1> <div class="description"><strong>tekst</strong> tekst</div> <h1>tekst <font color="#009900"><?php echo $referrals - $refs; ?></font> tekst.</h1> <p>tekst <input class="boxurl" type="text" onClick="this.select();" name="referral" value="<?php echo $address ?>index.php?code=<?php echo $refcode ?>" /></p> <p>tekst <font color="red"><?php echo $refs ?></font> / <font color="#009900"><?php echo $referrals ?></font></p> <?php if($refs >= $referrals) { ?> <p><div id="btn"><a class="button" onclick="onClick();">tekst</a></div></p> <div id="generate" style="width: 100%; height: 100%; margin: 0px auto; display: none;"> <div id="progress" style="position: relative; top: 45%; margin: 0px auto;"></div> </div> <br/><br/> <p><strong><div style="color: #009900; display: none;" class="key">tekst<a href="http://google.com">tekst</a></div></strong><p> <?php } ?> <p> </p> <!-- end .content --></div> <div class="footer"> <p>Copyright - tekst</p> <!-- end .footer --></div> <!-- end .container --></div> </body> <script type="text/javascript"> var myProgressBar = null var timerId = null function done() { $(".key").show(); } function loadProgressBar(){ myProgressBar = new ProgressBar("progress",{ borderRadius: 10, width: 300, height: 20, minValue: 1, maxValue: 100, labelText: "Generowanie linku ... {value,0} %", orientation: ProgressBar.Orientation.Horizontal, direction: ProgressBar.Direction.LeftToRight, animationStyle: ProgressBar.AnimationStyle.LeftToRight1, animationSpeed: 1.5, imageUrl: 'images/v_fg12.png', backgroundUrl: 'images/h_bg2.png', markerUrl: 'images/marker2.png' }); timerId = window.setInterval(function() { if (myProgressBar.value >= myProgressBar.maxValue) myProgressBar.setValue(100); else myProgressBar.setValue(myProgressBar.value+1); if(myProgressBar.value == myProgressBar.maxValue) { done(); clearInterval(timerId); } }, 100); } </script> </html>