So this is right? right?
<?php
session_start();
$sessid=session_id();
if ($_session['userid'])
{
header("Location: [url]http://4.65.32.70/login/index.php[/url]");
}
if ($_POST['submit'] && $_POST['user'] && $_POST['passwd']) {
$conn=mysql_connect("localhost","l3lade","c6h12o6");
mysql_select_db("biohazard_login",$conn);
$test = mysql_result(mysql_query("SELECT COUNT(*) FROM users WHERE user='".$_POST['user']."' AND passwd='".$_POST['passwd']."'"),0);
if ($test == 1) {
$userid= mysql_result(mysql_query("SELECT id FROM users WHERE user='".$_POST['user']."' AND passwd='".$_POST['passwd']."'"),0);
$_SESSION['userid'] = $userid;
header( "http://4.65.32.70/index.php");
}
else
{
mysql_close($conn);
session_destroy();
echo "<html>
<head>
<title>Login failed!</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
</head>
<body>
Invalid login. Try again <a href=\"/login/login.php\">here</a>
</body>
</html>";
}
header("Location: [url]http://4.65.32.70/[/url]");
}
?>
[/SIZE]
also when i click login i get this.... :
Warning: open(/tmp\sess_a9bf6c12588cad2e5aee0e704f18e616, O_RDWR) failed: No such file or directory (2) in C:\Documents and Settings\Mark\Desktop\My Web Sites\biohazard\login\check.php on line 2
Warning: open(/tmp\sess_a9bf6c12588cad2e5aee0e704f18e616, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
PHP Warning: open(/tmp\sess_a9bf6c12588cad2e5aee0e704f18e616, O_RDWR) failed: No such file or directory (2) in C:\Documents and Settings\Mark\Desktop\My Web Sites\biohazard\login\check.php on line 2 PHP Warning: open(/tmp\sess_a9bf6c12588cad2e5aee0e704f18e616, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 PHP Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
also, how do i creat a table, i have a script that will add to a database, but it doesnt include creating the table.. helpppp meee plz 🙂:
<?
$db = mysql_connect("localhost","*****","*******");
mysql_select_db (biohazard_login);
$result = mysql_query ("INSERT INTO biohazard_login (username, passwd, firstname, lastname, email, age, homepage, imservicename, aim, yahoo, icq)
VALUES ('$username', '$passwd', '$firstname', '$lastname', '$email', '$age', '$homepage', '$imservicename', '$aim', '$yahoo', '$icq')");
if(!$result)
{
echo "<b>There was a problem!</b> ", mysql_error();
exit;
}
if($result)
{
mysql_close($db);
print "Thank you for registering with Biohazard! you may now login!";
}
?>