Hi,
I have script which inserts the users ID into a database by using a standard form and submit however. However I am trying to shrink this all down to an image so someone can click an image which inserts the users ID into the database.
However I am unsure on how to do this. Should I be using a form?
Code:<?php if(isset($_POST['followform'])) { $follow = $_POST['follow']; $query_follow ="UPDATE users SET follow = '".$_POST['follow']."'" ; $result_newUser = mysql_query($query_follow); $result = mysql_query($query_follow) or die("An error occurred ".mysql_error()); } ?> </div> <form class="followform" method="POST" action=""> <div class="forminputcell"> <div class="datainput"> <div class="forminputleft"> Follow: </div> <div class="forminputright"> <input name="follow" type="text" width="10" value="<?php echo $row['id']; ?>" /> </div> </div> <div class="user-area"> <input type="hidden" name="followform" value="submit" /> <input type="submit" name="submit" value="Submit" class="submit-button" /> </div> </div> </form>



Reply With Quote

Bookmarks