Jump to content

how should this header be?


seany123

Recommended Posts

earlier i got help from people here with another page which sends mails...

 

the issue was that the header().. so i removed it and everything worked...

 

the problem is with this code removing the header() isnt an option.

 

<?php
$insertid = $db->Insert_ID();
                        $email=$_POST['email'];
                        $thekey=$string;
                        $user = $_POST['username'];
                        $pass = $_POST['password'];
                        $subject = 'welcome to rpg';
                        $message = "Thank you for registering at mysite,please activate your account at http://mafiakillerz.co.cc/validate.php?email=$email&string=$string You can login to the game after activating account at www.mafiakillerz.co.cc with the following details: username : $user  password: $pass ";
                        $headers = "From: admin@mafiakillerz.co.cc\r\nReply-To: admin@mafiakillerz.co.cc";
                        mail( $_POST['email'], $subject, $message, $headers );
		echo "Congratulations! You have successfully registered!<br />You will recieve an email to activate account.";
		header("Location: index.php");
?>

 

Link to comment
Share on other sites

okay so ive done this but its still not sending the mail.

 

<?php
$insertid = $db->Insert_ID();
                        $email=$_POST['email'];
                        $thekey=$string;
                        $user = $_POST['username'];
                        $pass = $_POST['password'];
                        $subject = 'welcome to rpg';
                        $message = "Thank you for registering at mysite,please activate your account at http://mafiakillerz.co.cc/validate.php?email=$email&string=$string You can login to the game after activating account at www.mafiakillerz.co.cc with the following details: username : $user  password: $pass ";
                        $headers = "From: admin@mafiakillerz.co.cc\r\nReply-To: admin@mafiakillerz.co.cc";
                        mail( $_POST['email'], $subject, $message, $headers );
?>

Link to comment
Share on other sites

<?php
include("lib.php");
define("PAGENAME", "Home");

$query = $db->execute("select `id`, `username`, `validated` from `players` where `username`=? and `password`=?", array($_POST['username'], ($_POST['password'])));
$player = $query->fetchrow();
$playerval = $player['validated'];

//Begin checking if user has tried to login
$error = 0; //Error count
$errormsg = "<font color=\"red\">"; //Error message to be displayed in case of error (modified below depending on error)
if ($_POST['login'])
{
if ($_POST['username'] == "")
{
	$errormsg .= "Please enter a username!";
	$error = 1;
}
else if ($_POST['password'] == "")
{
	$errormsg .= "Please enter your password!";
	$error = 1;
}
else if ($playerval == 0)
{
	$errormsg .= "Account not activated!";
	$error = 1;
}
else if ($error == 0)
{
	$query = $db->execute("select `id`, `username` from `players` where `username`=? and `password`=?", array($_POST['username'], ($_POST['password'])));
	if ($query->recordcount() == 0)
	{
		$errormsg .= "You could not login! Please check your username/password!";
		$error = 1;
	}
	else
	{
		$player = $query->fetchrow();
		$query = $db->execute("update `players` set `last_active`=? where `id`=?", array(time(), $player['id']));
		$hash = ($player['id'] . $_SERVER['REMOTE_ADDR'] . $secret_key);
		$_SESSION['userid'] = $player['id'];
		$_SESSION['hash'] = $hash;
		header("Location: home.php");
	}
}
}
$errormsg .= "</font>";


?>

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.