Jump to content

Header Error (Im not sure if this post is allowed)


Dethman

Recommended Posts

well I am getting this error:


Warning: Cannot modify header information - headers already sent by (output started at /home2/psionic/public_html/functions/recruit.php:32) in /home2/psionic/public_html/recruit.php on line 13

 

 

This is the code with line 13:

 

<?php
//start title
$pagetitle="Recruitment";
//end title
require("db_connect.php");
require("functions/main.php");
require("functions/recruit.php");
$System=getSystemInfo();

$recruit=$_GET['uniqueID'];
$recruiter=getRecruiter($recruit);
if($recruiter=="Error"){
header("Location: index.php?strErr=Citizen with that recruit link does not exist!");
}
$msg=$_GET['strErr'];

include("includes/top.php");
?>

 

This is functions/recruit.php with line 32:

 

<?php

function getRecruiter($link){
$q="SELECT * FROM `user_users`";
$v=mysql_query($q);
while($row=mysql_fetch_array($v)){
if(md5($row['username'])==$link){
$q2="SELECT * FROM `user_users` WHERE `userid` = '".$row['userid']."'";
$v2=mysql_query($q2);
$temp=mysql_fetch_array($v2);
$r="SELECT * FROM `recruit_ip` WHERE `userid` = '".$temp['userid']."' AND `ip` = '".$_SERVER['REMOTE_ADDR']."'";
$r2=mysql_query($r);
$count=mysql_num_rows($r2);
if($count<=0){
	$q4="INSERT INTO `recruit_ip` (`recruitID`,`userid`,`ip`) VALUES ('','".$temp['userid']."','".$_SERVER['REMOTE_ADDR']."');";
	$q3="UPDATE `user_users` SET `untrainedTroops` = `untrainedTroops` + '40', `miner` = `miner` +'60', `attackTroops` = `attackTroops` + '30' WHERE `userid` = '".$temp['userid']."'";
	mysql_query($q3) or die("SQL ERR:".mysql_error());
	mysql_query($q4) or die("SQL ERR:".mysql_error());
	return $temp;
}else{
header("Location: index.php?strErr=you have already clicked that link today. sorry come back tomorrow");
}
}else{
 return "Error";
}
}

}

?>

 

 

Please dont kill me if this isnt allowed I just wasnt sure :(

 

Thanx,

Brian Flores CEO NimbusGames,llc

 

 

Link to comment
Share on other sites

i think its because line 13 is

 

header("Location: index.php?strErr=

 

then yur including this file functions/recruit.php

 

Which also has the header info

 

header("Location: index.php?strErr=tomorrow");
}

 

I maybe wrong but im postive thats what it is :)

 

Rick

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.