hobbes Posted September 25, 2008 Share Posted September 25, 2008 Quick question in regards to the voting mod for mccode. It was working fine for a long time until suddenly one day, I get this. I haven't touched a thing and now it's giving me problems. Warning: Cannot modify header information - headers already sent by (output started at /global_func.php:414) in /votextop.php on line 3 After some googling, I read that it has to do with empty space before and after the <?php and ?>. The only thing is, I don't have empty space anywhere in the voteblabla.php script. I'm very confused as this was working fine until recently. This is what I have and the error lies in the header, "if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }" <?php require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $is=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid"); $ir=$db->fetch_row($is); $q=$db->query("SELECT * FROM votes WHERE userid=$userid AND list='xtop'"); if($db->num_rows($q)) { print "You have already voted at Xtreme Top 100 today!"; } else { $db->query("INSERT INTO votes values ($userid,'xtop')"); $db->query("UPDATE users SET crystals=crystals+5 WHERE userid=$userid"); header("Location:http://www.xtremetop100.com/in.php?site=1132237581"); exit; } ?> Any idea what's going on or what all of a sudden happened? Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted September 25, 2008 Share Posted September 25, 2008 Re: Voting Issues Predefine the session_start(); <?php require "global_func.php"; session_start(); if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $is=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid"); $ir=$db->fetch_row($is); $q=$db->query("SELECT * FROM votes WHERE userid=$userid AND list='xtop'"); if($db->num_rows($q)) { print "You have already voted at Xtreme Top 100 today!"; } else { $db->query("INSERT INTO votes values ($userid,'xtop')"); $db->query("UPDATE users SET crystals=crystals+5 WHERE userid=$userid"); header("Location:http://www.xtremetop100.com/in.php?site=1132237581"); exit; } ?> I would say: Advanced Voting: $15 Description: Sick and tired of adding new vote site's via the webpage and adding new file's then when you want to take it off you need to delete the links etc? Well then this is the mod for you, it allow's you to edit, delete, add new vote site's. This also counts how many votes per day and total vote's. Allows you to give crystals & money Made by me. Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted September 26, 2008 Share Posted September 26, 2008 Re: Voting Issues If that's the one on kc it's actually very good Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted September 26, 2008 Share Posted September 26, 2008 Re: Voting Issues Yes it is the one on kc. Quote Link to comment Share on other sites More sharing options...
hobbes Posted September 26, 2008 Author Share Posted September 26, 2008 Re: Voting Issues and yes, i'm using it now and much more convenient! Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted September 27, 2008 Share Posted September 27, 2008 Re: Voting Issues and yes, i'm using it now and much more convenient! Must agree it's one of Kyles best modifications Quote Link to comment Share on other sites More sharing options...
hobbes Posted September 27, 2008 Author Share Posted September 27, 2008 Re: Voting Issues I'm gonna throw this one out there, and maybe it should be posted in mod requests, but how hard would it be to script the same idea, but with donator packs, so donator packs can be set up in the staff menu? would it be more trickier due to the paypal scripts? Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted September 27, 2008 Share Posted September 27, 2008 Re: Voting Issues Not really, i've already made this a script similar to that. :roll: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.