how to get the value in mysql turn into a variable - php

My code is this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
require("db.php");
$datetoday = date("Y-m-d");
if (isset($_POST['submit']))
{
include 'db.php';
$loginid =$_REQUEST['loginid'];
$result = mysql_query("SELECT * FROM info WHERE id = '$loginid'");
$test = mysql_fetch_array($result);
$testid=$test['id'];
$fnameloginsuccess1=$test['firstname'];
$mnameloginsuccess1=$test['middlename'];
$lnameloginsuccess1=$test['lastname'];
$departmentloginsuccess1=$test['department'];
echo'<input type="text" name="fname" value="<?php echo $fnameloginsuccess1 ?>"/></td>';
if (!$loginid)
{header("location:../index.php"); }
$natureofleave =$_POST['group1'];
$datestart=$_POST['startofleave'];
$dateend=$_POST['endofleave'];
$reason=$_POST['reason'];
$status= 'pending';
$fname = $_GET[$fnameloginsuccess1];
$mname = $test['middlename'];
$lname = $test['lastname'];
$dept = $test['department'];
mysql_query("INSERT INTO `request`(id,natureofleave,dateofleavestart,dateofleaveend,reasons,datesubmitted,department,status,firstname,middlename,lastname)
VALUES('$log','$natureofleave','$datestart','$dateend','$reason','$datetoday','$dept','$status','$fname','$mname','$lname')");
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<table width="532" height="237" border="1">
<tr>
<td width="176"><input type="button" value="Notification" name="notification" />
<br /><p>logged in as <label>'user'</label><input type ="button" value="Sign Out" name="buttonout" /> </p></td>
</tr>
<tr>
<td width="161"><p>Home Page</p>
<p>Request for a Leave</p>
<p>Leave History</p>
<p>Leave Status</p>
<p>View Profile</p>
<p>Update/Search Personnel Info</p>
<p>Add Personnel</p>
<p>Post Announcements</p>
<p>Reports</p>
<p> </p>
<p> </p></td>
<td colspan="2"><p>Application for Leave</p>
<p><form action='requestleave.php' method='post'>Name:
<?php echo $fnameloginsuccess1,' ',$mnameloginsuccess1,' ', $lnameloginsuccess1; ?>
<label name="name1"></label>
</p>
<p>Department:<?php echo $departmentloginsuccess1; ?>
<label name="department1"> </label>
</p>
<p>Date<?php echo $datetoday; ?></p>
i can't insert into the firstname, middlename, lastname, department and the ID.. in MYSQL_QUERY but i can "echo" them. i already tried putting $departmentloginsuccess1 etc. in MSQL_QUERY but it dosen't work. i already call the db.
I would like insert them into my database. how? helpp!!!

mysql_query("INSERT INTO `request`(id,natureofleave,dateofleavestart,dateofleaveend,reasons,datesubmitted,department,status,firstname,middlename,lastname)
VALUES('$loginid','$natureofleave','$datestart','$dateend','$reason','$datetoday','$dept','$status','$fname','$mname','$lname')");

Related

PHP Registration Username/Password Incorrect

I am not sure what the problem is here. The user data is in my MySQL database, and correct. However when I try to login I get an error saying user/password is incorrect. I am trying to login using the users email address. In addition I want to add the first name, and user id to the session.
<?php
session_start();
include_once 'dbconnect_new.php';
if(isset($_SESSION['user'])!="")
{
header("Location: ../index.php");
}
if(isset($_POST['btn-login']))
{
$s_email = mysql_real_escape_string($_POST['email']);
$s_password = mysql_real_escape_string($_POST['password']);
$s_email = trim($s_email);
$s_password = trim($s_password);
$res=mysql_query("SELECT student_id, student_password, student_firstname FROM studentdata WHERE student_email='$s_email'");
$row=mysql_fetch_array($res);
$count = mysql_num_rows($res); // if uname/pass correct it returns must be 1 row
if($count == 1 && $row['student_password']==md5($s_password))
{
$_SESSION['user'] = $row['student_id'];
header("Location: ../index.php");
}
else
{
?>
<script>
alert('Username / Password Seems Wrong !');
</script>
<?php
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Reg Page</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<center>
<div id="login-form">
<form method="post">
<table align="center" width="30%" border="0">
<tr>
<td>
<input type="text" name="email" placeholder="Your Email" required />
</td>
</tr>
<tr>
<td>
<input type="password" name="password" placeholder="Your Password" required />
</td>
</tr>
<tr>
<td>
<button type="submit" name="btn-login">Sign In</button>
</td>
</tr>
<tr>
<td>Sign Up Here</td>
</tr>
</table>
</form>
</div>
</center>
</body>
</html>
Try this code:-
$s_email = mysql_real_escape_string($_POST['email']);
$s_password = mysql_real_escape_string($_POST['password']);
$s_email = trim($s_email);
$s_password = md5(trim($s_password));
$res=mysql_query("SELECT student_id, student_firstname FROM studentdata WHERE student_email='$s_email' AND student_password = '$s_password'");
if (!$res) {
// Debug query result by below code
//echo 'Could not run query: ' . mysql_error();
//exit;
echo '<script language="javascript">';
echo 'alert("Username / Password Seems Wrong !")';
echo '</script>';
}else{
$row = mysql_fetch_row($result);
$stu_id = $row[0];
$stu_fname = $row[1];
$_SESSION['user'] = $stu_id;
header("Location: ../index.php");
}
Hope this will help you :)

mysqli fetch array error Couldn't fetch mysqli

I am trying to input and display the data on same page through mysqli but it shows an error "Couldn't fetch mysqli on line" and not unable to display the records.
<?php
$db=mysqli_connect("localhost","root","","abc") or die("Not connected".mysqli_error());
$database=mysqli_select_db($db,'abc') or die("Database not found".mysqli_error());
if(isset($_POST['submit'])){
$roll=$_POST['roll'];
$name=$_POST['name'];
$ins=mysqli_query($db,"insert into abc1 (roll,name)values('$roll','$name')");
}
mysqli_close($db);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form method="post">
Roll No <input type="text" name="roll" />
Name <input type="text" name="name" />
<input type="submit" name="submit" value="Submit" />
</form>
<table><tr>
<td>Roll No.</td>
<td>Name</td>
</tr>
<?php $query=mysqli_query($db,"select * from abc1");
$result=mysqli_query($db,$query);
$id=0;
while($row=mysqli_fetch_array($result,MYSQLI_ASSOC))
{
?>
<tr><td><?php echo $row['roll']; ?></td>
<td><?php echo $row['name']; ?></td>
<?php } ?>
</tr></table>
</body>
</html>
Any help would be appreciated.
Thanks in Advance
You are doing mysqli_query twice.
Try this.
$query = "select * from abc1";
$result = mysqli_query($db, $query);
You are calling mysqli_query function twice:
$query = mysqli_query($db,"select * from abc1");
$result = mysqli_query($db,$query);
Error: Couldn't fetch mysqli on line
Means, you are passing a a resource id in mysqli_fetch_array function instead of Query Statement. so you just need to use this as:
$query = "select * from abc1";
$result = mysqli_query($db,$query);
Side Note:
There is no need to connect db again:
$database=mysqli_select_db($db,'abc')
mysqli_connect() already connected your db.

UPDATE query is not working php

Going to try to keep it short. I have a while loop in grid.php file to fill up a table as such...
<?php while($product = $products->fetch_assoc()) { ?>
<tr>
<td><?php echo $product['cd_id']?></td>
<td><?php echo $product['cd_title']?></td>
<td><?php echo $product['cd_musician_fname']?></td>
<td><?php echo $product['cd_musician_lname']?></td>
<td><?php echo $product['cd_price']?></td>
<td>Edit</td>
<td>Delete</td>
</tr>
<?php } ?>
If I click the first anchor tag takes me to a edit.php file and here is the head code for that file.
<?php include '_includes/db.php';
$cd_id = trim($_GET['id']);
$message = '';
include '_includes/connection.php';
if($db->connect_error){
$message = $db->connect_error;
}else{
$sql = "SELECT * FROM CD WHERE cd_id = $cd_id";
$result = $db->query($sql);
$row = $result->fetch_assoc();
if($db->error){
$message = $db->error;
}
}
?>
Now I will show the html of edit.php
<!-- Product Musician last name-->
<fieldset class="form-group">
<label for="cd_musician_lname">Musician's lirst name</label>
<input type="text" class="form-control" id="cd_musician_lname" name="cd_musician_lname" value="<?php echo $row['cd_musician_lname'];?>">
</fieldset>
<!-- End of Musician last name-->
<!-- Product price-->
<fieldset class="form-group">
<label for="cd_price">Product price</label>
<input type="text" class="form-control" id="cd_price" name="cd_price" value="<?php echo $row['cd_price'];?>">
</fieldset>
<!-- End of Product price-->
<!-- Form submit button-->
Update Record
<a class="btn btn-primary" href="index.php" role="button">Go Back Home</a>
I have the edit.php page working just fine but if I make changes in the fields and click the submit anchor tag I get all the fields of the row empty but the PK. Here is the code for the final edit_confirm.php file
<?php
include '_includes/db.php';
$cd_id = trim($_GET['id']);
$cd_title = $_POST['cd_title'];
$cd_musician_fname = $_POST['cd_musician_fname'];
$cd_musician_lname = $_POST['cd_musician_lname'];
$cd_price = $_POST['cd_price'];
$message = '';
include '_includes/connection.php';
if($db->connect_error){
die("Connection failed: ".$db->connect_error);
} else {
$sql = "UPDATE CD SET cd_title='".$cd_title."', cd_musician_fname='".
$cd_musician_fname."', cd_musician_lname='".
$cd_musician_lname."', cd_price='".$cd_price."' WHERE cd_id = $cd_id ";
$db->query($sql);
var_dump($sql);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include '_includes/main-head.php';?>
</head>
<body>
<?php include '_includes/main-navbar.php';?>
<div class="container">
<hr>
<?php
if($db->query($sql) === TRUE){ ?>
<h1>Record updated successfully.</h1>
<?php echo $cd_title; ?>
<?php echo $record->affected_rows ?>
<p> record was updated in the database.</p></br>
<?php } else { ?>
<p>Error updating the record: </p> <?php $db->error; ?>
<?php }; ?>
<hr>
<a class="btn btn-primary" href="index.php" role="button">Go Back Home</a>
</div>
<?php include '_includes/main-script.php';?>
</body>
</html>
If you notice in the edit_confirm.php I did a var_dump to see what are the values in the variables and it shows empty.
I need help with this.
Thank you in advance.
Man the better way to do this is make it simple to test if the record is updating or not
formsample.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
include("connection.php");
$id = $_GET['id'];
$query= "select * from clients where id = '$id'";
$sql = mysqli_query($connect, $query);
$result = mysqli_fetch_assoc($sql);
?>
<form action="process.php" method="post">
<input type="text" name="name" id="name" value="<?php echo $result['name'] ?>" />
<input type="text" name="email" id="email" value="<?php echo $result['email'] ?>" />
<input type="hidden" name="id" id="id" value="<?php echo $id?>" />
<input type="submit" />
</form>
</body>
</html>
process.php
<?php
include("connection.php");
$id = $_POST['id'];
$name = $_POST['name'];
$email= $_POST['email'];
$query = "UPDATE clients set name= '$name', email ='$email' where id = '$id'";
$sql = mysqli_query($connect, $query);
?>
Update Record
This is not the proper way to submit a form - it won't work at all.
You need to have a form opening and closing tag, the target address is in the action attribute of the form element, and the method is on there too and should be post for this form (method="POST"). In your code you have a link where you should have a submit input so it won't submit the data, it will just redirect you to that URL. You should have something like this:
<input type="submit" value="Update Record" />
http://www.w3schools.com/html/html_forms.asp

How to display a user profile pics while the user is logged in php?

I have successfully created a form that submits data and a picture of a user into my online folder and the path directory stored in the database.
My question is this how do I get users to see their picture once they are logged in?
Well Guys thanks for everything but still not getting right here is all my code
Sign Up
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
#apDiv1 {
position:absolute;
width:328px;
height:216px;
z-index:1;
left: 347px;
top: 111px;
}
-->
</style>
</head>
<body>
<div id="apDiv1">
<form method="post" action="logon.php" enctype="multipart/form-data">
<table width="332" height="210" border="0">
<tr>
<td width="155">Email</td>
<td width="167"><input type="text" name="email" /></td>
</tr>
<tr>
<td>Username</td>
<td><input type="text" name="username" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="text" name="password" /></td>
</tr>
<tr>
<td>Upload Passport</td>
<td><label>
<input type="file" name="photo" />
</label></td>
</tr>
<tr>
<td> </td>
<td><label>
<input type="submit" name="submit" value="Sign Up" />
</label></td>
</tr>
</table>
</form>
</div>
</body>
</html>
Logon.php
<?php
include('connection.php');
if (!isset($_FILES['photo']['tmp_name'])) {
echo "";
}else{
$file=$_FILES['photo']['tmp_name'];
$image= addslashes(file_get_contents($_FILES['photo']['tmp_name']));
$image_name= addslashes($_FILES['photo']['name']);
move_uploaded_file($_FILES["photo"]["tmp_name"],"photos/" . $_FILES["photo"]["name"]);
$email=$_POST['email'];
$username=$_POST['username'];
$password=$_POST['password'];
$photo="photos/" . $_FILES["photo"]["name"];
$save=mysql_query("INSERT INTO info (id, email, user_name, password, photo) VALUES ('','$email','$username','$password','$photo')");
/* Redirect visitor to the thank you page */
echo '<script language="javascript">alert("Registration Succesful....")</script>';
echo '<script language="javascript">window.location = "index.php"</script>';
exit();
}
?>
Index.php
<?php
include('login.php'); // Includes Login Script
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
#apDiv1 {
position:absolute;
width:391px;
height:178px;
z-index:1;
left: 334px;
top: 166px;
}
#apDiv2 {
position:absolute;
width:259px;
height:115px;
z-index:1;
left: 380px;
top: 137px;
}
-->
</style>
</head>
<body>
<div id="apDiv2">
<form method="POST" action="">
<table width="260" height="88" border="0">
<tr>
<td width="131">Username</td>
<td width="119"><label>
<input type="text" name="username" />
</label></td>
</tr>
<tr>
<td>Password</td>
<td><input type="text" name="password" /></td>
</tr>
<tr>
<td> </td>
<td><label>
<input type="submit" name="submit" value="Submit" />
</label></td>
</tr>
</table>
<table width="259" border="0">
<tr>
<td align="center">Sign Up</td>
</tr>
</table>
</form>
<p> </p>
</div>
</body>
</html>
login.php
<?php
session_start(); // Starting Session
$error=''; // Variable To Store Error Message
if (isset($_POST['submit'])) {
if (empty($_POST['username']) || empty($_POST['password'])) {
$error = "User ID or Password is invalid";
}
else
{
// Define $username and $password
$username=$_POST['username'];
$password=$_POST['password'];
// To protect MySQL injection for Security purpose
$username = stripslashes($username);
$password = stripslashes($password);
// Establishing Connection with Server by passing server_name, user_id and password as a parameter
$connection = #mysql_connect("localhost", "root", "");
// Selecting Database
$db = mysql_select_db("lesson", $connection);
// SQL query to fetch information of registerd users and finds user match.
$query = mysql_query("select * from info where password='$password' AND user_name='$username'", $connection);
$rows = mysql_num_rows($query);
if ($rows == 1) {
$_SESSION['login_user']=$username; // Initializing Session
header("location: customer_login.php"); // Redirecting To Other Page
} else {
$error = "User ID or Password is invalid";
}
mysql_close($connection); // Closing Connection
}
}
?>
customer_login.php
<?php
include('session_connect.php');
?>
<html>
<body>
<style type="text/css">
<!--
#apDiv1 {
position:absolute;
width:259px;
height:173px;
z-index:1;
left: 25px;
top: 92px;
}
-->
</style>
<div id="apDiv1">
<p>Email: <?php echo $email; ?> </p>
<p>Username: <?php echo $username; ?> </p>
<p>Password: <?php echo $password; ?> </p>
<p>Passport: <?php echo $photo; ?> </p>
</div>
</body>
</html>
session_connect.php
<?php
// Establishing Connection with Server by passing server_name, user_id and password as a parameter
$connection = #mysql_connect("localhost", "root", "");
// Selecting Database
$db = mysql_select_db("lesson", $connection);
session_start();// Starting Session
// Storing Session
$user_check=$_SESSION['login_user'];
// SQL Query To Fetch Complete Information Of User
$ses_sql=mysql_query("select * from info where user_name='$user_check'", $connection);
$row=mysql_fetch_array($ses_sql);
$login_session =$row['user_name'];
$email = $row['email'];//." ".$row['vLastName'];
$username = $row['user_name'];
$password = $row['password'];
$photo = $row['photo'];
if(!isset($login_session)){
mysql_close($connection); // Closing Connection
header('Location: index.php'); // Redirecting To Home Page
}
?>
Instead the above code shows me the pathway in the database i want the actual image to show...thank you
When you store the Image path in the database, there must be a reference (Foreign key or similar) to the corresponding user.
Now, when the user loggs in, you check the table, where your image paths are declared for the specific user:
SELECT imgpath FROM imgpathstable WHERE userid = $loggedInUser["id"]
and then you can display an img tag with:
<?php
echo "<img href='$imgPath' ...
<?php
if(isset($_SESSION['Anyone']))
{
?>
<img src="<?php echo image path ?>"/>
<?php
}
?>

Always returning error in form

I have this registration form but for whatever reason it always returns with that the username is taken. Anyone care to look at it?
<?php
session_start;
include "config.php";
if($_POST['register']) {
if($_POST['email']) {
if($_POST['name']) {
if($_POST['pw1']) {
if($_POST['pw2']) {
if($_POST['pw2'] == $_POST['pw1']) {
$check_query = mysql_query("SELECT * FROM register WHERE username = '" .$_POST['name']. "'");
$check = mysql_num_rows($check_query);
if($check == "0"){
$pw = md5($_POST['pw1']);
mysql_query("INSERT INTO register (username, pass, email)
VALUES ('".$_POST['name']."', '".$pw."', '".$_POST['email']."')") or die(mysql_error());
$notice = "You are registered and you can login <a href='index.php'>here</a>";
}else{//#1 name already exists
$notice = "This username already exists";
}//#1 close
}else{//#2 pw's not the same
$notice = "The passwords are not the same";
}//#2 close
}else{//#3 pw2 not filled in
$notice = "You do have to type in a password";
}//#3 close
}else{//#4 pw 1 not filled in
$notice = "You do have to type in a password";
}//#4 close
}else{//#5 no name
$notice = "You do have to type in a username";
}//#5 close
}else{//#6 no email
$notice = "You do have to type in an email";
}//#6 close
}//post register close
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="bluestyle.css">
<link href='http://fonts.googleapis.com/css?family=Cabin' rel='stylesheet' type='text/css'>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sign Up</title>
</head>
<body>
<center><div id="masterpower">
<img src="headblue.png" id="head">
<div id="h">
<a style="float:right;margin-right:10px;">This</a>
</div>
<div class="holder">
<div class="loppit">
<div id="contt">
<h1>Sign up!</h1><br />
<?php
if($_SESSION['usrid']) {
echo 'You are already logged in, <br />Home';
}else{
if($notice) {
echo $notice, '<br />Back';
}else{
?>
Note: Everything is case-sensitive!
<form id="form1" name="form1" method="post" class="form" action="register.php">
<table>
<tr><td>Username:</td>
<td><input name="name" id="name" class="ipted" type="text" /></td></tr>
<tr><td>Password:</td>
<td><input type="password" class="ipted" id="pw2" name="pw2"/></td></tr>
<tr><td>Password (Verify):</td>
<td><input name="pw1" class="ipted" id="pw1" type="password" /></td></tr>
<td>E-Mail:</td>
<td><input type="text" class="ipted" id="email" name="email" /></td></tr>
<tr><td></td><td><input type="submit" class="ipted" name="register" value="Register" id="register" /></td></tr>
</form>
<?php
}
}
?>
</div>
</div>
</div>
</div>
</center>
</body>
</html>
This is a little more tidy:
<?php
session_start();
include "config.php";
if($_POST['register']) {
$notice = array();
if(empty($_POST['email'])) {
$notice[] = "You do have to type in an email";
}
if(empty($_POST['name'])) {
$notice[] = "You do have to type in a username";
}
if(empty($_POST['pw1']) || empty($_POST['pw2'])) {
$notice[] = "You do have to type in a password";
}
if($_POST['pw2'] == $_POST['pw1']) {
$notice[] = "The passwords are not the same";
}
$check_query = mysql_query("SELECT * FROM register WHERE username = '" .$_POST['name']. "'") or die(mysql_error()); // added " or die(mysql_error())" for debug purpose
if(mysql_num_rows($check_query) != 0){
$notice[] = "This username already exists";
}
if(count($notice) == 0){
$pw = md5($_POST['pw1']);
mysql_query("INSERT INTO register (username, pass, email)
VALUES ('".$_POST['name']."', '".$pw."', '".$_POST['email']."')") or die(mysql_error());
$notice[] = "You are registered and you can login <a href='index.php'>here</a>";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="bluestyle.css">
<link href='http://fonts.googleapis.com/css?family=Cabin' rel='stylesheet' type='text/css'>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sign Up</title>
</head>
<body>
<center><div id="masterpower">
<img src="headblue.png" id="head">
<div id="h">
<a style="float:right;margin-right:10px;">This</a>
</div>
<div class="holder">
<div class="loppit">
<div id="contt">
<h1>Sign up!</h1><br />
<?php
if($_SESSION['usrid']) {
echo 'You are already logged in, <br />Home';
}else{
if(isset($notice) && count($notice) > 0) {
echo implode(', ',$notice), '<br />Back';
}else{
?>
Note: Everything is case-sensitive!
<form id="form1" name="form1" method="post" class="form" action="register.php">
<table>
<tr><td>Username:</td>
<td><input name="name" id="name" class="ipted" type="text" /></td></tr>
<tr><td>Password:</td>
<td><input type="password" class="ipted" id="pw2" name="pw2"/></td></tr>
<tr><td>Password (Verify):</td>
<td><input name="pw1" class="ipted" id="pw1" type="password" /></td></tr>
<td>E-Mail:</td>
<td><input type="text" class="ipted" id="email" name="email" /></td></tr>
<tr><td></td><td><input type="submit" class="ipted" name="register" value="Register" id="register" /></td></tr>
</form>
<?php
}
}
?>
</div>
</div>
</div>
</div>
</center>
</body>
</html>
Try that and see if you get an error.

Categories