i can't get the following $resultCheck to redirect

42
January 13, 2019, at 04:50 AM

I have the following code and it is displaying the select tag options as $level1promo_competition based on what is in my database. The thing that is puzzing me is that if I changed the name in my database or my variable to something else other than what is in my database, I can't get my $resultCheck to display a value of 1... and it should redirect me because it doesn't match the database....

<?php
include_once __DIR__.'/header2.php';
if(!isset($_SESSION['u_uid'])) {
     echo "<meta http-equiv='refresh' content='0;url=index.php?level1promoform_form2=notlogin'>"; 
    exit();
} else {
    if(!isset($_POST['submit'])) {
        header("Location: level1promoform.php?level1promoform_form2=error");
        exit();
    } else {
        include_once __DIR__.'/includes/dbh.php';
        $level1promo_competition = 
        strip_tags($_POST['level1promo_competition']);
        if ($level1promo_competition == 'January\'s Competition') {
           $sql = "SELECT * FROM level1promo WHERE name = ?;";
           $stmt = mysqli_stmt_init($conn);
           if(!mysqli_stmt_prepare($stmt, $sql)) {
              echo "SQL error";
           } else {
              mysqli_stmt_bind_param($stmt, "s", $level1promo_competition);
              mysqli_stmt_execute($stmt);
              $result = mysqli_stmt_get_result($stmt);
              $resultCheck = mysqli_num_rows($result);
              $row = mysqli_fetch_assoc($result);
              echo $resultCheck;
              if($resultCheck < 1) {
                  echo "<meta http-equiv='refresh' content='0;url=level1promoform.php?level1promoform_form2=error'>"; 
              exit();
          } else {
               echo '<form action="level1promoform_form2_process.php" method="POST">
             <table class="admin_level1promoform_form2">
            <tr>
            <th colspan="2" class="update_title">Welcome to the Administrator\'s Level 1 Promo Competition Form\' Section</th>
            </tr>
            <tr>
           <th>Competition Entry ID:</th><td>',htmlspecialchars($row['id']),'</td>
           </tr>
           <tr>
           <th>Competition\'s Name:</th><td>',htmlspecialchars($row['name']),'</td>
           </tr>
           <tr>
           <th>Competition\'s opening date:</th><td>',htmlspecialchars($row['opening_date']),'</td>
           </tr>
           <tr>
           <th>Competition\'s closing date:</th><td>',htmlspecialchars($row['closing_date']),'</td>
           </tr>
           <tr>
           <th>Competition\'s Points\' Required:</th><td>',htmlspecialchars($row['points']),'</td>
           </tr>
           <tr>
           <th>Enter Points Amount:</th><td><input type="text" name="amount" value="Enter Amount"></td>
           </tr>
           <tr>
           <th></th><td><input type="submit" name="submit" value="Submit Competition"</td>
           </tr>
           </table>
           </form>';
          } 
        } 
        } 
}
}
READ ALSO
how to call json with and without data [on hold]

how to call json with and without data [on hold]

i tried to make a json from php and want it can be get with data like http://localhost/moviereview/?action=get_review&genre=biography and or without data like http://localhost/moviereview/?action=get_review

32
Image from database is not appearing on the .jsp page [on hold]

Image from database is not appearing on the .jsp page [on hold]

The screenshot below shows my web page that is not showing the imageCan someone see why that might be

26
convert the url &amp; hashtag into link

convert the url & hashtag into link

In my code I have #hashtag standing but also Iframe + URL but It shows only the hashtag further it does not show the Iframe + URL

23