Jump to content

What is wrong here!?!?!


_cornex_

Recommended Posts

Hello there! Today when i was coding, i meet something really weird (To me atleast)..

The thing is, when i try to press the "btnVote" button i try to dump i get id 2 on both.

 

But the id shows right, (1 and 2) on the button etc. But idk what is the wrong here..

Thanks for help

 

Alright, here is the script

<?php include 'engine/init.php'; include 'layout/include/top.php';  


$picture = mysql_select_multi("SELECT * FROM `contest_images` ORDER BY ID ");
$userIp = getIP();
$btnVote = getValue($_POST['btnVote']);

$errors = false;


?>

<p>


   <?php foreach ($picture as $pictures) {
       
   ?>     
<p>
      <div class="content-box">
        
        <div class="content-box-header">
        
          <h3>Picture #<?php echo $pictures['id'] ?></h3>
          
        </div> <!-- End .content-box-header -->
        
        <div class="content-box-content">
          
          <div class="tab-content default-tab">
            <center>
          <form action="" method="POST"><input type="submit" name="btnVote" value="Vote on picture <?php echo $pictures['id'] ?>"></form>
          <?php data_dump($pictures['id']); ?>
        </center>
            <p>
              <center>
             <?php echo '<img src="'.$pictures['image_path'].'" alt="Image" style="width: 800px; height: 500px">'; ?>
           </center>
            </p>
            
          </div> <!-- End #tab3 -->        
          
        </div> <!-- End .content-box-content -->
        
      </div> <!-- End .content-box -->

    
    <?php
       }

         if ($btnVote !== false) {
          #header('Location: http://localhost/contest/?='.$pictures['id']);
        echo data_dump($pictures['id']);
        }

   ?>



<?php include 'layout/include/bot.php'; ?>
Link to comment
https://forums.phpfreaks.com/topic/282908-what-is-wrong-here/
Share on other sites

The thing is, when i try to press the "btnVote" button i try to dump i get id 2 on both.

of what?

 

Shouldn't data_dump($pictures['id']); here

         if ($btnVote !== false) {
          #header('Location: http://localhost/contest/?='.$pictures['id']);
        echo data_dump($pictures['id']);
        }

be data_dump($btnVote);

Link to comment
https://forums.phpfreaks.com/topic/282908-what-is-wrong-here/#findComment-1453646
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.