Ok... i have the code for the series of pages here:
1.php:
Code:
<!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>
<title>Pureadd</title>
</head>
<body>
<div id="container">
<form action="1a.php" class="niceform" method="post">
<label for="Username">Username:</label>
<br />
<input type="text" id="textinput" name="Username" size="12"/>
<br />
<br />
<label for="Password">Password:</label>
<br />
<input type="Password" id="passwordinput" name="Password" size="12"/>
<br />
<input type="submit" value="Login"/>
</form>
</div>
</body>
</html>
1a.php:
Code:
<!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>
</head>
<body>
<?php
$_SESSION['Username'] = $_POST['Username'];
$username = $_POST['Username'];
$_SESSION['Password'] = $_POST['Password'];
$password = $_POST['Password'];
$con = mysql_connect("localhost","admin","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("markmon_pureadd_userbase", $con);
$result = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password' ");
while($row = mysql_fetch_array($result))
{
$combination = "" . $username . "" . $password . "";
$mysqlcombination = "" . $row['username'] . "" . $row['password'] . "";
if($combination=$mysqlcombination){
if($row['rights']=="Suspended"){
$ID= $row['ID'];
echo "Sorry your account has been suspended see your account's suspension report here:";
echo '<a href="http://www.pureadd.com/report.php?p=' . $ID . '">Click to read</a>';
}elseif($row['rights']=="Full"){
$_SESSION['ID'] = $row['ID'];
$_SESSION['Email'] = $row['email'];
include("login_log.php");
include("1b.php");
}
}elseif($combination!=$mysqlcombination || $row['rights']!="Full"){
include("redirect.php");
}
}
?>
</body>
1b.php:
Code:
<!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>
</head>
<body>
<?php
$username = $_SESSION['Username'];
$password = $_SESSION['Password'];
$email = $_SESSION['Email'];
$ID = $_SESSION['ID'];
?>
<div id="container">
<form action="1c.php" method="post" class="niceform">
<br />Hey <?php echo $username; ?>! Your gonna make a comment for the DVD Rewinder! Remember to keep your comment's content PG-13. Vulgar messages containing content past the PG-13 mark are deteled and also result in suspension of your account for one to three weeks depending on the vulgarity of the comment! Thanks! Here some helpful tips when leaving comments:
<ol>
<li>Try to tell what made you laugh</li>
<li>Why you think this deserves your rating</li>
<li>Express what you think but don't say you know something behind the scenes!</li>
<li>ABSOLUTELY NO SIGNITURES! (They're really annoying and waste space)</li>
</ol>
<br />
<label for="Comment">Your Comment</label>
<br /><textarea id="textareainput" name="Comment" cols="50" rows="6"></textarea>
<br />Only text please... All scripts will be removed... Any comments containing links will be deleted even if they link to another image on Pureadd. If you want to compare its ok to!
<label for="rating">Rating:</label>
<br /><input type="radio" id="option1" value="0" name="rating" />
<label for="option1">0 Stars (Not even funny)</label>
<br /><input type="radio" id="option2" value="1" name="rating" />
<label for="option2">1 Star (Chuckled)</label>
<br /><input type="radio" id="option3" value="2" name="rating" />
<label for="option3">2 Stars (Laughed)</label>
<br /><input type="radio" id="option4" value="3" name="rating" />
<label for="option4">3 Stars (Laughed for half a minute)</label>
<br /><input type="radio" id="option5" value="4" name="rating" />
<label for="option5">4 Stars (Laughed for a minute)</label>
<br /><input type="radio" id="option6" value="5" name="rating" />
<label for="option5">5 Stars (Laughed or still laughing hysterically) </label>
<br />
<br /><input type="submit" value="Preview Comment" />
</form>
</div>
</body>
</html>
1c.php: (where problem is occuring)
Code:
<!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>
</head>
<body>
<?php
$username = $_SESSION['Username'];
$password = $_SESSION['Password'];
$email = $_SESSION['Email'];
$ID = $_SESSION['ID'];
$rating = $_POST['rating'];
$comment1 = $_POST['Comment'];
$comment = strip_tags($comment1);
$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');
?>
<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 the computer hates me or I haven't registered the Session variables correctly...
Thanks
Bookmarks