futrose Posted April 11, 2011 Share Posted April 11, 2011 Can someone tell me why this gives me undefined variables? The $id variable is showing up fine in this bit of code. When I click the link it is supposed to pull the data from the database related to the $id. <a href='javascript: window.document.Vids<?php echo $id; ?>.submit();'>Watch</a> <form name="Vids<?php echo $id; ?>" action="<?php echo $PHP_SELF; ?>" method="post"> <input value="<?php echo $id; ?>" type="hidden" name="Vids" /> </form> here is the code which is supposed to display the info. if (isset($_POST['Vids'])) { $result = mysqli_query($link, "SELECT * FROM vidaud where id =".$_POST['Vids']); echo $id; the error i get is Notice: Undefined variable: id in /services5/webpages/util/b/b/bbctech2.site.aplus.net/public/dbsite/a_newsite/sermons.php on line 32 I'm just not sure why the $id variable isn't being posted by my form and read by the code. Thanks. Quote Link to comment Share on other sites More sharing options...
futrose Posted April 11, 2011 Author Share Posted April 11, 2011 nevermind, I got it. Quote Link to comment 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.