Rockonmetal
04-02-2008, 02:31 AM
A little background information:
this is the fourth part of a comment form on my site... This is the part where the comment gets validated and that the user gets the option of edditing it or posting it. I am having slight problems though... I get:
Notice: Undefined variable: _SESSION in C:\netserver\www\Pureadd\pictures\comment\1c.php on line 8
Notice: Undefined variable: _SESSION in C:\netserver\www\Pureadd\pictures\comment\1c.php on line 9
Notice: Undefined variable: _SESSION in C:\netserver\www\Pureadd\pictures\comment\1c.php on line 10
Notice: Undefined variable: _SESSION in C:\netserver\www\Pureadd\pictures\comment\1c.php on line 11
Here is the code for that page:
<!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" />
<script language="javascript" type="text/javascript" src="niceforms.js"></script>
<style type="text/css" media="screen">@import url(niceforms-default.css);</style>
<?php
$username = $_SESSION['Username']; // Line 8
$password = $_SESSION['Password']; // Line 9
$email = $_SESSION['Email']; // Line 10
$ID = $_SESSION['ID']; // Line 11
$rating = $_POST['rating'];
$comment = strip_tags($_POST['Comment']);
$lcomment = strlen($comment);
if($lcomment<=400 && $lcomment>=3){
$correct = 0;
$correct++;
}else{
$correct = $correct*0;
}
if($rating<=5 && $rating>=0){
$correct++;
}else{
$correct = $correct*0;
}
$time = date('h:i:s A');
$date = date('m/d/Y');
?>
</head>
<body>
<div id="container">
<form action="1d.php" method="post" class="niceform">
<br />Hey <?php echo $username;?>! Check your comment to make sure its what you want to say!
<label for="Comment">Your Comment</label>
<br /><?php $comment; ?>
<br />
<label for="rating">Rating:</label>
You are rating the DVD Rewinder at <?php echo $rating; ?> stars.
<br />
<?php
if($correct==2){
echo '<br /><a href="1b.php">Edit your comment and or rating!</a>';
echo '<br /><input type="submit" value="Post Comment" />';
}else{
echo '<br /><a href="1b.php">You need to edit your comment</a>';
}
?>
</form>
</div>
</body>
</html>
Either I don't think I set the Session variables correctly because i just do this to set the Session variables:
$_SESSION['Username'] = $_POST['username'];
It was working before I re-did the code to fix the ad link problem... *Not evident on this page...*
this is the fourth part of a comment form on my site... This is the part where the comment gets validated and that the user gets the option of edditing it or posting it. I am having slight problems though... I get:
Notice: Undefined variable: _SESSION in C:\netserver\www\Pureadd\pictures\comment\1c.php on line 8
Notice: Undefined variable: _SESSION in C:\netserver\www\Pureadd\pictures\comment\1c.php on line 9
Notice: Undefined variable: _SESSION in C:\netserver\www\Pureadd\pictures\comment\1c.php on line 10
Notice: Undefined variable: _SESSION in C:\netserver\www\Pureadd\pictures\comment\1c.php on line 11
Here is the code for that page:
<!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" />
<script language="javascript" type="text/javascript" src="niceforms.js"></script>
<style type="text/css" media="screen">@import url(niceforms-default.css);</style>
<?php
$username = $_SESSION['Username']; // Line 8
$password = $_SESSION['Password']; // Line 9
$email = $_SESSION['Email']; // Line 10
$ID = $_SESSION['ID']; // Line 11
$rating = $_POST['rating'];
$comment = strip_tags($_POST['Comment']);
$lcomment = strlen($comment);
if($lcomment<=400 && $lcomment>=3){
$correct = 0;
$correct++;
}else{
$correct = $correct*0;
}
if($rating<=5 && $rating>=0){
$correct++;
}else{
$correct = $correct*0;
}
$time = date('h:i:s A');
$date = date('m/d/Y');
?>
</head>
<body>
<div id="container">
<form action="1d.php" method="post" class="niceform">
<br />Hey <?php echo $username;?>! Check your comment to make sure its what you want to say!
<label for="Comment">Your Comment</label>
<br /><?php $comment; ?>
<br />
<label for="rating">Rating:</label>
You are rating the DVD Rewinder at <?php echo $rating; ?> stars.
<br />
<?php
if($correct==2){
echo '<br /><a href="1b.php">Edit your comment and or rating!</a>';
echo '<br /><input type="submit" value="Post Comment" />';
}else{
echo '<br /><a href="1b.php">You need to edit your comment</a>';
}
?>
</form>
</div>
</body>
</html>
Either I don't think I set the Session variables correctly because i just do this to set the Session variables:
$_SESSION['Username'] = $_POST['username'];
It was working before I re-did the code to fix the ad link problem... *Not evident on this page...*