3raser Posted June 12, 2010 Share Posted June 12, 2010 After my previous topic, thanks to the support of the users, I have switched my code up a bit and "cleaned" it. I have put stuff in a bit better format. But my problem, is that after I type in the pass-code, and click Edit - It sends me to the success message, without even taking me to the form first. I've set everything to isset, and without even submitting anything on the form, why is it saying it's successful? Because the values can't even be set yet. Code: <?php $id = $_GET['id']; $passcode = $_GET['passcode']; $passcode_fresh = $_POST['passcodefresh']; $id_fresh = $_POST['idfresh']; $mysql_host = ""; $mysql_database = ""; $mysql_user = ""; $mysql_password = ""; //connect to database mysql_connect("$mysql_host","$mysql_user","$mysql_password"); mysql_select_db("$mysql_database"); //extract $extract = mysql_query("SELECT * FROM reviews WHERE id='$id'"); $numrows = mysql_num_rows($extract); while ($row = mysql_fetch_assoc($extract)) { $dpasscode = $row['passcode']; } $design2 = $_POST['design']; $designt2 = $_POST['designtext']; $grammar2 = $_POST['grammar']; $grammart2 = $_POST['grammartext']; $layout2 = $_POST['layout']; $layoutt2 = $_POST['layouttext']; $moderation2 = $_POST['moderation']; $moderationt2 = $_POST['moderationtext']; $activity2 = $_POST['activity']; $activityt2 = $_POST['activitytext']; $overall2 = $_POST['overall']; $overallt2 = $_POST['overalltext']; $design2 = mysql_real_escape_string($design); $designt2 = mysql_real_escape_string($designt); $grammar2 = mysql_real_escape_string($grammar); $grammart2 = mysql_real_escape_string($grammart); $layout2 = mysql_real_escape_string($layout); $layoutt2 = mysql_real_escape_string($layoutt); $moderation2 = mysql_real_escape_string($moderation); $moderationt2 = mysql_real_escape_string($moderationt); $activity2 = mysql_real_escape_string($activity); $activityt2 = mysql_real_escape_string($activityt); $overall2 = mysql_real_escape_string($overall); $overallt2 = mysql_real_escape_string($overallt); $passcode2 = mysql_real_escape_string($passcode); $ip = $_SERVER['REMOTE_ADDR']; if(isset($id, $passcode)) { if (isset($design2, $designt2, $grammar2, $grammart2, $layout2, $layoutt2, $moderation2, $moderationt2, $activity2, $activityt2, $overall2, $overallt2)) { echo "<div id='signuptop'>Success</div><div id='signup'>You have successfully edited the review!</div>"; } elseif($passcode==$dpasscode) { //extract $extract = mysql_query("SELECT * FROM reviews WHERE id='$id'"); $numrows = mysql_num_rows($extract); while ($row = mysql_fetch_assoc($extract)) { $id = $row['id']; $name = $row['name']; $site = $row['url']; $design = $row['design']; $designt = $row['designt']; $grammar = $row['grammar']; $grammart = $row['grammart']; $layout = $row['layout']; $layoutt = $row['layoutt']; $moderation = $row['moderation']; $moderationt = $row['moderationt']; $activity = $row['activity']; $activityt = $row['activityt']; $overall = $row['overall']; $overallt = $row['overallt']; $total = $row['total']; $views = $row['views']; $status = $row['status']; } echo '<div id="signuptop">Edit a Review</div><div id="signup"><form action="edit.php" method="POST"><br/> <input type="hidden" name="idfresh" value="'. $id .'"> <input type="hidden" name="passcodefresh" value="'. $passcode .'"> Appearance: <select name="design"> <option value="'. $design .'">'. $design .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br/> <textarea name="designtext" cols="30" rows="13" maxlength="450">'. $designt .'</textarea><br/> <br/><br/>Grammar Usage <select name="grammar"> <option value="'. $grammar .'">'. $grammar .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br /> <textarea name="grammartext" cols="30" rows="13" maxlength="450">'. $grammart .'</textarea><br/> <br/><br/>Layout <select name="layout"> <option value="'. $layout .'">'. $layout .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br /> <textarea name="layouttext" cols="30" rows="13" maxlength="450">'. $layoutt .'</textarea><br/> <br/><br/>Moderation <select name="moderation"> <option value="'. $moderation .'">'. $moderation .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br /> <textarea name="moderationtext" cols="30" rows="13" maxlength="450">'. $moderationt .'</textarea><br/> <br/><br/>User Activity <select name="activity"> <option value="'. $activity .'">'. $activity .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br /> <textarea name="activitytext" cols="30" rows="13" maxlength="450">'. $activityt .'</textarea><br/> <br/><br/>Overall Score <select name="overall"> <option value="'. $overall .'">'. $overall .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br /> <textarea name="overalltext" cols="30" rows="13" maxlength="450">'. $overallt .'</textarea><br/> <input type="hidden" name="checker" value="1"> <br/><br/><br/> <input type="submit" value="Edit Review"></form></div>'; } } elseif(!$id && !$id_fresh) { echo '<div id="signuptop">Error</div><div id="signup">Sorry, you must select a review to edit. Go back and select a review! <a href="index.php">Home</a></div>'; } elseif(!$passcode && !$passcode_fresh) { echo '<div id="signuptop">Error</div><div id="signup">Please enter in the Pass-code to edit this review:<br/><br/><form action="edit.php" method="GET"><input type="hidden" name="id" value="'. $id .'"><input type="text" name="passcode" maxlength="6"><input type="submit" value="Enter"></form><br/><br/></div>'; } else { echo '<div id="signuptop">Error</div><div id="signup">Incorrect pass-code! Please <a href="edit.php?id='. $id .'">go back</a> and try again!</div>'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/ Share on other sites More sharing options...
mrMarcus Posted June 12, 2010 Share Posted June 12, 2010 I am not seeing where these variables are first being set: $design2 = mysql_real_escape_string($design); $designt2 = mysql_real_escape_string($designt); $grammar2 = mysql_real_escape_string($grammar); $grammart2 = mysql_real_escape_string($grammart); $layout2 = mysql_real_escape_string($layout); $layoutt2 = mysql_real_escape_string($layoutt); $moderation2 = mysql_real_escape_string($moderation); $moderationt2 = mysql_real_escape_string($moderationt); $activity2 = mysql_real_escape_string($activity); $activityt2 = mysql_real_escape_string($activityt); $overall2 = mysql_real_escape_string($overall); $overallt2 = mysql_real_escape_string($overallt); $passcode2 = mysql_real_escape_string($passcode); $design, $designt, $grammar, etc. if (isset($design2, $designt2, $grammar2, $grammart2, $layout2, $layoutt2, $moderation2, $moderationt2, $activity2, $activityt2, $overall2, $overallt2)) And the variables you are checking above have in fact been set, they just might not contain a value. Use !empty() instead of isset() to check whether a variable has value or not. empty Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071008 Share on other sites More sharing options...
3raser Posted June 12, 2010 Author Share Posted June 12, 2010 I am not seeing where these variables are first being set: $design2 = mysql_real_escape_string($design); $designt2 = mysql_real_escape_string($designt); $grammar2 = mysql_real_escape_string($grammar); $grammart2 = mysql_real_escape_string($grammart); $layout2 = mysql_real_escape_string($layout); $layoutt2 = mysql_real_escape_string($layoutt); $moderation2 = mysql_real_escape_string($moderation); $moderationt2 = mysql_real_escape_string($moderationt); $activity2 = mysql_real_escape_string($activity); $activityt2 = mysql_real_escape_string($activityt); $overall2 = mysql_real_escape_string($overall); $overallt2 = mysql_real_escape_string($overallt); $passcode2 = mysql_real_escape_string($passcode); $design, $designt, $grammar, etc. if (isset($design2, $designt2, $grammar2, $grammart2, $layout2, $layoutt2, $moderation2, $moderationt2, $activity2, $activityt2, $overall2, $overallt2)) And the variables you are checking above have in fact been set, they just might not contain a value. Use !empty() instead of isset() to check whether a variable has value or not. empty The variables are set above that $design2 = $_POST['design']; $designt2 = $_POST['designtext']; $grammar2 = $_POST['grammar']; $grammart2 = $_POST['grammartext']; $layout2 = $_POST['layout']; $layoutt2 = $_POST['layouttext']; $moderation2 = $_POST['moderation']; $moderationt2 = $_POST['moderationtext']; $activity2 = $_POST['activity']; $activityt2 = $_POST['activitytext']; $overall2 = $_POST['overall']; $overallt2 = $_POST['overalltext']; So isset doesn't check if it actually have something in the string? Thats new. Didn't know it just checked if it's assigned a value. I'll try that out and see where it goes. Edit: By the way, I would change it to empty on all the issets right? I'm just checking to see if they have anything in them. Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071015 Share on other sites More sharing options...
mrMarcus Posted June 12, 2010 Share Posted June 12, 2010 $design is not set in the script. $design2 is set, but $design is not. isset returns false only on a NULL value/state. Not assigning a value to a variable does not denote a NULL state, but instead just an empty/no value state. Thing is, I'm not sure how to answer that your question in that you should always handle your variables to avoid conditions failing due to variables having no value. But yes, you can play with empty() as it will check for variables with no value(s). Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071021 Share on other sites More sharing options...
3raser Posted June 12, 2010 Author Share Posted June 12, 2010 But I don't see the variable $design anywhere. Can you point me out to it? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071029 Share on other sites More sharing options...
vhaxu Posted June 12, 2010 Share Posted June 12, 2010 $design2 = mysql_real_escape_string($design); Maybe? Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071030 Share on other sites More sharing options...
3raser Posted June 12, 2010 Author Share Posted June 12, 2010 Oh, thanks. Forgot all about that. :/ Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071032 Share on other sites More sharing options...
3raser Posted June 12, 2010 Author Share Posted June 12, 2010 <html> <head> <title>Review Tracks</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <center> <div class="holder"> <?php $id = $_GET['id']; $passcode = $_GET['passcode']; $passcode_fresh = $_POST['passcodefresh']; $id_fresh = $_POST['idfresh']; $mysql_host = "mysql6.000webhost.com"; $mysql_database = "a3993404_info"; $mysql_user = "a3993404_info"; $mysql_password = "pebopebo9696"; //connect to database mysql_connect("$mysql_host","$mysql_user","$mysql_password"); mysql_select_db("$mysql_database"); //extract $extract = mysql_query("SELECT * FROM reviews WHERE id='$id'"); $numrows = mysql_num_rows($extract); while ($row = mysql_fetch_assoc($extract)) { $dpasscode = $row['passcode']; } $design2 = $_POST['design']; $designt2 = $_POST['designtext']; $grammar2 = $_POST['grammar']; $grammart2 = $_POST['grammartext']; $layout2 = $_POST['layout']; $layoutt2 = $_POST['layouttext']; $moderation2 = $_POST['moderation']; $moderationt2 = $_POST['moderationtext']; $activity2 = $_POST['activity']; $activityt2 = $_POST['activitytext']; $overall2 = $_POST['overall']; $overallt2 = $_POST['overalltext']; $design2 = mysql_real_escape_string($design2); $designt2 = mysql_real_escape_string($designt2); $grammar2 = mysql_real_escape_string($grammar2); $grammart2 = mysql_real_escape_string($grammart2); $layout2 = mysql_real_escape_string($layout2); $layoutt2 = mysql_real_escape_string($layoutt2); $moderation2 = mysql_real_escape_string($moderation2); $moderationt2 = mysql_real_escape_string($moderationt2); $activity2 = mysql_real_escape_string($activity2); $activityt2 = mysql_real_escape_string($activityt2); $overall2 = mysql_real_escape_string($overall2); $overallt2 = mysql_real_escape_string($overallt2); $passcode2 = mysql_real_escape_string($passcode2); $ip = $_SERVER['REMOTE_ADDR']; if(!$id && !$passcode) { if (!$design2 || !$designt2 || !$grammar || !$grammart2 || !$layout2 || !$layoutt2 || !$moderation2 || !$moderationt2 || !$activity2 || !$activityt2 || !$overall2 || !$overallt2) { echo "<div id='signuptop'>Success</div><div id='signup'>You have successfully edited the review!</div>"; } elseif($passcode==$dpasscode) { //extract $extract = mysql_query("SELECT * FROM reviews WHERE id='$id'"); $numrows = mysql_num_rows($extract); while ($row = mysql_fetch_assoc($extract)) { $id = $row['id']; $name = $row['name']; $site = $row['url']; $design = $row['design']; $designt = $row['designt']; $grammar = $row['grammar']; $grammart = $row['grammart']; $layout = $row['layout']; $layoutt = $row['layoutt']; $moderation = $row['moderation']; $moderationt = $row['moderationt']; $activity = $row['activity']; $activityt = $row['activityt']; $overall = $row['overall']; $overallt = $row['overallt']; $total = $row['total']; $views = $row['views']; $status = $row['status']; } echo '<div id="signuptop">Edit a Review</div><div id="signup"><form action="edit.php" method="POST"><br/> <input type="hidden" name="idfresh" value="'. $id .'"> <input type="hidden" name="passcodefresh" value="'. $passcode .'"> Appearance: <select name="design"> <option value="'. $design .'">'. $design .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br/> <textarea name="designtext" cols="30" rows="13" maxlength="450">'. $designt .'</textarea><br/> <br/><br/>Grammar Usage <select name="grammar"> <option value="'. $grammar .'">'. $grammar .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br /> <textarea name="grammartext" cols="30" rows="13" maxlength="450">'. $grammart .'</textarea><br/> <br/><br/>Layout <select name="layout"> <option value="'. $layout .'">'. $layout .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br /> <textarea name="layouttext" cols="30" rows="13" maxlength="450">'. $layoutt .'</textarea><br/> <br/><br/>Moderation <select name="moderation"> <option value="'. $moderation .'">'. $moderation .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br /> <textarea name="moderationtext" cols="30" rows="13" maxlength="450">'. $moderationt .'</textarea><br/> <br/><br/>User Activity <select name="activity"> <option value="'. $activity .'">'. $activity .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br /> <textarea name="activitytext" cols="30" rows="13" maxlength="450">'. $activityt .'</textarea><br/> <br/><br/>Overall Score <select name="overall"> <option value="'. $overall .'">'. $overall .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br /> <textarea name="overalltext" cols="30" rows="13" maxlength="450">'. $overallt .'</textarea><br/> <input type="hidden" name="checker" value="1"> <br/><br/><br/> <input type="submit" value="Edit Review"></form></div>'; } } elseif(!$id && !$id_fresh) { echo '<div id="signuptop">Error</div><div id="signup">Sorry, you must select a review to edit. Go back and select a review! <a href="index.php">Home</a></div>'; } elseif(!$passcode && !$passcode_fresh) { echo '<div id="signuptop">Error</div><div id="signup">Please enter in the Pass-code to edit this review:<br/><br/><form action="edit.php" method="GET"><input type="hidden" name="id" value="'. $id .'"><input type="text" name="passcode" maxlength="6"><input type="submit" value="Enter"></form><br/><br/></div>'; } else { echo '<div id="signuptop">Error</div><div id="signup">Incorrect pass-code! Please <a href="edit.php?id='. $id .'">go back</a> and try again!</div>'; } ?> </div> </center> </body> </html> Alright, I've fixed the Success message bug. Now, it tells me the passcode is incorrect when I enter in the correct code. The code is correct though: if($passcode==$dpasscode) Why doesn't it work? Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071033 Share on other sites More sharing options...
3raser Posted June 12, 2010 Author Share Posted June 12, 2010 Bumpo Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071241 Share on other sites More sharing options...
mrMarcus Posted June 12, 2010 Share Posted June 12, 2010 The code might be correct, but the values might not. run this in your code somewhere: <?php echo $passcode .' : '. $dpasscode; See if they match .. exactly. NOTE: In terms of efficiency, try and only pull columns from a table that you will be using. For example, you are only using column `passcode` from your db table, however, you have selected all (*). Change your query to this: $extract = mysql_query("SELECT `passcode` FROM reviews WHERE id='$id'"); Not that you are going to see a difference I'm sure, but when your db tables start to get into the 100,000's of records stage, you'll see a significant difference. Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071245 Share on other sites More sharing options...
3raser Posted June 12, 2010 Author Share Posted June 12, 2010 Thanks for the reply. Yes, they do match: f2a76h : f2a76h And thanks for that code, I never really knew about that. I've updated it with that code. I think this is one of the most impossible codes to figure out. I don't know what I'm doing wrong. But I appreciate the help, as I've learned many new things to help me. Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071250 Share on other sites More sharing options...
3raser Posted June 13, 2010 Author Share Posted June 13, 2010 Bump. Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071334 Share on other sites More sharing options...
kenrbnsn Posted June 13, 2010 Share Posted June 13, 2010 Make absolutely sure they match. There may be spaces on either end which you're not seeing. The only way to make absolutely sure is to compare the string lengths of the strings. <?php echo strlen($passcode) .' : '. strlen($dpasscode); ?> and <?php echo strlen(trim($passcode)) .' : '. strlen(trim($dpasscode)); ?> If the first lengths are not equal, but the second are, you've found your problem. Ken Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071337 Share on other sites More sharing options...
3raser Posted June 13, 2010 Author Share Posted June 13, 2010 Make absolutely sure they match. There may be spaces on either end which you're not seeing. The only way to make absolutely sure is to compare the string lengths of the strings. <?php echo strlen($passcode) .' : '. strlen($dpasscode); ?> and <?php echo strlen(trim($passcode)) .' : '. strlen(trim($dpasscode)); ?> If the first lengths are not equal, but the second are, you've found your problem. Ken Maybe it's something else. Because both codes returned 6 : 6. This is getting hopeless. I know the bug is in there somewhere, it's just mocking me like crazy! Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071339 Share on other sites More sharing options...
3raser Posted June 13, 2010 Author Share Posted June 13, 2010 Current code: <html> <head> <title>Review Tracks</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <center> <div class="holder"> <?php $id = $_GET['id']; $passcode = $_GET['passcode']; $passcode_fresh = $_POST['passcodefresh']; $id_fresh = $_POST['idfresh']; //connect to database mysql_connect("$mysql_host","$mysql_user","$mysql_password"); mysql_select_db("$mysql_database"); //extract $extract = mysql_query("SELECT `passcode` FROM reviews WHERE id='$id'"); $numrows = mysql_num_rows($extract); while ($row = mysql_fetch_assoc($extract)) { $dpasscode = $row['passcode']; } $design2 = $_POST['design']; $designt2 = $_POST['designtext']; $grammar2 = $_POST['grammar']; $grammart2 = $_POST['grammartext']; $layout2 = $_POST['layout']; $layoutt2 = $_POST['layouttext']; $moderation2 = $_POST['moderation']; $moderationt2 = $_POST['moderationtext']; $activity2 = $_POST['activity']; $activityt2 = $_POST['activitytext']; $overall2 = $_POST['overall']; $overallt2 = $_POST['overalltext']; $design2 = mysql_real_escape_string($design2); $designt2 = mysql_real_escape_string($designt2); $grammar2 = mysql_real_escape_string($grammar2); $grammart2 = mysql_real_escape_string($grammart2); $layout2 = mysql_real_escape_string($layout2); $layoutt2 = mysql_real_escape_string($layoutt2); $moderation2 = mysql_real_escape_string($moderation2); $moderationt2 = mysql_real_escape_string($moderationt2); $activity2 = mysql_real_escape_string($activity2); $activityt2 = mysql_real_escape_string($activityt2); $overall2 = mysql_real_escape_string($overall2); $overallt2 = mysql_real_escape_string($overallt2); $passcode2 = mysql_real_escape_string($passcode2); $ip = $_SERVER['REMOTE_ADDR']; if(!$id && !$passcode) { if (!$design2 || !$designt2 || !$grammar || !$grammart2 || !$layout2 || !$layoutt2 || !$moderation2 || !$moderationt2 || !$activity2 || !$activityt2 || !$overall2 || !$overallt2) { echo "<div id='signuptop'>Success</div><div id='signup'>You have successfully edited the review!</div>"; } elseif($passcode==$dpasscode) { //extract $extract = mysql_query("SELECT * FROM reviews WHERE id='$id'"); $numrows = mysql_num_rows($extract); while ($row = mysql_fetch_assoc($extract)) { $id = $row['id']; $name = $row['name']; $site = $row['url']; $design = $row['design']; $designt = $row['designt']; $grammar = $row['grammar']; $grammart = $row['grammart']; $layout = $row['layout']; $layoutt = $row['layoutt']; $moderation = $row['moderation']; $moderationt = $row['moderationt']; $activity = $row['activity']; $activityt = $row['activityt']; $overall = $row['overall']; $overallt = $row['overallt']; $total = $row['total']; $views = $row['views']; $status = $row['status']; } echo '<div id="signuptop">Edit a Review</div><div id="signup"><form action="edit.php" method="POST"><br/> <input type="hidden" name="idfresh" value="'. $id .'"> <input type="hidden" name="passcodefresh" value="'. $passcode .'"> Appearance: <select name="design"> <option value="'. $design .'">'. $design .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br/> <textarea name="designtext" cols="30" rows="13" maxlength="450">'. $designt .'</textarea><br/> <br/><br/>Grammar Usage <select name="grammar"> <option value="'. $grammar .'">'. $grammar .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br /> <textarea name="grammartext" cols="30" rows="13" maxlength="450">'. $grammart .'</textarea><br/> <br/><br/>Layout <select name="layout"> <option value="'. $layout .'">'. $layout .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br /> <textarea name="layouttext" cols="30" rows="13" maxlength="450">'. $layoutt .'</textarea><br/> <br/><br/>Moderation <select name="moderation"> <option value="'. $moderation .'">'. $moderation .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br /> <textarea name="moderationtext" cols="30" rows="13" maxlength="450">'. $moderationt .'</textarea><br/> <br/><br/>User Activity <select name="activity"> <option value="'. $activity .'">'. $activity .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br /> <textarea name="activitytext" cols="30" rows="13" maxlength="450">'. $activityt .'</textarea><br/> <br/><br/>Overall Score <select name="overall"> <option value="'. $overall .'">'. $overall .'</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> /10<br /> <textarea name="overalltext" cols="30" rows="13" maxlength="450">'. $overallt .'</textarea><br/> <input type="hidden" name="checker" value="1"> <br/><br/><br/> <input type="submit" value="Edit Review"></form></div>'; } } elseif(!$id && !$id_fresh) { echo '<div id="signuptop">Error</div><div id="signup">Sorry, you must select a review to edit. Go back and select a review! <a href="index.php">Home</a></div>'; } elseif(!$passcode && !$passcode_fresh) { echo '<div id="signuptop">Error</div><div id="signup">Please enter in the Pass-code to edit this review:<br/><br/><form action="edit.php" method="GET"><input type="hidden" name="id" value="'. $id .'"><input type="text" name="passcode" maxlength="6"><input type="submit" value="Enter"></form><br/><br/></div>'; } else { echo '<div id="signuptop">Error</div><div id="signup">Incorrect pass-code! Please <a href="edit.php?id='. $id .'">go back</a> and try again!</div>'; echo strlen($passcode) .' : '. strlen($dpasscode); echo "<br/><br/>"; echo strlen(trim($passcode)) .' : '. strlen(trim($dpasscode)); } ?> </div> </center> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071343 Share on other sites More sharing options...
3raser Posted June 13, 2010 Author Share Posted June 13, 2010 Bump :'( Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071350 Share on other sites More sharing options...
3raser Posted June 13, 2010 Author Share Posted June 13, 2010 Bump Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071545 Share on other sites More sharing options...
3raser Posted June 13, 2010 Author Share Posted June 13, 2010 Bump Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071585 Share on other sites More sharing options...
3raser Posted June 13, 2010 Author Share Posted June 13, 2010 Bump Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071624 Share on other sites More sharing options...
3raser Posted June 14, 2010 Author Share Posted June 14, 2010 Am I ever going to get an answer?... Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071638 Share on other sites More sharing options...
kenrbnsn Posted June 14, 2010 Share Posted June 14, 2010 Not everyone works all weekend.... Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071641 Share on other sites More sharing options...
3raser Posted June 14, 2010 Author Share Posted June 14, 2010 I know that...but it's been about 4 days since I've gotten an answer. But I understand. Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071645 Share on other sites More sharing options...
3raser Posted June 14, 2010 Author Share Posted June 14, 2010 Bump Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071669 Share on other sites More sharing options...
kenrbnsn Posted June 14, 2010 Share Posted June 14, 2010 No, it's been about a day. Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071686 Share on other sites More sharing options...
3raser Posted June 14, 2010 Author Share Posted June 14, 2010 No dude, this is my second thread. Quote Link to comment https://forums.phpfreaks.com/topic/204538-displaying-the-wrong-message/#findComment-1071691 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.