when i verify my login i got this message...means when i checked that
page in i have include verifylogin.php
please help me...remember one thing i m using ie6 with iis5.0 on xp
Warning: Cannot send session cookie - headers already sent by (output started at I:\Dosti\Login\test\Check login.php:2) in I:\Dosti\Login\test\inc\verifylogin.php on line 12
Warning: Cannot send session cache limiter - headers already sent (output started at I:\Dosti\Login\test\Check login.php:2) in I:\Dosti\Login\test\inc\verifylogin.php on line 12
Notice: Undefined index: username in I:\Dosti\Login\test\inc\verifylogin.php on line 14
Warning: Cannot add header information - headers already sent by (output started at I:\Dosti\Login\test\Check login.php:2) in I:\Dosti\Login\test\inc\verifylogin.php on line 18
// i just made simple changes according to my needs
///script for join.php
<body>
<div id="Layer1" style="position:absolute; left:145px; top:48px; width:410px; height:98px; z-index:1">
<form name="form1" method="post" action="confjoin.php">
<table width="100%" border="1">
<tr>
<td width="46%"><strong>User Name</strong></td>
<td width="54%"><input name="username" type="text" size="30"></td>
</tr>
<tr>
<td><strong>Password</strong></td>
<td><font color="#FF0000"><em><strong>Password will be sent in email</strong></em></font></td>
</tr>
<tr>
<td><strong>Email Address</strong></td>
<td><input name="email" type="text" size="30"></td>
</tr>
<tr>
<td><strong>*Confirm Email Address</strong></td>
<td><input name="textfield3" type="text" size="30"></td>
</tr>
<tr>
<td rowspan="2"><strong>Join Mailing List</strong></td>
<td><input type="radio" name="mailing_list" value="1"> <strong>Yes</strong></td>
</tr>
<tr>
<td><input type="radio" name="mailing_list" value="0"> <strong>No</strong></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="Submit">
</div></td>
</tr>
</table>
</form>
</div>
<div id="Layer2" style="position:absolute; left:198px; top:9px; width:316px; height:29px; z-index:2">
<div align="center"><strong><font color="#0066FF" size="+2">User Registration System</font></strong></div>
</div>
</body>
//script for confjoin.php
<?php
include "I:\Dosti\Db\db.php"
?>
<?php
$date = date("d/m/Y");
function random_char($string)
{
$length = strlen($string);
$position = mt_rand(0, $length - 1);
return($string[$position]);
}
function random_string ($charset_string, $length)
{
$return_string = random_char($charset_string);
for ($x = 1; $x < $length; $x++)
$return_string .= random_char($charset_string);
return($return_string);
}
mt_srand((double)microtime() 1000000);
$charset = "abcdefghijklmnopqrstuvwxyz1234567890ABCDE_FGHIJKLMNOPQRSTWXYZ";
$charset1 = "abcdefghijklmnopqrstuvwxyz1234567890ABCDE_FGHIJKLMNOPQRSTWXYZ";
$password = random_string($charset, 6);
$login_code = random_string($charset1, 6);
$Epassword = MD5($password);
//if(Empty($username))
//{
//print("Please Fill in all the fields<br>");
//exit;
//}
/if(Empty($email))
{
print("Please Fill in all the fields<br>");
exit;
}
//else
//{
//$check = mysql_query("SELECT username FROM users WHERE 1 AND username LIKE '$username'");
//$records = mysql_num_rows($check);
//if($records >= 0)
//{
//print("$username is already in use, please choose a differnet username...");
//}
else
{*/
$query1 = "INSERT INTO users (username, password, email, mailing_list, date, pass, login_code) VALUES ('$username', '$Epassword', '$email', '$mailing_list', '$date', '$password', '$login_code')";
$result = mysql_db_query($db,"$query1",$con);
if($result)
{
print "wow";
}
else
{
print "oye hoye";
}
//*******Please Note*********
//his is not spam mail, some one asked us to send this information to this email address.
//****Thank You******
//*Script From Qadsscripts.t2u.com******";
//}
//}
///$b = "<a href=\"file:///I|/Dosti/Login/test/confjoin.php\">join</a>"
$b = "http://localhost/Dosti/Login/test/join.php";
$sendto = "$email";
$subject = "wow its working";
$body = "Username: $username
Password: $password $b
";
$from = "talk2ali@yahoo.com";
if(mail($sendto, $subject, $body, "From:$from"))
{
print " ok......";
}
else
{
print "ooh hoo". mysql_error();
}
?>
// script for loginuser.php aginst login.php which is in action
<form name="form1" method="post" action="login.php">
<table width="100%" border="1">
<tr>
<td width="35%"><div align="center"><strong><font color="#0066FF">User
Name</font></strong></div></td>
<td width="65%"><input type="text" name="username"></td>
</tr>
<tr>
<td><div align="center"><strong><font color="#0066FF">Password</font></strong></div></td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
</table>
</form>
//script for login.php
require_once("admin/inc/set_global.php");
include("admin/inc/type.php");
include("../../Db/db.php");
if(isSet($log))
{
$username = $_POST['username'];
$password = md5($_POST['password']);
session_start();
$_SESSION = &$HTTP_SESSION_VARS;
$_SESSION = $username;
$query = "SELECT * FROM users WHERE username = '$username' and password = '$password'";
$result =mysql_query($query) or die("Unable 2 process query");
$affected_rows =mysql_num_rows($result);
if($affceted_rows == 1)
{
$array =mysql_fetch_array($result);
$email = $array[email];
require_once("admin/inc/session_save.php");
header("Location:main.php");
}
else
{
session_destroy();
print "Sorry dear Check ur password and User name";
}
}
?>
///script for verifylogin.php i m using IE.6 with iis server
<?php
include("inc/verifylogin.php");
?>
//script for set_global.php
<?php
$GET = &$HTTP_GET_VARS;
$POST = &$HTTP_POST_VARS;
$COOKIE = &$HTTP_COOKIE_VARS;
$SESSION = &$HTTP_SESSION_VARS;
$SERVER = &$HTTP_SERVER_VARS;
$ENV = &$HTTP_ENV_VARS;
$_FILES = &$HTTP_POST_FILES;
?>
//script for type.php
<?PHP
foreach($HTTP_GET_VARS as $key=>$value)
{
$$key = $value;
global $$key;
}
foreach($HTTP_POST_VARS as $key=>$value)
{
$$key = $value;
global $$key;
}
foreach($HTTP_COOKIE_VARS as $key=>$value)
{
$$key = $value;
global $$key;
}
foreach($HTTP_SERVER_VARS as $key=>$value)
{
$$key = $value;
global $$key;
}
///script for session_save.php
<?php
foreach($_SESSION as $key=>$value)
{
$$key = $value;
session_register("$key");
}
?>
please help me...remember one thing i m using ie6 with iis5.0 on xp