Thread: Rcs Error Help

Results 1 to 3 of 3
  1. #1 Rcs Error Help 
    Registered Member
    Join Date
    Apr 2013
    Posts
    42
    Thanks given
    0
    Thanks received
    1
    Rep Power
    9
    Well when i try to set the recovery questions on the rcs files this comes up can anyone help me fix this?

    red part is the problem
    Code:
    Column count doesn't match value count at row 1 Your recovery questions have successfully been set. Please make sure you have written them down somewhere incase you need to use them. Home
    here is the file it says it in at end, the files name is set_recov.php
    Code:
    <?php 
    require('../includes/config.php');
    require('../structure/database.php');
    require('../structure/base.php');
    require('../structure/user.php');
    
    $database = new database($db_host, $db_name, $db_user, $db_password);
    $base = new base($database);
    $user = new user($database);
    
    //set some basic vars
    $username = $user->getUsername($_COOKIE['user'], 2);
    $rank = $user->getRank($username);
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html xmlns:IE>
    
    <head>
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta name="MSSmartTagsPreventParsing" content="TRUE">
    <title><?php echo $data['wb_title']; ?></title>
    <link href="../css/basic-3.css" rel="stylesheet" type="text/css" media="all">
    <link href="../css/main/title-5.css" rel="stylesheet" type="text/css" media="all">
    <link href="../css/kbase/kbase-2.css" rel="stylesheet" type="text/css" media="all" />
    <link rel="shortcut icon" href="../img/favicon.ico" />
    <?php include('../includes/google_analytics.html'); ?>
    <style>
    fieldset {
    	text-align: left;
    	border: 2px solid #625437;
    	width: 95%;
    	position: relative;
    	margin: 10px;
    	padding-left: 10px;
            background-color:transparent;
    }
    
    legend {
    	color: #625437;
    	font-weight: bold;
    	font-size: 15px;
    }
    
    </style>
    <script type="text/javascript">
    function goBack()
    {
    	window.history.back();
    }	
    </script>
    </head>
    
    		<div id="body">
                    <?php $base->getNavBar($username, $path, $rank); ?>
                    <br/><br/>
    		<div style="text-align: center; background: none;">
    				<div class="titleframe e">
    					<b>Set new recovery questions</b><br />
    					<a href="https://www.rune-server.org/programming/website-development/index.php">Main Menu</a>
    				</div>
    			</div>
    
    			
    			<img class="widescroll-top" src="https://www.rune-server.org/programming/website-development/img/scroll/backdrop_765_top.gif" alt="" width="765" height="50" />
    			<div class="widescroll">
    			<div class="widescroll-bgimg">
    			<div class="widescroll-content">
    			<?php
                                //all the recovery questions we're working with
                                $questions[] = array(); 
                                $questions[0] = 'What was your first pet\'s name?';
                                $questions[1] = 'Type in a code you can remember.';
                                $questions[2] = 'Where is your favorite vacation spot?';
                                $questions[3] = 'Who is your favorite author?';
                                $questions[4] = 'What color was your first bedroom?';
                                $questions[5] = 'What was your first car?';
                                
                                
                                if(!$user->isLoggedIn())
                                {
                                        echo 'You must be logged in to access this content.';
                                }
                                else
                                {
                                    //check if they have recoveries set
                                    //variable is set to x to save time typing
                                    $x = $database->processQuery("SELECT `cancel`,`a1`,`a2`,`a3`,`a4`,`a5` FROM `recoveries` WHERE `userid` = ?", array($user->getUserId($_COOKIE['user'])), true);
                                    
                                    if(isset($_POST['answer']))
                                    {
                                        if($database->getRowCount() == 0)
                                        {
                                            //validate answers
                                            $errors = array();
                                            $answers = $_POST['answer'];
                                            $i = 0;
                                            
                                            foreach($answers as $answer)
                                            {
                                                $i++;
                                                
                                                if(strlen($answer) < 3 || strlen($answer) > 35)
                                                {
                                                    $errors[] = 'Question #'. $i .' must be at least three characters and no more than 26 characters.';
                                                }
                                                
                                                if(preg_match('#[^a-zA-Z0-9$ ]#', $answer))
                                                {
                                                    $errors[] = 'Question #'. $i .' contains illegal characters.';
                                                }
                                            }
                                            
                                            if(count($errors) >= 1)
                                            {
                                                //back button
                                                ?> <center><input type="button" value="Back" onclick="goBack()" /></center> <?php
                                                
                                                //display errors
                                                foreach($errors as $error) { echo $error.'<br/>'; }
                                            }
                                            else 
                                            {
                                                //set their recovery questions
                                                $database->processQuery("INSERT INTO `recoveries` VALUES (null, ?, ?, ?, ?, ?, ?, ?, ?, CURDATE())", array($user->getUserId($_COOKIE['user']), 0, $answers[0], $answers[1], $answers[2], $answers[3], $answers[4], $answers[5]), false);
                                                
                                                ?>
                                                    Your recovery questions have successfully been set. Please make sure you have written them down somewhere incase you need to use them. <a href="https://www.rune-server.org/programming/website-development/index.php">Home</a>
                                                <?php
                                            }
                                        }
                                        else
                                        {
                                            //they already have recoveries, they can't set them
                                            ?>
                                                It appears you already have recovery questions set. You cannot change your current recovery questions until you successfully canceled your old ones. 
                                                If you wish to do so, you can cancel your current questions <a href="cancel.php">here</a>. Otherwise, you can <a href="https://www.rune-server.org/programming/website-development/index.php">go home</a>.
                                            <?php
                                        }
                                    }
                                    elseif($database->getRowCount() == 0)
                                    {
                                        ?>
                                
                                            <b>You currently don't have any recovery questions set. Please set them for your own security..</b>
                                            <br/><br/>
                                            <table>
                                                <fieldset class="question">
                                                    <legend>Recovery Questions</legend>
                                                    All recovery questions must be answered. These will be used to recover your account if you ever lose access. Keep this questions written down somewhere <b>safe</b>
                                                    so you can remember them when it's necessary.
                                                    <br/><br/>
                                                    <b>Please Note:</b> Only the characters a-z, A-Z, 0-9, space, and $ are allowed.
                                                </fieldset>
                                                
                                                <form action="set_recov.php" method="POST">
                                                    <table cellpadding="6" style="margin-left:auto;margin-right:auto;">
                                                        <?php 
                                                            $i = 0;
                                                            foreach($questions as $question)
                                                            {
                                                                $i++;
                                                                ?> 
                                                                    <tr><td><b>Question #<?php echo $i; ?></b></td></tr>
                                                                    <tr>
                                                                        <td><?php echo $question; ?></td>
                                                                    </tr> 
                                                                    <tr>
                                                                        <td><input tpye="text" name="answer[]" maxlength="40"></td>
                                                                    </tr>
                                                                <?php
                                                            }
                                                        ?>
                                                    <tr><td><input type="submit" value="Set Recovery Questions"</td></tr>
                                                    </table>
                                                </form>
                                            </table>
                                        <?php
                                    }
                                    else
                                    {
                                        if($x[0]['cancel'] >= 1)
                                        {
                                            //time left until questions are cancelled
                                            $wait = $base->seconds_to_time($x[0]['cancel']-(time()-1209600));
                                            
                                            echo 'Your recovery questions are currently pending cancellation. <b>'. $wait .'</b> until your questions are deleted.';
                                        }
                                        else
                                        {
                                            //they have existing recoveries
                                            ?>
                                                <center><a href="cancel.php">Cancel Recovery Questions</a></center>
                                                Your recovery questions are set.<br/>
                                            <?php
                                        }
                                    }
                                }
                            ?>
                            <center><img src="https://www.rune-server.org/programming/website-development/img/kbase/scroll_spacer.gif" ></center>
    			<div style="clear: both;"></div>
    			</div>
    			</div>
    			</div>
    			<img class="widescroll-bottom" src="https://www.rune-server.org/programming/website-development/img/scroll/backdrop_765_bottom.gif" alt="" width="765" height="50" />
    		<div class="tandc"><?php echo $data['wb_foot']; ?></div>
    	</div>
    	</body>
    </html>
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Apr 2013
    Posts
    42
    Thanks given
    0
    Thanks received
    1
    Rep Power
    9
    bump please help
    Reply With Quote  
     

  3. #3  
    aaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa
    Planets's Avatar
    Join Date
    Aug 2014
    Age
    29
    Posts
    2,159
    Thanks given
    673
    Thanks received
    1,955
    Rep Power
    5000
    read the error, your table structure is malformed

    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Help with RC - Multiple runes
    By JacobiYounger in forum Help
    Replies: 1
    Last Post: 08-08-2013, 05:09 AM
  2. Help with RC/Multiple runes, pure/rune ess
    By JacobiYounger in forum Requests
    Replies: 0
    Last Post: 08-08-2013, 12:22 AM
  3. RCS - Paying for help!
    By Nyminux in forum Application Development
    Replies: 9
    Last Post: 10-27-2012, 02:33 PM
  4. Need gfx help?
    By Beh3moth2 in forum General
    Replies: 1
    Last Post: 04-03-2007, 11:50 AM
  5. Need help choosing sig
    By Zane in forum Showcase
    Replies: 7
    Last Post: 04-02-2007, 03:14 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •