_cornex_ Posted October 12, 2013 Share Posted October 12, 2013 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'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/282908-what-is-wrong-here/ Share on other sites More sharing options...
Solution Ch0cu3r Posted October 12, 2013 Solution Share Posted October 12, 2013 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); Quote Link to comment https://forums.phpfreaks.com/topic/282908-what-is-wrong-here/#findComment-1453646 Share on other sites More sharing options...
_cornex_ Posted October 12, 2013 Author Share Posted October 12, 2013 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); You are so right, my fault.. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/282908-what-is-wrong-here/#findComment-1453699 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.